Using Pivot in SQL Server to Display dates as days of the week
I have table that has a column of type DateTime, I would like to pivot on the datetime column so that the dates are displayed as columns (as days of the week Monday, Tuesday etc).
So for … Read the rest “Using Pivot in SQL Server to Display dates as days of the week”
MS SQL Server 2005: What Happens If LDF-file are lost?
If I put my MS SQL Log file on another drive and the drive crashes.
What happens to my MS SQL Database, will it create a new log file or how do I correct it?
… Read the rest “MS SQL Server 2005: What Happens If LDF-file are lost?”
Transfer data from partner continuously
I’ve been tasked with a implementing a system for continuously receiving large amounts of data from a partner. The data schema on the partners’ side is different from ours, so some transformation has to take place when the data is received and imported into our … Read the rest “Transfer data from partner continuously”
Suggested replication type?
I have 2 similar tables in different servers, data in certain columns can only be changed by server A while data in other columns can only be changed by server B.
However, I need these tables to always be consistent (1 minute schedule). Is this the kind … Read the rest “Suggested replication type?”
SQL Server: COLLATE CS-CI performance vs UPPER
What’s better to use when comparing columns that could contains values with different cases?
Is Collate faster?
Just trying to figure this out because in our project with tons of data comparisons.
select * from table t1, table t2 where… Read the rest “SQL Server: COLLATE CS->CI performance vs UPPER”
How to store query execution plan so that they can be used later
My applications runs queries against a sql server database.
In many cases I can see the benefit of an execution plan: for example I click for the first time on a button to
SELECT * from Tasks… Read the rest “How to store query execution plan so that they can be used later”
changing SQL Server database collation
Is it possible to change collation for all objects under the database?
For example, if I change the database collation, it should change all the objects (tables,procs,etc.) related to that database.
I had this issue a while ago when we changed the
… Read the rest “changing SQL Server database collation”
Why would a stored procedure perform differently when executed remotely to locally?
We’ve a stored procedure that happens to build up some dynamic SQL and execute via a parametrised call to sp_executesql.
Under normal conditions, this works wonderfully, and has made a large benefit in execution times for the procedure … Read the rest “Why would a stored procedure perform differently when executed remotely to locally?”
SQL Server Management Studio problem creating scripts of procedures
The stored procedure scripts that SQL Server Management Studio 2005 generates for me are like:
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER OFF
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[APY_SP_ACH_Transmit_Finish]’) AND type in (N’P’, N’PC’))
EXEC … Read the rest “SQL Server Management Studio problem creating scripts of procedures”
Create an aggregate function for GROUP BY?
I have a query that outputs results as follows:
. . . .
Namely, it associates a person with one or more foods. I’d like the functionality … Read the rest “Create an aggregate function for GROUP BY?”