Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 DDL statements in OPENQUERY

Author  Topic 

pareshmotiwala
Constraint Violating Yak Guru

323 Posts

Posted - 2011-05-19 : 11:10:02
can we run the following as a part of OPENQUERY in SQL 2008 R2?

ALTER TABLE server.db1.dbo.table1 ADD
PersonGUID uniqueidentifier NULL


Regards
Paresh Motiwala
Boston, USA

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2011-05-19 : 11:43:03
Instead how about

exec ('ALTER TABLE db1.dbo.table1 ADD PersonGUID uniqueidentifier NULL') at server

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

pareshmotiwala
Constraint Violating Yak Guru

323 Posts

Posted - 2011-06-01 : 11:06:58
thanks Nigelrivett

Regards
Paresh Motiwala
Boston, USA
Go to Top of Page
   

- Advertisement -