I need some help for anyone who can help me. Here is my question. I'm writing a stored procedure in which I'm using a select statement which accepts two parameters: one which identifies the column of interest, strColumnName ,and the other which specifies the particular value, @NutriVal, of the rows I want returned to my data grid. The select statement I was attempting to use is as follows:
set @SQL = 'SELECT Food_Name, MType, ' + @strColumnName + ' FROM tblNutritionalData WHERE ' @strColumnName = @NutriVal
Unfortunatly this statement isn't working. What do I need to do to return the rows to my datagrid that contains the particular value, @NutriVal?
Thanks in advanced,
Sorry, but you are not allowed to view signatures , please Register or Login