Reputation: 133
I need to add the same string to the beginning of each record for a varchar column. How would I go about doing this?
So the contents in that column currently look like this:
| TableNames |
--------------
| Table1 |
| Table2 |
| Table3 |
| Table4 |
And I want them to be:
| TableNames |
--------------
| dbo.Table1 |
| dbo.Table2 |
| dbo.Table3 |
| dbo.Table4 |
Upvotes: 0
Views: 2683
Reputation: 30813
You could update the table by using its own entry (TableNames column) like this:
update MyTable set TableNames = 'dbo.' + TableNames;
commit;
and commit is just to commit the execution result.
Upvotes: 1