Solved

ISQL & BCP in MS SQL 6.5

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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

728 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