Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Debugging a WHILE EXISTS
Message
From
02/11/2008 14:18:01
 
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01358902
Message ID:
01359014
Views:
40
>The EXISTS operator only checks if there are any records for specified conditions. It cannot return data. I'm not sure why do you need loop in the first place. Try
>
>UPDATE r SET NoField = f.Numero 
>	FROM Relation r 
>JOIN Field f ON r.Field = f.Field
>
>UPDATE r SET NoField2 = f.Numero 
>	FROM Relation r 
>JOIN Field f ON r.Field2 = f.Field
>
Ok, thanks, but I need to apply more logic. So, I need to select the records at first and loop. What adjustment would I need to do to support that?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform