Open a Text File From SQL Server using xp_cmdshell

For this we need to enable xpCMDShell enable in Surface Area Configuration

Image

 

 

 

 

 

Goto Right Click on Server > Facets

Select Surface Area Configuration

Go to

xPcmdShell enable

Now go to New Query

EXEC master.dbo.xp_cmdshell ‘type d:test.txt’

Image

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Trackbacks/Pingbacks

  1. abhilash - December 29, 2010

    Open a Text File From SQL Server using xp_cmdshell http://www.meabi.com/?p=1570