Category "sql-server"

Test for Upper Case - T-Sql

All, How can I check if a specified varchar character or entire string is upper case in T-Sql? Ideally I'd like to write a function to test if a character is u

SELECT FROM OPENROWSET( BULK...) changing special characters

I've been facing an issue for a few hours, and I can't seem to get my head around this one. So I have a SQL Server database 2008R2, Collation SQL_Latin1_Genera

Regrouping groups in SQL Server

I am trying to solve the below problem, I have an existing dataset that is already grouped, but I need to it to be grouped further based on the common "SO_Numbe

JDBC driver connection problems (sun.jdbc.odbc.JdbcOdbcDriver)

I'm having some issues with the connection with Java and SQL 2008 Express. I'm using sun.jdbc.odbc.JdbcOdbcDriver driver for the connections and have created my

Sum with nulls "not working" in SQL Server / Azure

I'm trying to average a set of columns and exclude rows with zero from the denominator by using a case statement within an AVG() function. I read that avg() exc

Why is my SQL UPDATE syntax giving 'ambiguous column name'?

I am using SQL Server 2014 and I am running the following UPDATE query: UPDATE ReservationStay SET ReasonForstayCode = b.ReasonForStayCode FROM MissingReaso

How to customize migration generation in EF Core Code First?

There is a special base table type in my DbContext. And when inherited from it I need to generate an additional "SQL" migration operation to create a specific t

Connecting Laravel with SQL Server database always shows error "could not find driver"

I want to connect Laravel (version 8), with a SQL Server database (SQL Server 2008 R2). I've done the installation and followed some tutorials with steps like t

Using SQL to join tables with a junction table

I am trying to output data from 2 different tables in my database which are joined by a junction table. Table 1: musician Columns: musicianID, surname, fName

Tabbed Reports in SSRS

I have been working on reports in Sql Server Reporting services and I am trying to create a tabbed report. I wish to have a main report which read in parameter

SSIS - Connection Manager Work Offline is grayed out

I am trying to debug an SSIS package locally, but for some reason the connection manager is offline and it can't be changed. Have anyone faced this issue before

Cannot get Linked Servers to work in Sql Azure

We are using a trial version of Azure. We are trying to perform cross server queries from our SQL Server 2012 in-house. We seem to have our local 2012 linked wi

Fully dynamic Stored SQL Procedures?

Is it possible to have fully dynamic SQL Stored procedures? I've read up on dynamic SQL for the past few hours but couldn't find the "fully dynamic" solution th

Mask the last 4 digit in an account number

I need to do an Select on a table that has many records to mask the Account Number. Example AccNumber : 123400012341234 Output result should look like 1234000

SQL Server convert select a column and convert it to a string

Is it possible to write a statement that selects a column from a table and converts the results to a string? Ideally I would want to have comma separated value

vbscript - SQL Windows Authentication - different user

I want to read data from an SQL Database in my VBS Script. My problem: I need to logon with Windows Authentication and not with an SQL Account. But I cannot use

How to create identity column when importing data from Excel into MS SQL Server (with Import and Export Wizard)?

I need to import great amount of data from excel into MS SQL Server, using the Import/ Export Wizard. Then I'll continue importing more data into the same table

How to enable/disable trigger in procedure?

I have two databases (firstDB and secondDB) on MS SQL server. There is procedure [dbo].[MaintaineIndexes] in firstDB and DatabaseEventsTrigger in secondDB. I wa

How to cast a datetime format to date as string in SQL Server

I am struggling to find a solution for the below issue. date1 = 31-08-2017 12:10:00 I want to cast it as string and need to take date (31-08-2017) alone. Th

Can't select column name from Eloquence database that has a forward slash in it (from a linked server in SQL Server)

My SQL Server instance has a linked server to an Eloquence database. I need to select data from one of the tables in the Eloquence database, but I need to do i