Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - executing sql stored procedure

Reply
 
Old 08-11-2008   #1 (permalink)
november_hotel


 
 

executing sql stored procedure

Hi,

I would like to know if it possible to have a login vbs script that
picks up the username and computer name and then passes this into to a
stored procedure that exists on a mssql 2005 box.

I had the syntax of

dim network

set network = wscript.createobject("wscript.network")

Set WshShell = WScript.CreateObject("WScript.Shell")

Set WshSysEnv = WshShell.Environment("PROCESS")


'The server name is SERVER the database is DB and the proc is
SQLStoredProc

WshShell.Run "osql -S SERVER -E -Q""EXEC DB..SQLStoredProc
Network.username,network.computername"" "

but I understand that oqsl does not work with sql2005 and I cannot get
sqlcmd to work in the same manner.

I hope someone can come to my rescue.
Ta

My System SpecsSystem Spec
Old 08-11-2008   #2 (permalink)
Bob Barrows [MVP]


 
 

Re: executing sql stored procedure

november_hotel wrote:
Quote:

> Hi,
>
> I would like to know if it possible to have a login vbs script that
> picks up the username and computer name and then passes this into to a
> stored procedure that exists on a mssql 2005 box.
>
> I had the syntax of
>
> dim network
>
> set network = wscript.createobject("wscript.network")
>
> Set WshShell = WScript.CreateObject("WScript.Shell")
>
> Set WshSysEnv = WshShell.Environment("PROCESS")
>
>
> 'The server name is SERVER the database is DB and the proc is
> SQLStoredProc
>
> WshShell.Run "osql -S SERVER -E -Q""EXEC DB..SQLStoredProc
> Network.username,network.computername"" "
>
> but I understand that oqsl does not work with sql2005 and I cannot get
> sqlcmd to work in the same manner.
>
> I hope someone can come to my rescue.
> Ta
Use ADO.
http://groups.google.com/group/micro...fedf4e1efd63a6
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Streamreader and BCP vs SqlConnection and a Stored Procedure PowerShell
Could not find Stored Procedure error in VB script VB Script
How can a Record type be returned by a stored procedure? VB Script
Calling a stored procedure from powershell PowerShell
Executing Stored Procedure from Powershell PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46