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
 General SQL Server Forums
 New to SQL Server Programming
 How to use AND statement

Author  Topic 

shahid09
Starting Member

35 Posts

Posted - 2009-06-15 : 15:09:04
Hi All,

I want to build one variable based on the value but I am getting error here:


Select 'ABC_TRAN_ID ='||ABC_TRAN_ID AS PRIMARY_KEY
FROM TABLE.ADJUD_TABLE


My desired out put is

ABC_TRAN_ID = 123456 -- 12345 is a actual value.

Thanks in advance,
SIk

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-06-15 : 15:18:55
Select 'ABC_TRAN_ID = ' + cast(ABC_TRAN_ID as varchar(12)) AS PRIMARY_KEY
FROM TABLE.ADJUD_TABLE



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

shahid09
Starting Member

35 Posts

Posted - 2009-06-15 : 15:43:03
Works great! Thank you so much
Go to Top of Page
   

- Advertisement -