I have an application that builds dynamic parameterized SQL queries. The following query returns an inner exception of "syntax error at or near "="...
I am thinking it is in the way that I am assigning the parameter to the column name but, I'm not sure. Code follows.
SELECT TOP 50 77 AS Repository, DocID, LastFileDate, ImageCount,
LockedUserID, DocClass, Offline, FileType, OrigFileName, C_CredCardSSN, C_CredCardName,C_CredCardDocType, C_CredCardDocDate, C_CredCardStatus
FROM D77
WHERE C_CredCardSSN
LIKE C_CredCardSSN = @sp1%
ORDER BY C_CredCardSSN,C_CredCardName
EDIT: Thanks to everyone. All of these answers helped. =)