I'm using SQL Server 7, and have something like this in a stored procedure (this is a simplified version):
The error is: Line 7: Incorrect syntax near ')'.
Strangely, the following will work:
But the following will not:
Strange. Anyway, I must be missing something here. What is the correct syntax for my case?
Code:
SELECT EmployeeID, Lastname FROM (SELECT Employees.ID AS EmployeeID, Employees.Lastname FROM Employees)
Strangely, the following will work:
Code:
SELECT EmployeeID, Lastname FROM (SELECT Employees.ID AS EmployeeID, Employees.Lastname FROM Employees) GO
Code:
SELECT EmployeeID, Lastname FROM (SELECT Employees.ID AS EmployeeID, Employees.Lastname FROM Employees)
GO