Information générale
Forum:
Microsoft SQL Server
Versions des environnements
SQL Server:
SQL Server 2005
>>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?
>
>There's no setting because table is always created by SELECT INTO regardless how many records are returned.
I see what I was doing wrong. Using sql passthru and was trying to return the results all in one call. Need to split it up into 2 calls, one to create the table and one to retrieve the results.
Thanks Sergey.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement