How to swap the data of two columns in a table. both the
columns containing varchar values.

Answer Posted / ami tkumar

Sorry for previous answer.

DECLARE @temp AS varchar(50)
UPDATE swapdata SET @temp=value2,value2=value1,value1=@temp

Is This Answer Correct ?    5 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a program using SQL queries to find a unique entry in a table.

714


What is model database? : SQL Server Architecture

764


Tell me what is difference between view and materialized view?

695


Can group by be used without aggregate functions?

677


What is the difference between a function and a stored procedure?

753






How to disable a login name in ms sql server?

752


what are defaults? Is there a column to which a default can't be bound? : Sql server database administration

796


What is the usage of sign function?

774


ow to bring suspect mode datbase online from scratch

1573


Can you leave a union at any time?

766


What are the different editions available in sql server 2000?

763


What is field with example?

683


What is sqlcmd?

714


How to get a list of columns in a view using the "sp_columns" stored procedure?

795


Difference between aggregate functions of sql?

837