Bringing table from a server to a local sql server
I got two tables in a rather big sql server database that I need to work on.
Is there any command that will allow me to import the two tables to a
database in my local server. If I do a select * into temptable from
sourcetable it is created in the database of the main server. However I want
the table creation in my local server. Any help is appreciated. Thanks
Re: Bringing table from a server to a local sql server
You can create a linked server to the original database and then use SELECT
INTO to copy the tables from the linked server to your local database:
Also, you can use the Import/Export Wizard to transfer tables:
Note that both methods will not transfer constraints and indexes. If they
are important you can script the tables with all related constraints and
indexes and use them to create the target tables, then import.
In addition you can use the Integration Services Transfer SQL Server Objects
Task (it transfers constraints and indexes too):