Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Verify a TempTable using VFP on SQLServer2000
Message
De
25/02/2008 10:55:12
Bruno Maddalozzo
Informatica Aziendale
Arsie, Italie
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01296055
Message ID:
01296092
Vues:
9
Yes, this is the way I adopted:
SQLEXEC(lnActiveConnection,"SELECT object_id('tempdb..#TempQuery')","LocalCursor")

If Isnull(LocalCursor.Exp)
  SQLEXEC(lnActiveConnection,"create table #TempQuery ID char(36) PRIMARY KEY)")
Endif
Thank you very much Sergey and Naomi.
Bruno


>
>IF object_id('tempdb..#TempQuery') IS NOT NULL
>
>
>>I've the need to create a TempTable in SQL server, if that TempTable doesn't exist yet.
>>
>>I can create it with:
>>SQLEXEC(lnActiveConnection,"create table #TempQuery ID char(36) PRIMARY KEY)")
>>
>>but I can't verify its existence neither with:
>>SQLEXEC(lnActiveConnection,"EXEC sp_tables @table_name = '#TempQuery';")
>>(the statement return 0 records) nor with:
>>SQLEXEC(lnActiveConnection,"EXEC sp_tables @table_name = '#TempQuery', @table_owner = 'dbo', @table_qualifier = 'tempdb';")
>>(this statement return -1).
>>
>>How to get the information?
>>TIA
>>Bruno Maddalozzo
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform