Is it possible drop a constraint on a table by getting the constraint name in a variable and passing that variable to the drop constraint command. Here's an example.
DECLARE @name varchar(10)
SELECT @name = [name] from sysobjects Where xtype = 'F'
and Parent_obj = (SELECT OBJECT_ID('Table1'))
ALTER TABLE Table1
DROP CONSTRAINT @name
When I execute it, I get a "Incorrect syntax near '@name'." error on the Drop Constraint line.
Any ideas? Thanks for any input you may have.