views:

82

answers:

3

Does anyone know if you can drop a constraint on a table via a linked server in SQL 2005

A: 

No, you can't.

Dave Markle
A: 

You can, but you have to use some dynamic SQL trickery to make it happen.

declare @cmd VARCHAR(4000)
SET @cmd = 'Use YourDatabase
ALTER TABLE YourTable
DROP CONSTRAINT YourConstraint'

exec YourServer.master.dbo.sp_executesql @SQL
mrdenny