Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
OK - how do you do this
Message
From
02/01/2001 10:04:30
 
 
To
28/12/2000 10:23:32
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00457333
Message ID:
00458444
Views:
24
All you need to do is create a table to receive the output of the stored procedure via the INSERT statement:
CREATE TABLE #msver  
  (index_val INT,
   name VARCHAR(50),
   internal_value INT,
   character_value VARCHAR(255))

INSERT #msver
   EXEC master.dbo.xp_msver
>I need to write a procedure that receives a database name as a parameter. The procedure must:
>
>1) look up some information (several fields) from that database (+ a known table name) and store it in variables (or something)
>
>2) do further processing with those values in the main procedure.
>
>The problem is that in order to do #1, I must use dynamic SQL - and I see no way to "get the information back out" of that dynamic SQL execution for use in the rest of the main procedure. Any variables I try to assign are "local" to the dynamic SQL execute as are any temp tables I create. I could create a global temp table, but that is not my preferred choice.
>
>How do you do this?
>
>TIA!
Previous
Reply
Map
View

Click here to load this message in the networking platform