You must script all the procedures, and re-create them with ANSI_NULLS on.
If i had a lot to do, i might add a function to my client app.
PseudoCode:
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 get the SQL of a stored procedure programatically on SQL Server: How to generate object scripts without DMO/SMO?
But normally i'll just use Enterprise Manager, starting at the top of the stored procedure list:
- Return
- Ctrl+Home
- Ctrl+V
- Click OK
- Down
- Goto 1
Where my clipboard contains:
SET ANSI_NULLS ON
GO
If you're unfortunate enough to be stuck with SSMS, then you're SOL with that POS, IIRC. TWSS.