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
 SQL Server Development (2000)
 InnerJoins and Insert into a stored procedure

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2000-09-18 : 13:22:18
Simona writes "So, I am using a stored procedure and pated it below only the part which is giving me problems.

-- Insert the rows from employees table into the temp. table
INSERT INTO #TempItems (employees.firstname,employees.lastname, employees.extension, employees.cell, employees.phone, employees.locationID, employees.faxID, locations.location, locations.city, locations.country,fax.faxnumber)

SELECT employees.firstname,employees.lastname, employees.extension,employees.cell, employees.phone,employees.locationID,employees.faxID,locations.location,locations.city,locations.country,fax.faxnumber
FROM employees,locations,fax
WHERE employees.locationID = locations.locationID AND employees.faxID = fax.faxID


So, I am creating a temporary table, to hold values selected from 3 tables. And when I am running the procedure in SQL is tellling me that is not recognizing the values which are belonging to the tables 'locations' and 'fax', is taking and acccepting only the 'employees' values. I bet is something wrong into the syntax of Insert, I tried using only fields names or tablename.fieldname! No result!So, I would really appreciate your help!

Thank you!

PS SQL6.5, for regular Microsoft centric environment."

   

- Advertisement -