You must script execute all the procedures and recreate them using ANSI_NULLS.
If I had a lot to do, I could add a function to my client application.
pseudo code:
procedure FixAllStoredProcedureAnsiNullness(connection) { Strings spNames = GetStoredProcedureNames(connection); foreach spName in spNames { String sql = GetStoredProcedureSQL(connection, spName); //turn on option for remainder of connection connection.ExecuteNoRecords("SET ANSI_NULLS ON"); BeginTransaction(connection); try connection.ExecuteNoRecords("DROP PROCEDURE "+spName); connection.ExecuteNoRecords(sql); CommitTranasction(connection); except RollbackTransaction(connection); raise; end; } }
I had code on how to program SQL stored procedures on SQL Server: how to generate object scripts without DMO / SMO?
But usually I just use Enterprise Manager , starting at the top of the list of stored procedures:
- Return
- Ctrl + Home
- Ctrl + V
- Click OK
- Down
- Go to 1
Where my clipboard contains:
SET ANSI_NULLS ON GO
If you are so sorry that you are stuck in SSMS, then you are SOL with this POS, IIRC. TWSS.
source share