Solved

ISQL & BCP in MS SQL 6.5

Posted on 2002-05-06
5
984 Views
Last Modified: 2008-03-17
Hi, I'm a beginner using MS SQL 6.5. I need to seek help on some of the questions below:

1) How do I make use of ISQL and BCP to extract the results of a stored procedure to an Excel file format?

2) How do I create a stored procedure?

3) How do I create a batch file to run the query every day?

Kindly put in examples to simplify your help.
Thank You.
0
Comment
Question by:jensenaw
5 Comments
 
LVL 4

Expert Comment

by:TheSpirit
ID: 6993364
1) Don't think that ISQL or BCP will export in Excel format exactly BCP can be used to export to a text file which can then be imported into Excel.

2) Take a look at 'Create procedure' in Books on line

3) You would need to create a scheduled task to achieve this, there are a number of ways this task could work (either having a file that is run from a cmdexec task or just coding each tsql command in seperate job steps)

I would recommend having a look at books on line, its just packed with information.
0
 
LVL 8

Expert Comment

by:chigrik
ID: 6994403
Regarding your first question:
you can use ExportToExcel stored procedure to insert the result set of the particular select statement into Excel file.
http://www.MSSQLCity.com/Scripts/SQL65/ExportToExcel.sql

With best regards,
Alexander Chigrik
http://www.MSSQLCity.com/ - all about MS SQL
(SQL Server Articles, FAQ, Scripts, Tips and Test Exams).
0
 

Author Comment

by:jensenaw
ID: 6995480
Hi chigrik,

I have some questions on using your ExportToExcel stored procedure.

1) After putting in the data like server, query statement (I paste the whole query in) and the filename, the result I get is that "this command did not return any rows, or data". When I go and look for the file, I cannot find it.
0
 

Expert Comment

by:CleanupPing
ID: 9280532
jensenaw:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 9620272
PAQ and points refunded

modulo

Community Support Moderator
Experts Exchange
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Copy Database Wizard Error 3 22
SSIS import multiple CSVs into associated tables 3 32
In or Between 2 0
SQL Query 3 0
I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now