Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Referencing a field from a SQL
Message
 
 
To
04/03/2008 20:59:15
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
01298743
Message ID:
01298750
Views:
20
>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--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform