I'm trying to pass the name of a field to an SP. The fieldname will change from time to time. The resulting SQL statement (if done in VB) would look like
Here's what I've got, but needless to say it will not work.Code:"SELECT * FROM tblMytbl WHERE " & myField & "=" & myVarCan anyone help? Thanks.Code:CREATE PROCEDURE myProc @Parm1 varchar(20) -- The field @Parm2 varchar(20) -- The variable AS SELECT * FROM tblMyTbl WHERE @Parm1 = @Parm2


Reply With Quote