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

Answer Posted / san

create table san(empid int,empname varchar(10))
insert into san values(1'san')
update san set empid=empname,empname=empid

Is This Answer Correct ?    0 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you know about normalization and de- normalization?

466


Do you know how to implement service broker?

533


what is a self join? Explain it with an example? : Sql server database administration

495


Define right outer join?

542


What is the security principal at the server level that represents your session?

552






What is primary key, unique key, and foreign key?

534


What is a join in sql?

581


What is the xml datatype?

619


What are the 3 types of schema?

597


Do you know hot add cpu in sql server 2008?

534


What is the difference between Stored Procedures and triggers?

568


what is a deadlock? : Sql server database administration

493


What is a natural primary key?

520


How to add a new column to an existing table with "alter table ... Add" in ms sql server?

571


How do I create a partition table in sql server?

484