December 30, 2009 at 12:04 pm
Hello...
I need to add a varchar type of data into a column without erase any registry of the column.
I need to add it at the end of every registry.
thanks in advance.
December 30, 2009 at 12:16 pm
December 30, 2009 at 12:17 pm
What????
Have you read the SQL Books Online for the syntax for an UPDATE statement?
Can you give us an example of what the "registry" is?
Andrew SQLDBA
December 30, 2009 at 12:26 pm
ok.
table A (original)
c1 c2 c3
a 1 a1
b 2 b2
c 3 c3
d 4 d4
Output
table a
c1 c2 c3
a 1 a1 don´t use
b 2 b2 don´t use
c 3 c3 don´t use
d 4 d4 don´t use
I hope ´my problem is clear now. Thanks for your patience.
December 30, 2009 at 12:36 pm
Im guessing here...
Update yourtable set c3 = c3+' dont use'
Is that what you mean ?
December 30, 2009 at 12:39 pm
Dave Ballantyne (12/30/2009)
Im guessing here...
Update yourtable set c3 = c3+' dont use'
Is that what you mean ?
Yes, but i need to do that for every record in the column.
December 30, 2009 at 12:51 pm
igngua (12/30/2009)
Dave Ballantyne (12/30/2009)
Im guessing here...
Update yourtable set c3 = c3+' dont use'
Is that what you mean ?
Yes, but i need to do that for every record in the column.
As there is no where clause on the update statement , the update will be done on every row in your table.
December 30, 2009 at 1:03 pm
Here we have someone who has no clue as to how to use one the basic 4 elements of the SQL language and they're going to update a whole table. I can smell the burning hair now. 😛
I'd make the strong recommendation that a backup be taken and a restore tested before doing this update, but those two words are probably just as foreign. :hehe:
--Jeff Moden
Change is inevitable... Change for the better is not.
December 30, 2009 at 1:07 pm
LMAO
Exactly Right. At least make a copy of the table first.
Andrew SQLDBA
December 30, 2009 at 1:13 pm
Jeff Moden (12/30/2009)
Here we have someone who has no clue as to how to use one the basic 4 elements of the SQL language and they're going to update a whole table. I can smell the burning hair now. 😛I'd make the strong recommendation that a backup be taken and a restore tested before doing this update, but those two words are probably just as foreign. :hehe:
On a crueller day i could of said "Ahhh, you need to drop database <yourdatabase>"
Im hoping this is day one of picking up a SQL book , and not a mission critical operation. Still , we've seen stranger on here 😉
December 30, 2009 at 1:24 pm
igngua (12/30/2009)
Hello...I need to add a varchar type of data into a column without erase any registry of the column.
I need to add it at the end of every registry.
thanks in advance.
Please don't take this the wrong way... I'm looking out for your best interest. If you don't know how to do this, you should not be attempting this on production data. You need to "practice" first.
My recommendation is that you get at least a basic understanding of what SQL and databases are all about. They have a nice basic SQL Tutorial on w3schools.com where you can actually try some things out.
--Jeff Moden
Change is inevitable... Change for the better is not.
December 30, 2009 at 1:26 pm
Dave Ballantyne (12/30/2009)
Jeff Moden (12/30/2009)
Here we have someone who has no clue as to how to use one the basic 4 elements of the SQL language and they're going to update a whole table. I can smell the burning hair now. 😛I'd make the strong recommendation that a backup be taken and a restore tested before doing this update, but those two words are probably just as foreign. :hehe:
On a crueller day i could of said "Ahhh, you need to drop database <yourdatabase>"
Im hoping this is day one of picking up a SQL book , and not a mission critical operation. Still , we've seen stranger on here 😉
Heh... just to be sure, I wasn't directing that to anyone in particular. This type of stuff just scares the hell out of me for someone's data out there. :hehe:
--Jeff Moden
Change is inevitable... Change for the better is not.
December 30, 2009 at 1:30 pm
it workerd just fine.
thanks to everyone.
Viewing 13 posts - 1 through 12 (of 12 total)
You must be logged in to reply to this topic. Login to reply