May 19, 2010 at 3:52 am
Hey guys
In several of my stored procedures I assign the default value of a parameter as -2147483648 (Int32.MinValue) as well as do comparisons on that value. How can one abstract that away to a global variable of sorts?
It would help me feel more confident that a typo hasn't occurred and that whoever maintains this database has one less thing to worry about. If this needs changing it would speed up the change process quite a bit (even though Redgate has a fantastic - free! - SQL Search tool and change isn't my primary motivation in this)
Thanks
May 19, 2010 at 4:07 am
Unfortunately there's not a built-in tool to do that.
When I have to achieve the same thing I usually put the contants in a "global parameters" table.
To cut down the code lines you could also wrap it with a scalar UDF.
Hope this helps
-- Gianluca Sartori
May 19, 2010 at 8:02 am
Thanks Gianluca.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy