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
 Msg 102, level 15, State 1, Line 5

Author  Topic 

tlouvierre
Starting Member

8 Posts

Posted - 2010-08-31 : 14:58:10
SELECT *
INTO KudlerFineFoods_InformationServices_Backup
FROM KudlerFineFoods_EmployeeID_Table1, KudlerFineFoods_EmployeeID_Table2
INNER JOIN KudlerFineFoods_EmployeeID_Table1, KudlerFineFoods_EmployeeID_Table2
ON KudlerFineFoods_EmployeeID_Table1.P_Id = KudlerFineFoods_EmployeeID_Table2.P_Id

Msg 102, Level 15, State 1, Line 5
Incorrect syntax near ','.

Tiffany D. Louvierre-Ramirez

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-08-31 : 15:16:50
[code]SELECT *
INTO KudlerFineFoods_InformationServices_Backup
FROM KudlerFineFoods_EmployeeID_Table1
INNER JOIN
KudlerFineFoods_EmployeeID_Table2
ON KudlerFineFoods_EmployeeID_Table1.P_Id = KudlerFineFoods_EmployeeID_Table2.P_Id[/code]
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-08-31 : 15:17:24
or this
SELECT *
INTO KudlerFineFoods_InformationServices_Backup
FROM KudlerFineFoods_EmployeeID_Table1 t1
INNER JOIN
KudlerFineFoods_EmployeeID_Table2 t2
ON t1.P_Id = t2.P_Id
Go to Top of Page

tlouvierre
Starting Member

8 Posts

Posted - 2010-09-01 : 19:28:36
Hi Russell,
Thank you for your response. I tried the code and it just runs in the debug query. It does not stop.
What I have been trying to do is merge the above two tables using JOIN. The text book has several examples but none of them match what I am trying to do. I have tried being imaginative and using my brain to try and mix and match my own version and no dice. I am suffering with projects in SQL server 2008 that I can not get finished. My next weeks projects rely on the fact I get these to function. Am I in the right direction? I now I should have back files but I do not know if there is a quicker way of doing this merging of two tables.


Tiffany D. Louvierre-Ramirez
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-09-01 : 20:51:36
Maybe you're trying to UNION the tables instead of JOIN them?

Post the table structures, a few sample rows and the expected output. I'm sure we'll help you get it straightened out.
Go to Top of Page
   

- Advertisement -