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
 General SQL Server Forums
 New to SQL Server Programming
 Create table

Author  Topic 

dr223
Constraint Violating Yak Guru

444 Posts

Posted - 2011-04-15 : 07:49:08
Hi,

I have the following SQL server query which works fine.
What I want to do is when I execute this query I create another table called dbo.copy_TherapyData1 on the tables section with the all the data from the query.. Please any advice


SELECT     TherapyID, eventdate, consid, prodcode, staffid
FROM dbo.copy_TherapyData


Thanks

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2011-04-15 : 07:54:40
SELECT TherapyID, eventdate, consid, prodcode, staffid
into copy_TherapyData1
FROM dbo.copy_TherapyData

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

raghuveer125
Constraint Violating Yak Guru

285 Posts

Posted - 2011-04-15 : 08:02:12
Hey what you need when you run this
SELECT TherapyID, eventdate, consid, prodcode, staffid
FROM dbo.copy_TherapyData

u need to insert its output data into other new table
dbo.copy_TherapyData1 ---For 1 st run
dbo.copy_TherapyData2 ---For 2nd run

Raghu' S
Go to Top of Page
   

- Advertisement -