I'm not sure if you're trying to just run a query that returns a result set with city and state together or if you are actually trying to update your table with the merged column.
If the latter is the case you could do this:
ALTER TABLE MyTable ADD COLUMN location varchar(50)
GO
UPDATE MyTable SET location = city + ', ' + state
ALTER TABLE MyTable DROP COLUMN city
ALTER TABLE MyTable DROP COLUMN state
GO
As David said however, this would cause your data to not be atomic (every column holds only one piece of data) and there probably isn't a good reason to do it. But maybe...
-Mike
|