all groups > sql server new users > october 2006 >
You're in the

sql server new users

group:

Update statement


RE: Update statement Krishnakumar S
10/24/2006 7:13:01 AM
sql server new users: Hi Vayse

Use the following instead

SET ROWCOUNT 500

UPDATE
Account_Handler_0
SET
Account_Handler_0 = 'Anne O Driscoll'
WHERE
Clients.Account_Handler_0='Unallocated - Cork'

SET ROWCOUNT 0

--
Krishnakumar S


[quoted text, click to view]
Re: Update statement Krishnakumar S
10/24/2006 7:18:02 AM
Vayse

Sorry for the previous post . There was a mistake. This is the right one

SET ROWCOUNT 500

UPDATE
Clients
SET
Account_Handler_0 = 'Anne O Driscoll'
WHERE
Account_Handler_0='Unallocated - Cork'

SET ROWCOUNT 0
(untested)
--
Krishnakumar S


[quoted text, click to view]
Update statement Vayse
10/24/2006 2:58:21 PM
For test purposes, I want to fill in some data. Here is the query I'm trying
to run.

UPDATE [SELECT TOP 500 Account_Handler_0 FROM Clients WHERE
(((Clients.Account_Handler_0)='Unallocated - Cork'))]
SET Account_Handler_0 = 'Anne O Driscoll'

It parses ok, but I try to run it, I get this error message:
Invalid object name 'SELECT TOP 500 Account_Handler_0 FROM Clients WHERE
(((Clients.Account_Handler_0)='Unallocated - Cork'))'

Some help on the correct syntax would be great.
Thanks
Vayse

Re: Update statement Vayse
10/24/2006 3:03:31 PM
Its occured to me that it may be the Top statement that is causing the
problem. What I'm trying to do is update 500 'Unallocated - Cork' records,
it doesn't matter which 500.
So if theres a way of doing that, please let me know.


[quoted text, click to view]

Re: Update statement Vayse
10/24/2006 3:38:51 PM
Perfect, thanks.
Vayse

[quoted text, click to view]

AddThis Social Bookmark Button