Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
OK - how do you do this
Message
De
02/01/2001 10:04:30
 
 
À
28/12/2000 10:23:32
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00457333
Message ID:
00458444
Vues:
26
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!
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform