tsql - T-SQL reflection on parameters -


is possible use kind of reflection on parameters in t-sql module (function,procedure)?

procedure x(@foo nvarchar(max),@bar nvarchar(max)) ...  set @foo = isnull(@foo,0);  set @bar = isnull(@bar,0); 

would possible iterate on parameters , set values in loop? or need use sqlclr this?

if you've many parameters need programatically enumerate them have many parameters! maybe switching alternative data structure such table valued parameter or xml document give cleaner way such complex data procedures/functions?

however, if have special need take @ sys.parameters (assuming you're using sql server 2005 or later).


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -