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

Can an entity have two primary keys?

729


What is function of ROLLUP ?

811


Why people hate cursor?

900


Tell me what do we need queues in sql service broker?

712


Why we use functions in sql server?

731


What is sqlservr.exe - process - sql server (sqlex?press)?

801


How to enter comments in transact-sql statements?

723


Explain difference between cross join and full outer join?

746


Explain a differential backup?

756


can an order by clause be used in a creation of a view?

887


how many no of arguments can be passed in procedures and functions

5080


What is an etl file?

703


How optimize sql query with multiple joins in sql server?

599


Why use triggers?

786


What is database replication?

768