Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Server 7.0 vs. 6.0

Status
Not open for further replies.

JamesMuglia

Programmer
Joined
Sep 12, 2001
Messages
2
Location
US
It seems that SQL 7.0 does not like sub queries in its INSERT and UPDATE function using.

Example: UPDATE Ledger
SET Status = '4'
SELECT L.Status
FROM Ledger L
WHERE L.Status = '3'

SQL Sever returns the following error "Subquery Return More Than One Value, This Is Not Permitted When The
Subquerie Follows '=', '<>', '<=',ect....&quot;

The online help made mention of using table alias but this has not given me results yet. I have also viewed the incompatabilities section for SQL server and there are some differences. If you have any suggests please assist.

Thank You, Mark Mathews
 
If I understand what you are trying to do, which appears to be to change all the records in ledger with a status of 3 to a status of 4. Then this will do what you want there is no need for a subquery.

UPDATE Ledger
SET Status = '4'
WHERE Status = '3'

If that is not what you are trying to do, please repost the question with the intended result explained.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top