Login or Sign Up to become a member!
LessThanDot Sit Logo

LessThanDot

Data Management

Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary. Once you register for an account you will have immediate access to the forums and all past articles and commentaries.

LTD Social Sitings

Lessthandot twitter Lessthandot Linkedin Lessthandot friendfeed Lessthandot facebook Lessthandot rss

Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.

Your profile

Search

XML Feeds

Google Ads

Tags: openrowset

comments
Rate Post:
submit to reddit Digg!FacebookDotnetkicks

Sometimes you want to quickly copy some data into a text file or you want append some data to a text file but you don't feel like opening BIDS or the DTS designer. Here is a way to accomplish what you want from within a query window

To copy data into a new file use BCP (Bulk Copy Program). To append to a file use OPENROWSET

Here is some sample code. First create this table

tsql Sample Code (See Article for Rest)
Read More...
comments
Rate Post:
submit to reddit Digg!FacebookDotnetkicks

If you try to execute xp_cmdshell on a fresh install of SQL Server 2005 or 2008 you will be greeted with the following message

Server: Msg 15281, Level 16, State 1, Procedure xp_cmdshell, Line 1

SQL Server blocked access to procedure 'sys.xp_cmdshell' of component 'xp_cmdshell' because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of 'xp_cmdshell' by using sp_configure. For more information about enabling 'xp_cmdshell', see "Surface Area Configuration" in SQL Server Books Online.

...

Read More...
comments
Rate Post:
submit to reddit Digg!FacebookDotnetkicks

Create an excel sheet

In the first 2 rows put some data, save the excel sheet as testing.xls on the c drive

Execute the command below

tsql Sample Code (See Article for Rest)
Read More...