Here is the sql i used.
--Create the table to store file list
CREATE TABLE myFileList (FileNumber INT IDENTITY,FileName VARCHAR(256))
--Insert file list from directory to SQL Server
DECLARE @Path varchar(1024)
SET @Path = 'dir C:\ExcelFiles'
DECLARE @Command varchar(1024)
SET @Command = @Path + ' /A-D /B'
INSERT INTO myFileList
EXEC MASTER.dbo.xp_cmdshell @Command
--Check the list
SELECT * FROM myFileList
DROP TABLE myFileList
When i execute above sql, I get file not found.
I'm sure i did execute same or similar sql below and always worked.
Not sure why it isn't working now.
FYI: C:\ExcelFiles is local to workstation not on sql server and has bunch of excel files.
Maybe it's looking for something on sql server ????
While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online)
The email signat…