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.
Author |
Topic |
shebert
Yak Posting Veteran
85 Posts |
Posted - 2009-08-20 : 15:09:21
|
Helloi can run this on one server serverASELECT column_name=syscolumns.nameFROM sysobjects JOIN syscolumns ON sysobjects.id = syscolumns.idJOIN systypes ON syscolumns.xtype=systypes.xtypeWHERE sysobjects.xtype='U'and sysobjects.name ='PhlatTrac_Order'and this on a differnt server serverBSELECT Vcolumn_name=syscolumns.nameFROM sysobjects JOIN syscolumns ON sysobjects.id = syscolumns.idJOIN systypes ON syscolumns.xtype=systypes.xtypeWHERE sysobjects.xtype='V'and sysobjects.name ='PhlatTrac_order'can I run them both in one query analyser I want to compaire the columns to see if the view code can needs modification....I have lot of views to compareso i started an ssis packageI created 2 object variables Tablescolumn and ViewColumnsanyone know how I can compare these without temp tables? |
|
YellowBug
Aged Yak Warrior
616 Posts |
Posted - 2009-08-20 : 15:40:07
|
You can setup a linked server on serverA to serverB.Then do a SQL query, referencing serverB.databaseB.<schema>.<objectname>If you don't want to setup a linked server (maybe it's just an adhoc query), look up OPENROWSET.This will work without the use of temp tables. |
 |
|
shebert
Yak Posting Veteran
85 Posts |
Posted - 2009-08-20 : 16:01:32
|
I was trying linked servers at first with no luck..... but now that i have a second look at it, I can get the data I need from the other server.SELECT Vcolumn_name=syscolumns.name FROM [LD-ERP-SRV].iERP81_Luminus.dbo.sysobjects JOIN [LD-ERP-SRV].iERP81_Luminus.dbo.syscolumns ON sysobjects.id = syscolumns.id JOIN [LD-ERP-SRV].iERP81_Luminus.dbo.systypes ON syscolumns.xtype=systypes.xtype WHERE sysobjects.xtype='V'and sysobjects.name ='PhlatTrac_order'Thanks for the Nudge in right direction |
 |
|
|
|
|