Tuesday, March 20, 2012

Passing a variable to a job

Is it possible to pass a global variable to a SQL Server 2000 job? Or
is there another solution that I can use - I don't want to store what
I'm passing through as plain text.
Thanks,
SaulHi
Do you mean if you call a stored procedure you'd want to pass a paremeter to
this sp from the client?
As far as I know you cannot do that , however you may want to consider
using DTS Packages which do accepts parameters
<saulmarg@.gmail.com> wrote in message
news:1152168729.543700.124180@.p79g2000cwp.googlegroups.com...
> Is it possible to pass a global variable to a SQL Server 2000 job? Or
> is there another solution that I can use - I don't want to store what
> I'm passing through as plain text.
> Thanks,
> Saul
>|||Hi Uri,
I'm trying to get a VBA app to call a job to call a DTS package which
calls the BCP application to transfer data between two databases. The
BCP app needs a password to access the server.
Any suggestions?
Uri Dimant wrote:[vbcol=seagreen]
> Hi
> Do you mean if you call a stored procedure you'd want to pass a paremeter
to
> this sp from the client?
> As far as I know you cannot do that , however you may want to consider
> using DTS Packages which do accepts parameters
>
>
> <saulmarg@.gmail.com> wrote in message
> news:1152168729.543700.124180@.p79g2000cwp.googlegroups.com...|||Why do you call a job that activates the DTS package? You can activate
the DTS package directly from the application. If you'll activate the
DTS, you'll be able to pass it parameters. If for some reason you have
to use job between the application and the DTS package, then you can
insert you parameter into a table before you run the job. In the
begining of the job you run a select statement on that table in get the
value that was inserted into the table.
Adi
saulmarg@.gmail.com wrote:[vbcol=seagreen]
> Hi Uri,
> I'm trying to get a VBA app to call a job to call a DTS package which
> calls the BCP application to transfer data between two databases. The
> BCP app needs a password to access the server.
> Any suggestions?
>
> Uri Dimant wrote:|||Thanks Adi. I use the job because the VBA app doesn't have features to
record history of jobs etc. The only problem with putting the
parameter into a table is that it's a password which I'd prefer not to
store anywhere. Is there any built in SQL functionality to encrypt and
decrypt?
Adi wrote:[vbcol=seagreen]
> Why do you call a job that activates the DTS package? You can activate
> the DTS package directly from the application. If you'll activate the
> DTS, you'll be able to pass it parameters. If for some reason you have
> to use job between the application and the DTS package, then you can
> insert you parameter into a table before you run the job. In the
> begining of the job you run a select statement on that table in get the
> value that was inserted into the table.
> Adi
> saulmarg@.gmail.com wrote:|||Unfortunately there isn't a built in functionality to encrypt and
decrypt in SQL Server 2000. You can try and develop an extended stored
procedure that does it, but this seems to be a to big and to
complicated task to do:-). I'm sure that there are other companies
that developed such extended stored procedure, but since I didn't need
one I can't recommend a good product (and of course this will cost you
some money). Maybe you can still use the table. You can play around
with the table's permissions and not let anyone run select on this
table. You can let the user that you use in the connection string run
only insert on the table (and not even select) and in the job run the
select statement that will get the password (I assume that the SQL
agent is configured to run under the administrator's account, so the
job would be able to run the select statement).
Adi
saulmarg@.gmail.com wrote:[vbcol=seagreen]
> Thanks Adi. I use the job because the VBA app doesn't have features to
> record history of jobs etc. The only problem with putting the
> parameter into a table is that it's a password which I'd prefer not to
> store anywhere. Is there any built in SQL functionality to encrypt and
> decrypt?
>
> Adi wrote:

No comments:

Post a Comment