January 16, 2006 at 8:09 pm
Hello All,
I wrote a Select query and got about 500 records out of 15000 records, then I want to update those 500 records one by one manually.
Can I just update those 500 records in the query result window directly rather than go back to the original table and find out those 500 out of 15000?
I find I am not allowed to change the data inside the query result window, is there any way that can let me change it there?
Thanks a lot!
Henry
January 16, 2006 at 8:15 pm
January 16, 2006 at 9:23 pm
You cannot make changes to the data from the 'results pane'. The easiest way would be to re-write your select statement into an update statement.
Alternatively, if you perform the same query through Enterprise Manager, you are able to edit the results.
January 17, 2006 at 2:53 pm
You can edit directly in EM (as Paul) suggested but you'd be better off seeking help with your update statement and doing it in one fell swoop rather than manually updating each row..too painful and leaves the door open for user-errors - also not using sql server to your advantage -
**ASCII stupid question, get a stupid ANSI !!!**
January 17, 2006 at 9:09 pm
Hello David, Paul and Sushila,
The query result pane under the query window in Enterprise Manager doesn't allow me to edit any cell. I can click into any cell, but when I try to edit, it pops me a small message: "cannot edit this cell".
And that's just my question: how to edit the query result pane in EM?
You may have a try. I can't go through it. If you can, tell me how.
In Query Analyser it doesn't allow me to edit either.
I am trying to think out how to write a update query, but as it might involve query loop & if..then, it looks complicated too.
Thanks for your suggestions!
Henry
January 18, 2006 at 12:56 am
The most directly way is writing an update query in the Query Analyser.
The syntax is:
UPDATE tablename
SET FieldName = FieldValue [,FieldxName = FieldxValue]
WHERE wherecondition
The wherecondition is the same as you used for your Select-query;
Success,
Danny
January 18, 2006 at 5:34 am
Henry,
Why don't you post the "select" that gets you your 500 rows as well as itemise the updates you want done...
However complicated it is, I am +ve that someone here will have a solution for you - there're so many SQL giants on this site - you can only benefit from their expertise...
**ASCII stupid question, get a stupid ANSI !!!**
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply