Jump to content

SQL Stored procedure: result to file


Recommended Posts

Hello,

I am busy with a script to run a sql 2005 stored procedure. The Result must be written to a file. How can i do this? See my small script till now.

Thx

Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")

$sqlCon = ObjCreate("ADODB.Connection")
$sqlCon.ConnectionString = "driver={SQL Server};server=xxx;database=xxx;uid=sa;pwd=xxx"
$sqlCon.Open

$status = $sqlCon.State


$strSQL = "EzisDBSize"
$result = $sqlCon.execute ($strSQL)
Link to comment
Share on other sites

The returned $result is an ordinary RecordSet object with all the standard methods and properties of a recordset. What kind of records are expected in the result, and what kind of file did you want to save them in?

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

  • 2 weeks later...

Thanks for the reply.

just in .txt of .csv

The returned $result is an ordinary RecordSet object with all the standard methods and properties of a recordset. What kind of records are expected in the result, and what kind of file did you want to save them in?

:unsure:

Link to comment
Share on other sites

So which of the standard methods for a recordset object did you decide to use?

Perhaps some tutorial help with recordsets?

:unsure:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...