SQL SERVER - delimited identifiers [] don't work when running an Update Query on a Linked Server table -


so have linked server (access mdb database) in sql server. have table in there called xx2 sectors (yes know white spaces in table names/columns bad practice don't have control on in case).

when run select query in form

 select * [server_name]...[xx2 sectors] 

it works fine, when running , update query on table e.g.

update [server_name]...[xx2 sectors] set column_name = 'variable'      column_name = 'whatever'` 

i error: ole db provider "microsoft.ace.oledb.12.0" linked server "server_name" returned message "the microsoft access database engine cannot find input table or query 'xx2'. make sure exists , name spelled correctly."

-> basicaly cuts off table name @ white space point [] should prevent... if rename table xx2 sectors xx2_sectors -> removing white space update query works fine.

any thoughts? think tried , @ loss...

thank you.

try use quotename.

returns unicode string delimiters added make input string valid sql server delimited identifier.

qoutename(xx2 sectors) instead of [xx2 sectors]


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -