Solved

ISQL & BCP in MS SQL 6.5

Posted on 2002-05-06
5
986 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

914 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

14 Experts available now in Live!

Get 1:1 Help Now