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 ????
Long way back, we had to take help from third party tools in order to encrypt and decrypt data. Gradually Microsoft understood the need for this feature and started to implement it by building functionality into SQL Server. Finally, with SQL 2008, …
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…
How can you see what you are working on when you want to see it while you to save a copy?
Add a "Save As" icon to the Quick Access Toolbar, or QAT.
That way, when you save a copy of a query, form, report, or other object you are modifying, you…