Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

combine (+) a binary id with a char select statement in a string

Status
Not open for further replies.

talo

Programmer
Aug 4, 2000
1
US
I need a combination of binary and char string to execute following statement. I could not find a way to convert or cast the binary value.<br><br>DECLARE @SQL varchar(255)<br>SELECT @SQL = 'SELECT * FROM '<br>DECLARE @FieldName varchar(100)<br>SELECT @FieldName = '__ID'<br>DECLARE @SQL1 varchar(255)<br>SELECT @SQL1 = ' WHERE __ID = '<br>DECLARE @TableName varchar(100)<br>SELECT @TableName = 'address'<br>DECLARE @__ID varchar(100)<br>SELECT @__ID = (SELECT __ID FROM address WHERE _SRK_BPAddressNumber = '010246-1')<br>--e.g value for @__ID '0x0000040C00040053'<br>exec (@SQL + @TableName + @SQL1 + @__ID)<br>thanks Gilbert
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top