Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Reliably check if a table exists
Message
De
21/05/2007 05:49:35
 
 
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Versions des environnements
Environment:
C# 2.0
Database:
MS SQL Server
Divers
Thread ID:
01227222
Message ID:
01227231
Vues:
15
> most reliable method of testing if a table exists?
> ... I am using SQL Server compact edition.

I've only ever seen the kind of technique you've shown. You might get slightly quicker/simpler code by using ExecuteScalar and testing for DBNull.Value.

I know this doesn't help, but in SQL 2000+ I usually use this:
if object_id( 'RiaOrder', 'U' ) is not null 
begin
 .... 
end
Change the second parameter to 'P' for procedures.. see Books Online for more.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform