ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories  >>  Software  >>  Databases  >>  SQL Server
 
 


 

 
 Oracle interview questions  Oracle Interview Questions
 SQL Server interview questions  SQL Server Interview Questions
 MS Access interview questions  MS Access Interview Questions
 MySQL interview questions  MySQL Interview Questions
 Postgre interview questions  Postgre Interview Questions
 Sybase interview questions  Sybase Interview Questions
 DB Architecture interview questions  DB Architecture Interview Questions
 DB Administration interview questions  DB Administration Interview Questions
 DB Development interview questions  DB Development Interview Questions
 SQL PLSQL interview questions  SQL PLSQL Interview Questions
 Databases AllOther interview questions  Databases AllOther Interview Questions
Question
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?
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: 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?
Answer
# 1
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
Guest
 

 
 
 
Other SQL Server Interview Questions
 
  Question Asked @ Answers
 
how to replace double quotes by single quotes in sql server CAC2
MULTICAST DELEGATES IN C#.NET WITH REAL TIME EXAMPLE IBM1
What are SQL Jobs, please mention the use of it and how to create them. 247Customer1
What are the differences between stored procedure and functions in SQL Server 2000? TCS12
can foreign key take role of primary key? TCS4
What are the types of indexes available with SQL Server?  2
What is a join and their types? Challenger-Financial2
Can we call SP inside a query? Wipro4
What are Magic Table? Evalueserve15
Alternative way to DetDate() function?  4
What is referential integrity? What are the advantages of it? Digital-Domain3
What is a table called, if it does not have neither Cluster nor Non-cluster Index?  1
When do we use the UPDATE_STATISTICS command?  3
How to perfor If the table running time is taking 2hours and table is having 10 rows in it?  1
How to select Distinct columns from the table, table having 20 columns and i want all coulmns Wipro3
what is the out put of below queries? a. select * from Emp where null = null; b. select * from Emp where 1=1; Patni9
how to find nth highest salary NexGen30
Hi..here i would like to know the Backup and Restore models? HCL2
Can you create UNIQUE and PRIMARY KEY constraints on computed columns in SQL Server 2000? Infosys1
Differences between functions and stored procedures? 247Customer6
 
For more SQL Server Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com