SQL Server: COLLATE CS->CI performance vs UPPER

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.
we use:
select * from … Read the rest “SQL Server: COLLATE CS->CI performance vs UPPER”

How to store query execution plan so that they can be used later

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 … Read the rest “How to store query execution plan so that they can be used later”

changing SQL Server database collation

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.

Solutions/Answers:

Solution 1:

I had this issue a while

Read the rest “changing SQL Server database collation”

Why would a stored procedure perform differently when executed remotely to locally?

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 … Read the rest “Why would a stored procedure perform differently when executed remotely to locally?”

SQL Server Management Studio problem creating scripts of procedures

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
GO
SET QUOTED_IDENTIFIER OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[APY_SP_ACH_Transmit_Finish]’) AND type … Read the rest “SQL Server Management Studio problem creating scripts of procedures”