Skip to content

Instantly share code, notes, and snippets.

xp_cmdshell 'dir z:\'
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: "\\\FileShareName" /user:Azure\StorageAccountName StorageAccountAccessKey'
rafaelvelosoAZ / Enabling xpcmdshell
Last active June 2, 2022 14:26
Query to enable 'xpcmdshell' on SQL Server
EXEC spconfigure 'show advanced options', '1'
-- this enables xpcmdshell
EXEC spconfigure 'xpcmdshell', '1'