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.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

1 Posts

Posted - 03/16/2012 :  16:38:19  Show Profile  Reply with Quote
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 - 03/16/2012 :  16:50:00  Show Profile  Reply with Quote

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
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000