How to swap the data of two columns in a table. both the
columns containing varchar values.
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / mysql
sorry guys, all ur answers are not working properly.
Try to answer in one sql statement.
Is This Answer Correct ? | 2 Yes | 1 No |
Answer / dinesh
select menu from (select m_name as menu from m_master) a
union select m_name as menu from db2 .dbo.m_master
Is This Answer Correct ? | 0 Yes | 1 No |
Answer / dinesh
select names from
(select full_name as names from table 1) a
union
select full_name as names from table 2
Is This Answer Correct ? | 0 Yes | 2 No |
Answer / 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 |
Answer / sandeep rana
create table tmp_t
(
aa varchar2(50),
bb varchar2(50)
)
--insert into tmp_t values('1','5')
select * from tmp_t
update tmp_t set aa=bb , bb=aa
Is This Answer Correct ? | 7 Yes | 12 No |
let's assume you have data that resides on sql server 6.5. You have to move it sql server 7.0. How are you going to do it? : Sql server database administration
What are the advantages of partitioning?
What is the meaning of sql server?
Which stored procedure will you be running to add a linked server?
In performance wise distinct is good or group by is good? eg:select name from emp group by name; select distinct name from emp;
if a parameter is not send to a stored procedure what type of identifier is to be used in Stp and if that parameter is not feed to the a query inside the Stp how to validate with out useing IF condition
What is attribute hierarchy? : sql server analysis services, ssas
How to disable a login name in ms sql server?
what is meant by sql injection with example and one more question how to catch the errors in sqlserver
Can sql server be linked with other servers like oracle?
How to find out the list schema name and table name for the database?
what are the steps you will take, if you are tasked with securing an sql server? : Sql server database administration