1

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

2 Answers2

1

Can you have a Foreign Key onto a View of a Linked Server table in SQLServer 2k5?

I would say you can not.

Community
  • 1
  • 1
Glennular
  • 17,827
  • 9
  • 58
  • 77
1

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
  • 4,990
  • 2
  • 21
  • 28