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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 SQL VBScripts in General

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-08-06 : 09:38:48
Chafeek Tomeh writes "Win 2K SP2 & SQL 7.0 no service packs

I would like to be able to use SQL's scheduled Jobs to do the following.

*SQL Server Database 1 - Port punched through firewall
-Receives data from a form off the web - the info will be encrypted using an ASP VBScript and stored in Database 1 - No problems here at all

Problems begin with transfer to Database 2 . . .

*SQL Server Database 2 - Port not punched through firewall
-Will have a scheduled script which will get all the data from Database 1, decrypt it using that same VBScript, and delete everything in Database 1

My questions are two . . .
1) these 2 databases are on 2 different computers, will this communication be possible? Just in case you were wondering, there will be no problem with the firewall preventing communcation, I just want to know if, using VBScripts through SQL Jobs, you can communicate between databases on two different SQL servers.

2) Is there a good source for VBScript syntax through SQL server jobs? I really don't know much at all about using VBScripts THROUGH SQL. It appears that the VBScript used in ASP is considerably different from the VBScript used everywhere else. SQL statements are pretty universal, but the other functions to manipulate the data once retrieved and what not is probably going to be different when using VBScript in SQL versus ASP, right?

I could do all of these things IF it were done through an ASP . . . I would have no problems at all. The problem I'm having is that these things need to be scheduled and rather than using some cheesy scheduling program, I would much rather use SQL's features (however, I am not very familiar with them, but I learn very quickly and plan to do more research).

I appreciate any assistance you can give. If you find that there is an easier way of doing this than what I am suggesting, let me know. I am definitely up for advice. Sorry about the length of this email!"

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2002-08-06 : 09:51:24
OK. I'm just going to touch on point 2, because it is late here and I don't want to comprehend Point 1

VBScript is exactly the same as in ASP, except that when you create an object, you just do Createobject instead of Server.Createobject because you don't have the web server object to use.

Other than that, it's the same.
Putting them into Job steps "should" be the same, however, I have found that a complex script will throw the parser and it won't accept it.

The workaround is, put the script into a DTS task, and call that.
When you have a script task in a DTS job, you need to wrap the script inside a Main() routine, and it must return a valid DTS Return code. The look something like DTS_Step_Return_Success or something, you can find it in BOL

Good luck

Damian

Edited by - Merkin on 08/06/2002 09:52:33
Go to Top of Page
   

- Advertisement -