Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
Node is saved as draft in My Content >> Draft
  • Interchange the values of two columns in SQL Server

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 38
    Comment on it

    Suppose you have a Customer table in the database with the following data and you want to interchange the values of columns Name and Address.


    Ex:
        CREATE TABLE Customer
        (
         ID int IDENTITY,
         Name varchar(100),
         Address varchar(200)
        )
    


    To interchange the column values of Name and Address we will write the following query.


    UPDATE Customer SET Name=Address , Address=Name 
    
    SQL

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: