Solved

ISQL & BCP in MS SQL 6.5

Posted on 2002-05-06
5
992 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
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…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

739 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