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 |
You want to implement the many-to-many relationship while designing tables. How would you do it?
Which event (check constraints, foreign key, rule, trigger, primary key check) will be performed last for an integrity check?
What is the preferred way to create a clustered and non-clustered index? Which index should you create first the clustered or non-clustered?
What is merge replication?
How do you fine the performance tunning?
What is buffer cash in sql server?
What is the difference between two queries: 1. SELECT * FROM table WHERE 1=1; 2. SELECT * FROM table
What is snapshot replication?
What is bcp? When does it used?
Can we check locks in database? If so, how can we do this lock check?
What will you do If the low Performance occurs?
how many triggers you can have on a table? : Sql server database administration