Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Is it possible to create a stored procedure that runs a
query and outputs the results to a text file and allows me
to add extra delimeters and static field info. If so How?



Is it possible to create a stored procedure that runs a query and outputs the results to a text fi..

Answer / guest

SQL Server has no native command for outputting query
results to a file. You can use the extended
stored procedure xp_cmdshell and call isql (command-line
SQL) with your query and output the results to a file. Any
delimiters would need to be part of the SELECT string:

DECLARE @isqlString varchar(255)

SELECT @isqlString = 'isql -Q "SELECT DateCol FROM
NorthwindTest.dbo.Test" -E -o C:\Results.txt'

EXEC master..xp_cmdshell @isqlString

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL Server Interview Questions

What is the maximum size of a row in sql server?

0 Answers  


What are functions in the sql server?

0 Answers  


How data can be copied from one table to another table?

0 Answers  


Determine how to use the inserted and deleted pseudo tables?

0 Answers  


How do you persist objects, permissions in tempdb

1 Answers  


What is the distinction amongst delete and truncate?

0 Answers  


what is differece between union and union all

6 Answers  


What are the steps need to be take improve the speed of a SQLDATA Server?

2 Answers   IBM,


Write a query to include a constraint, to check whether the employee salary is greater than 5000?

0 Answers   TCS,


Can you explain various data region available in ssrs with their use?

0 Answers  


optimization techinques

0 Answers   Wipro,


Do you know how to store and query spatial data?

0 Answers  


Categories