I'm doing a query to an xml file from a store procedure and when placing the direct route it works. the problem is that the route I want to pass it by parameters and throws me error when placed as variable
DECLARE @XmlFile XML
SELECT @XmlFile = BulkColumn
FROM OPENROWSET(BULK 'C:\example\mixml.xml', SINGLE_BLOB) x;
That's what I did and it works but when applying the change below and placing the path in a variable @file it says incorrect syntax.
DECLARE @XmlFile XML;
DECLARE @file varchar(max);
set @file = 'C:\example\mixml.xml';
SELECT @XmlFile = BulkColumn
FROM OPENROWSET(BULK @file, SINGLE_BLOB) x;
Can someone help me with this?