Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
SQL
ce
clients
clustering
connect
datamining
datawarehouse
dts
fulltext
jdbcdriver
msde
mseq
newusers
notificationsvcs
odbc
olap
programming
replication
reportingsvcs
security
securitytools
server
setup
sqlxml.viewmapper
tools
xml
  
 
date: Mon, 14 Apr 2008 16:03:28 -0500,    group: microsoft.public.sqlserver.tools        back       


Using MS SQL Server Mangement Studio to Copy Table   
Is there a way within the Manager to copy TableA in to a new TableB within 
the same database?

I have a table that is very similar to a new one I need to create.  It would 
be nice if there was a copy/paste/rename feature with in the manager.

Can this be done?

Thanks,
Tom Woods
date: Mon, 14 Apr 2008 16:03:28 -0500   author:   Tom Woods

Re: Using MS SQL Server Mangement Studio to Copy Table   
You may be able to do this with the import/export wizard, however I think it 
would be much easier to use a query window and say:

SELECT * INTO new_table FROM old_table WHERE 1 = 0;

This will copy the structure but not the data.  You will still need to 
re-create indexes, constraints, etc.

A




"Tom Woods"  wrote in message 
news:OFx7tLnnIHA.5472@TK2MSFTNGP03.phx.gbl...
> Is there a way within the Manager to copy TableA in to a new TableB within 
> the same database?
>
> I have a table that is very similar to a new one I need to create.  It 
> would be nice if there was a copy/paste/rename feature with in the 
> manager.
>
> Can this be done?
>
> Thanks,
> Tom Woods
>
date: Tue, 15 Apr 2008 01:37:06 -0400   author:   Aaron Bertrand [SQL Server] a

Re: Using MS SQL Server Mangement Studio to Copy Table   
Another easy thing to do is to right-click the table name in Object 
Explorer, select Script Table As > Create To > and then just grep/replace 
the table names...

A





"Tom Woods"  wrote in message 
news:OFx7tLnnIHA.5472@TK2MSFTNGP03.phx.gbl...
> Is there a way within the Manager to copy TableA in to a new TableB within 
> the same database?
>
> I have a table that is very similar to a new one I need to create.  It 
> would be nice if there was a copy/paste/rename feature with in the 
> manager.
>
> Can this be done?
>
> Thanks,
> Tom Woods
>
date: Tue, 15 Apr 2008 01:38:57 -0400   author:   Aaron Bertrand [SQL Server] a

Re: Using MS SQL Server Mangement Studio to Copy Table   
Thank you for your suggestions.

I ended up using the "Create To" method and then running the sql script.  I 
had never done this before so I was a little wary of running the script.

Thanks,
Tom


"Aaron Bertrand [SQL Server]" <ten.xoc@dnartreb.noraa> wrote in message 
news:266FBA69-BEAA-4C50-BCEB-0033DCF25867@microsoft.com...
> Another easy thing to do is to right-click the table name in Object 
> Explorer, select Script Table As > Create To > and then just grep/replace 
> the table names...
>
> A
>
>
>
>
>
> "Tom Woods"  wrote in message 
> news:OFx7tLnnIHA.5472@TK2MSFTNGP03.phx.gbl...
>> Is there a way within the Manager to copy TableA in to a new TableB 
>> within the same database?
>>
>> I have a table that is very similar to a new one I need to create.  It 
>> would be nice if there was a copy/paste/rename feature with in the 
>> manager.
>>
>> Can this be done?
>>
>> Thanks,
>> Tom Woods
>>
date: Tue, 15 Apr 2008 08:34:47 -0500   author:   Tom Woods

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us