Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Help me plz

Author  Topic 

saranrosy85@gmail.com
Starting Member

3 Posts

Posted - 2008-09-22 : 02:41:54
How to write query for this.

i want to retrieve all the data from a table xxx and i want to insert into another table yyy but in one field(empno of YYY) i want to append with some string(like 'EL').

Thanks in advance

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-09-22 : 02:48:37
Insert into yyy(col1,col2,..)
select col1,col2,cast(empno as varchar(10))+'EL' from xxx

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2008-09-22 : 04:34:10
moved from article discussion

_______________________________________________
Causing trouble since 1980
Blog: http://weblogs.sqlteam.com/mladenp
Speed up SSMS development: www.ssmstoolspack.com <- version 1.0 out!
Go to Top of Page
   

- Advertisement -