Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Referencing a field from a SQL
Message
 
 
À
04/03/2008 20:59:15
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
01298743
Message ID:
01298750
Vues:
22
>In a script environment, I have a IF EXISTS() SQL which extracts one record, if it exists. If it exists, I have a ALTER TABLE DROP CONSTRAINT after. The SQL contains one field. How can I pass that field as a value for the ALTER TABLE DROP CONSTRAINT line?

You can use dynamic sql
SET @sql = 'ALTER TABLE DROP CONSTRAINT ' + @Whatever
EXECUTE (@sql)
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform