Using dynamic sql in openrowset produces error
问题 I need to create a stored procedure that gets a path as a parameter and inserts from file into table via OPENROWSET command. After lots of searching and trying, I learned that OPENROWSET does not support parameters and thus needs to be called with dynamic SQL. That is the part that doesn't work, it shows me a strange error. It could be caused by the OPENROWSET not accepting the string parameter but - I saw many code snippets that are built similarly and users say they work. Please help me