Last post Jul 10, 2019 02:32 AM by Jenifer Jiang
Jul 09, 2019 02:40 PM|jsshivalik|LINK
IN below line i get above error
td = +'<a href="http://localhost:1501/test.aspx?No='+EncryptByPassPhrase('12',[Document No_])+'&Location='+[Location]+'"></a>'
Jul 09, 2019 05:08 PM|PatriceSc|LINK
It doesn't seems to be just this line. If testing with:
SELECT td = +'<a href="http://localhost:1501/test.aspx?No='+EncryptByPassPhrase('12',[Document No_])+'&Location='+[Location]+'"></a>'
-- Sample data for testing
(VALUES (1,'https://site.com/')) AS Data([Document no_],Location)
I get an error because EncryptPassPhrase is not used properly (you'll have that as well once your currrent issue is fixed). The message you shown rather happens when Transact SQL find something not valid at all at this place. For example :
SELECT td='what' 'ever' -- Missing + and so having a literal 'ever' string following a 'what' literal string is just syntactically incorrect.
Jul 10, 2019 02:32 AM|Jenifer Jiang|LINK
According to your description and code, I'm sorry that I could not reproduce your issue successfully.
It seems that there is no such error when testing the above line.
Incorrect syntax near
This error happens becasue there is incorrect syntax in your sql query like missing some symbols or the wrong usage.
I suggest that you could check if there is any incorrect syntax in your query or if possible please share your complete query code.
Such unexpected problems may appear when you copy the code from a web page and the text contains unprintable characters like individual CR or LF and non-breaking spaces.