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 / 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 |
What is Self Join?
What is SQL Server?
What is sql collation?
Explain couple pf features of SQL server
Delete duplicate rows without using rowid.
Explain SELF JOIN ?
Suppose you want to implement the one-to-one relationships while designing tables. How would you do it?
Tell me what is normalization? Explain different forms of normalization?
Define clusters?
What is the preferred way to create a clustered and non-clustered index? Which index should you create first the clustered or non-clustered?
Explain mixed authentication mode of sql server?
how can do you the system monitoring?