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 2005 Forums
 Transact-SQL (2005)
 copy table structure from one server to another se

Author  Topic 

maniztrack
Starting Member

3 Posts

Posted - 2009-10-28 : 02:37:24
How to copy table structure from one server to another server?

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2009-10-28 : 03:06:52
Several ways..

Linked server.
Generating Script.
etc..

I suggest Script..

Right click the DB ->Tasks-> Generate Scripts.. follow the wizard.

Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled

http://senthilnagore.blogspot.com/
Go to Top of Page

maniztrack
Starting Member

3 Posts

Posted - 2009-10-28 : 03:34:28
No i need sql Query for tat...
Go to Top of Page

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2009-10-28 : 05:02:38
Try this

select * into <xxx.xxx.xxx.xxx>.dbo.dest_table_name from source_table
where 1=2

But you need to set up linked server.(keys and indexes are not copied!)

Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled

http://senthilnagore.blogspot.com/
Go to Top of Page
   

- Advertisement -