|
Execute the following
Microsoft SQL Server T-SQL scripts to demonstrate the use of double quotes (") when folder name has imbedded spaces:
-- Place the folder names with spaces in double quotes
declare @command varchar(1000)
set @command = 'dir C:\"Program Files"\"Microsoft Analysis Services"\Bin\Resources\1033'
print @command
exec xp_cmdshell @command
go
-- Place the entire path in double quotes
declare @command varchar(1000)
set @command = 'dir "C:\Program Files\Microsoft Analysis Services\Bin\Resources\1033"'
print @command
exec xp_cmdshell @command
go
Related article:
xp_cmdshell (Transact-SQL)
How to import a flat file into the database?
|