Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using SQL passthru to select into #tempdb but no table r
Message
 
À
28/10/2008 13:36:45
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01357762
Message ID:
01357774
Vues:
14
>I am sending a select statement such as:
>
> Select * into #mytemptbl from mytable where {condition}
>
>but the select has no records matching my condition. But I still need the temp
>table created.
>
>Is there a setting to make the table even if the result set is empty?
>
>Peter

That works for me:
Select * into #mytemptbl from mytable where 1=0
SELECT * FROM #mytemptbl
DROP TABLE #mytemptbl
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform