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.
Author |
Topic |
direrayne
Starting Member
30 Posts |
Posted - 2010-08-08 : 12:11:34
|
I would like to make this query result into a new table.also i cannot get this to run from a linked server. i have tried placeing the " [server\instance].] before the table namesany ideas?SELECT dbo.RM00301.SLPRSNID, dbo.RM00301.ADDRESS1, dbo.RM00301.CITY, dbo.RM00301.STATE, dbo.RM00301.ZIP, dbo.RM00301.COUNTRY, dbo.RM00301.SPRSNSLN, dbo.ICL_Sockeye_FlashReport.LOCNCODE, dbo.ICL_Sockeye_FlashReport.TrxFullPrice, dbo.ICL_Sockeye_FlashReport.TrxFullCost, dbo.ICL_Sockeye_FlashReport.TrxGrossProfit, dbo.ICL_Sockeye_FlashReport.RMSSalesRepName, dbo.ICL_Sockeye_FlashReport.Department, dbo.ICL_Sockeye_FlashReport.DOCDATEFROM dbo.ICL_Sockeye_FlashReport LEFT OUTER JOINdbo.RM00301 ON dbo.ICL_Sockeye_FlashReport.RMSSalesRepID = dbo.RM00301.SLPRSNIDWHERE (NOT (dbo.ICL_Sockeye_FlashReport.Department IN ('MISS', 'TEST'))) AND (NOT (dbo.ICL_Sockeye_FlashReport.RMSSalesRepName IN ('101', '999'))) AND (dbo.RM00301.COUNTRY = 'COMM') and dbo.ICL_Sockeye_FlashReport.LOCNCODE = dbo.RM00301.STATEand Docdate between '7/01/10' and '7/31/10' |
|
slimt_slimt
Aged Yak Warrior
746 Posts |
Posted - 2010-08-08 : 12:35:07
|
create a linked server. |
 |
|
jackv
Master Smack Fu Yak Hacker
2179 Posts |
Posted - 2010-08-08 : 13:06:47
|
Once you've set the linked server up you can then do a 4 part reference. In the example , i've added e.gselect * from from mylinkedserver.master.sys.dm_exec_connectionsJack Vamvas--------------------http://www.sqlserver-dba.com |
 |
|
direrayne
Starting Member
30 Posts |
Posted - 2010-08-08 : 14:51:46
|
The server has already been linked.but it is not working.how about making a a table out of the results?i will be able to xfer the table to the linked server.will a select into statement work? |
 |
|
|
|
|
|
|