Is it possible to get values by keeping parameter in where clause like below :
DECLARE @COLUMNNAME VARCHAR(50)
-- setting required column name
SET @COLUMNNAME = (select name from sys.columns where OBJECT_ID =
(SELECT OBJECT_ID FROM SYS.objects WHERE name = 'BORVALIDATION') AND column_id = 2)
--PRINT @COLUMNNAME (we do get the column name)
SELECT * FROM BORVALIDATION WHERE @COLUMNNAME = 'BBNAME'
Your knowledge and help is highly appreciated.