Recently, while working in SQL Server, I got an interesting thing that removing DISTINCT keyword actually decreased my query performance and increased my search
I'm sure this must be a common coding question, but I don't even know what to call it. For any given Person, I want to find their team - now there may be teams
I have a SQL command like this: UPDATE tableName SET ColA = @ColA, ColB = @ColB, ColC = @ColC WHERE ID = @ID which is executed as the sole command in its ow
I'm looking for how to track changes from a view in MS Sql-Server 2012. And, the role of the log-in user is Public. So, it's hard to do it. For example, Assumi
I want to output all the possible combination in two tables without using cartesian join or cross join. Is this possible?
I have to identify the records with check_in category of S1, T1 and P1 in the check-in-order and pivot the rest of the data until we hit the next category. I wa
say I have 3 values, Bill, Steve, Jack. and I want to randomly update a table with those values, eg Update contacts set firstname = ('Bill','Steve','Jack') whe
Our team recently upgraded our databases from SQL Server 2008 to SQL Server 2012. One breaking change we noticed was in the default order of rows returned by th
I get the following error while trying to create a clustered index The statement has been terminated. Msg 596, Level 21, State 1, Line 0 Cannot continu
I have two tables. Both tables contains an ID that can be used to join them together. However, table 2 can have more than one row for the same ID. Table 1 will
I have a table where all columns are auto-populated whenever an insertion happens: CREATE TABLE … ( ItemID INT NOT NULL IDENTITY(…
I can't seem to find an answer to this anywhere --- I want to convert a datetime in SQL to the excel serial number. I'm essentially looking for the DATEVALUE f
I would like to export whole database schema to XML file. Information there what are needed. tables - columns, data type, pk, fk, views - returned columns, fun
I want to do a batch insert, similar to this question How to do a batch insert in MySQL What is the limitation is SQL Server on how many rows can be inserted