Skip to content

Instantly share code, notes, and snippets.

xp_cmdshell 'dir z:\'
@rafaelvelosoAZ
rafaelvelosoAZ / Mapping the file share
Created June 2, 2022 14:30
Mapping a local from file share to SQL Server
xp_cmdshell 'net use Z: "\\StorageAccountName.file.core.windows.net\FileShareName" /user:Azure\StorageAccountName StorageAccountAccessKey'
@rafaelvelosoAZ
rafaelvelosoAZ / Enabling xpcmdshell
Last active June 2, 2022 14:26
Query to enable 'xpcmdshell' on SQL Server
EXEC spconfigure 'show advanced options', '1'
RECONFIGURE
-- this enables xpcmdshell
EXEC spconfigure 'xpcmdshell', '1'
RECONFIGURE*