Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Default SET OPTIONS for SProc

Author  Topic 

Kristen
Test

22859 Posts

Posted - 2004-07-08 : 13:59:17
I have been slack at putting SET xxx ON/OFF in my SProc source code files, and got bitten by the machine they were run from having unexecpted defaults.

So I'd now like to put a COMPLETE set of SENSIBLE defaults in all my SProc source code files, and adjust them as required (which will be rarely).

Any suggestions on this as a default set please:

SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
SET ARITHABORT ON
SET CONCAT_NULL_YIELDS_NULL ON
SET QUOTED_IDENTIFIER ON
SET NUMERIC_ROUNDABORT OFF
...
CREATE PROCEDURE MySProc
...
AS

SET NOCOUNT ON
SET XACT_ABORT ON

... SProc body ...

SET NOCOUNT OFF

RETURN @intRetVal -- Return error number, 0=No error

Kristen
   

- Advertisement -