Hi I'm trying to queryout a result from table to file using BCP in SQL server 2012 . My T-SQL is as belowexec master.sys.xp_cmdshell BCP "SELECT FileContent FROM [StoreReferenceFiles] WHERE FileId = '1F4CA617-2296-482E-B909-24B69B83EDAA'" queryout "\\spicity605\Pricelist\docs_test.xlsx" -T-nIts throwing me the syntax errorMsg 102, Level 15, State 1, Line 1Incorrect syntax near 'SELECT FileContent FROM [StoreReferenceFiles] WHERE FileId = '1F4CA617-2296-482E-B909-24B69B83EDAA''.Please help
↧