Thursday, 10 January 2013

Query

DECLARE @X VARCHAR(MAX)
DECLARE @y VARCHAR(MAX)
SET @X=(SELECT MARK FROM  dbo.EMP3 WHERE ID =4)
SET @Y ='SELECT * FROM dbo.EMP3  WHERE ID1 IN ('+@X+')'
EXEC(@Y)

No comments:

Post a Comment