I do not think it is possible to do what I do but I ask anyway.
I've found that I include the same variable at the top of each stored process, these variables are used for logging and error handling. They do not make changes between stored procs, it means that if it is fixed but the primary use is to help in readability and is a consistent style.
- possible error DECLARE @CONFLICT_CODE INT SET @ CONFLICT_CODE = -99 - Check for conflict if found & gt; 0 Start = Error = @CONFLICT_CODE END I would like to define these files that I can include in the stored procedure.
I'm developing on SQL Server 2008 on deployment in SQL Server 2005
Another way you can not do this in TSQL, there is no included or macro feature in it
However, you can create UDF in this way:
function DB.CONFLICT_CODE () Make Return Intra Return-99 END This will be replaced in each proc
- possible error for DECLARE @CONFLICT_CODE oath Declare the code INT SET @ CONFLICT_CODE = -99 and you use it
SELECT @rerror = dbo.CONFLICT_CODE ()
Comments
Post a Comment