Posted on: 7/25/2012 9:35:16 PM | Views : 1138

Hello -
I have a query from Access that I need to convert to a stored procedure in Sql Server.
The syntax is as follows:
SELECT table1.Field1, table1.field2, table 1.field 3, table2.field5, table 2.field 6, table 3.field1, table 3.field2, table4.field1, table4.field2
FROM DifferentTable1 INNER JOIN DifferentTable2 INNER JOIN DifferentTable3 INNER JOIN DifferentTable3 INNER JOIN table1 INNER JOIN table2 PM ON table1.fieldx = table2.fieldx ON DifferentTable1.fieldy = table1.fieldy ON table4.fieldz = table1.fieldx
GROUP BY . . .
HAVING . . .
THE ABOVE GENERATES A PIVOT TABLE IN MSACCESS
I am used to writing queries with the syntax:
Select blah, blah, blah
From TableA a
Inner join TableB b ON a.KeyField =  b.KeyField
Inner join TableC c ON a.Keyfield = c.KeyField ETC.
Any clues as to how to translate the MSAccess query to a Sql Server stored procedure will be great ...

Go to the complete details ...