Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)

Author  Topic 

Starting Member

1 Post

Posted - 2012-03-16 : 16:38:19
Hi I am newb to webdesign and using SQL, PHP

in the zones table, I had

without fully understand, I put zone_code and zone_name wronly.
i mean i put the zone_code value which suppose to be zone_name, and the zone_name which suppose to be zone_code. There are more then 1000 lines there.

Can any one please help me and see if any command that can switch the value?

Many thanks in advance.

Not Just a Number

15586 Posts

Posted - 2012-03-16 : 16:50:00

Is Zone_Id an Identity?

SELECT * INTO newZonesTable FROM ZonesTable

UPDATE Z SET Zone_Name = n.Zone_Code, Zone_Code = n.Zone_Name
FROM ZonesTable Z JOIN newZonesTable n
ON Z.Zone_Id = n.Zone_Id

make sure it's right, then drop the newZonesTable

Zone_Id...very Funny

And useful in this case



Hint: Want your questions answered fast? Follow the direction in this link

Want to help yourself?

Go to Top of Page

- Advertisement -