>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--