Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
bonaboard
Starting Member
7 Posts |
Posted - 2010-04-28 : 17:23:01
|
I need to use VBS to export a sql statement to a text file. Any ideas on how?I have it exporting to the screen but haven't had any success going beyond that. (thanks go google)Dim OdbcDSNDim connect, sql, resultSetOdbcDSN = "DSN=untion;UID=runon;PWD=12345"Set connect = CreateObject("ADODB.Connection")connect.Open OdbcDSNsql="SELECT FIRST_NAME, LAST_NAME FROM EMPLOYEE WHERE LAST_NAME = 'ROSS'"Set resultSet = connect.Execute(sql)On Error Resume NextresultSet.MoveFirstDo While Not resultSet.eof WScript.Echo resultSet("LAST_NAME") & " , " & _ resultSet("FIRST_NAME") resultSet.MoveNextLoopresultSet.Closeconnect.CloseSet connect = NothingWScript.Quit(0) |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
bonaboard
Starting Member
7 Posts |
Posted - 2010-04-29 : 09:38:20
|
It doesn't need to be VBS if something else works. It's the first time we've needed to do something like this so my experience is VERY limited. :) |
|
|
Transact Charlie
Master Smack Fu Yak Hacker
3451 Posts |
Posted - 2010-04-29 : 10:51:13
|
This forum is supposed to be for scrips -- it's like a library. Maybe you should post in another forum or get a moderator to move the post.Hey mods -- want to move this?Charlie===============================================================Msg 3903, Level 16, State 1, Line 1736The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION |
|
|
|
|
|