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.
| Author |
Topic |
|
pug2694328
Posting Yak Master
166 Posts |
Posted - 2006-02-24 : 13:40:50
|
| Is there a way to get a boolean to see if something has been declared?I am aware that I can check if the @something user_variable has been SET (IF @something IS NULL PRINT 'Something is null'), but can I check if @Something has been DECLAREd? |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2006-02-24 : 14:05:47
|
| In what circumstance would you be executing T-SQL without knowing which variables are declared? Do you have an example? I suspect you may be greatly overcomplicating something. |
 |
|
|
pug2694328
Posting Yak Master
166 Posts |
Posted - 2006-02-24 : 14:11:12
|
| oh it's definitely a theoretical question... I guess it is partly my just being curious how they are stored. Another question I had along the same vein was whether you could get a list of all the user variables currently in existsance. Could be useful in debugging large blocks of code. |
 |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2006-02-24 : 14:23:17
|
| I don't think you can do that. I am not sure you'd want to, to be honest. In any other programming language, can you enumerate all declared local variables? none that I can think of. |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2006-02-24 : 14:26:33
|
| I can't think of a single reason why this would be useful, especially in T-SQL.Tara Kizeraka tduggan |
 |
|
|
pug2694328
Posting Yak Master
166 Posts |
Posted - 2006-02-24 : 14:34:37
|
| : ) |
 |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2006-02-27 : 20:36:19
|
not sure if you can check tempdb for stuff like thatlet's try --------------------keeping it simple... |
 |
|
|
|
|
|