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 2005 Forums
 Transact-SQL (2005)
 saving query result as a distinct table in a datab

Author  Topic 

shaw
Starting Member

15 Posts

Posted - 2007-05-08 : 12:53:55
hi there,

i have a script that looks like the following:

select m.date_value, m.he, m.poolp, m.bpat, r.kinbasket
from merged4 as m join reservoir as r
on m.date_value = r.date_value

the query gives a result table on the lower pane.
how do I save that results table as a table within the databse?

thanks,

nr
SQLTeam MVY

12543 Posts

Posted - 2007-05-08 : 12:54:30
select m.date_value, m.he, m.poolp, m.bpat, r.kinbasket

into mytable

from merged4 as m join reservoir as r
on m.date_value = r.date_value

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

shaw
Starting Member

15 Posts

Posted - 2007-05-08 : 12:58:47
many thanks nr.

Go to Top of Page
   

- Advertisement -