I am working on a simple update query and i see the below error while executing query. I am very much clear that this should not be a length issue at all. What may be the problem.
Error:
The identifier that starts with identifier is too long. Maximum length is 128
My Query:
update dbo.DataSettings set
Query ="/Details?$filter=(Status ne 'yes' and Status ne 'ok')&$expand=name,Address/street,phone/mobile&$orderby=details/Id desc"
where id=5
Use single quotes and escape your quotes in the text with two single quotes:
update dbo.DataSettings set
set Query= '/Details?$filter=(Status ne ''yes'' and Status ne ''ok'')&$expand=name,Address/street,phone/mobile&$orderby=details/Id desc'
where id=5
You should use single quotes '
(and escape those that are in your string with backslash \
), because now you are assigning Query
to the identifier (in that case, column name) and if it was even the right size for the identifier, you would probably get error like invalid column name :
UPDATE dbo.DataSettings
SET Query ='/Details?$filter=(Status ne \'yes\' and Status ne \'ok\')&$expand=name,Address/street,phone/mobile&$orderby=details/Id desc'
WHERE id = 5
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With