January 8, 2006 at 8:58 am
hello all,
could i limit variables range in sql server stored procedure?
( not to be null , < 5 ...... )
10x.
January 8, 2006 at 10:05 am
Can you provide more details??
January 8, 2006 at 11:43 am
Do you mean parameters? If so, you could do something like this:
-- other statements
Another approach would be to create user defined datatypes and bind rules to them. Then declare variables of that type.
Aunt Kathi Data Platform MVP
Author of Expert T-SQL Window Functions
Simple-Talk Editor
January 9, 2006 at 2:16 am
Asaf, if you are looking for a way to specify a contract, such as in Design-by-Contract supportive languages, for the parameters of the procedure then there is no such support in T-SQL. You will have to write your own assertions as part of the procedure (or place them in reuseable assertion procs of course). Adam Machanic has built a pretty cool assert framework that might be helpful for this. Take a look at http://www.datamanipulation.net/TSQLMacro/tsqlassert.asp.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply