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 2000 Forums
 SQL Server Development (2000)
 copy a table

Author  Topic 

tahseenm
Yak Posting Veteran

64 Posts

Posted - 2006-10-30 : 12:03:16
just want to get help on to create a duplicate table for testing purposes. I have table name tbl_main but I dont want to test this so I want to create a duplicate table with in that database so that I could test. In Enterprise Manager I select the database and the table I want to copy. Then right click on it and select all task then select Generate Sql Scritp. Click on preview and change the name on the script to tbl_main1 and click ok to copy the script. After this I went back click ok to save it. But can you tell me where to save it or shall I cancell it. I tried different ways but its not creating a duplicate talbe. Any suggestions and help is appreciated.

moetahsen

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2006-10-30 : 12:05:11
select *
into Your_Temp_Table
from tbl_main



Go with the flow & have fun! Else fight the flow
blog thingie: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2006-10-30 : 12:05:36
select * into tbl_main_sav from tbl_main
should do it.

You might want to create indexes on the new table.


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

tahseenm
Yak Posting Veteran

64 Posts

Posted - 2006-10-30 : 12:13:25
So where I am going to put this SQL Statement. Let me know. Thanks!

moetahsen
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2006-10-30 : 12:21:31
where are you going to put it?
run it in query analyzer.



Go with the flow & have fun! Else fight the flow
blog thingie: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

tahseenm
Yak Posting Veteran

64 Posts

Posted - 2006-10-30 : 12:38:37
Yes I got and really appreciated. Also I need to need know If I want my Id# should come out in ascending what I have to do. Thanks and appreciate your comments.This is such a good site to get answer quick. Thanks!

moetahsen
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2006-10-30 : 13:46:29
ORDER BY [ID#]

????



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

tahseenm
Yak Posting Veteran

64 Posts

Posted - 2006-10-30 : 14:14:08
Thanks!

moetahsen
Go to Top of Page

tahseenm
Yak Posting Veteran

64 Posts

Posted - 2006-10-30 : 15:00:18
How to create a new folder in SQL Server. Appreciate your comments.

moetahsen
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2006-10-30 : 15:08:34
quote:
Originally posted by tahseenm

How to create a new folder in SQL Server. Appreciate your comments.

moetahsen



a new folder?

What's that mean exactly?



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

tahseenm
Yak Posting Veteran

64 Posts

Posted - 2006-10-30 : 15:14:41
Somebody ask me a question about to create a folder in SQl Server. Probably they want to add some images etc. Let me know. Thanks!

moetahsen
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2006-10-30 : 15:21:25
Do you mean a directory on the server?

master..xp_cmdshell 'MD D:\Data'

????



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

tahseenm
Yak Posting Veteran

64 Posts

Posted - 2006-10-30 : 15:32:23
Sorry about that let me check the details what exactly they are looking for about the folder and I will let you know. Thanks and really appreciated.

moetahsen
Go to Top of Page
   

- Advertisement -