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
 Transact-SQL (2000)
 create table

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-07-21 : 09:41:59
Dhirendra Chilwal writes "Hi I want to create table at run time. and the new table should bi identical to old table.
Query :
create table T1 as( select * from T2)

but this query is not working.

I've to create T1 table like T2
please send me solution

Regards
Dhirendra"

nr
SQLTeam MVY

12543 Posts

Posted - 2006-07-21 : 09:44:05
select * into T1 from T2


==========================================
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

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-07-21 : 11:27:43
And note that new table wont have any indexes that source table has

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2006-07-21 : 12:01:19
"Hi I want to create table at run time. "
No, you don't. Really.

Help us help YOU!
Read this blog entry for more details: http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspx

*need more coffee*
SELECT * FROM Users WHERE CLUE > 0
(0 row(s) affected)
Go to Top of Page
   

- Advertisement -