sql server dts:
Hi,
1) in your execute sql task have the sql statement be something like exec
myStoredProc ?, ?, ? where each "?" is a global variable you want to pass as
a parameter to the stored procedure myStoredProc. Then click the parameters
button and set each parameter (each of the "?") to the global variables.
(the first "?" in the statement is the first parameter to set, the 2nd "?"
the 2nd parameter, etc.)
2) I believe: When you right click and execute a dts package, the package is
running in the Windows security context that you are logged in as and
locally on the machine you are running Enterprise Manager and right clicking
on. When you run it as a job it is running on the server and with whatever
permissions the sql server agent has on the operating system. So if the sql
server agent doesn't have permissions to read the file system on the server,
the package will fail since you are trying to read the file system. So, be
sure the user that the sql server agent runs under has Windows permissions
to access the file system (I am not positive on how to do this without
spending the time to set it up myself, but hopefully it will point you in
the right direction). Perhaps this is what is causing your problem?
HTH,
Justin
[quoted text, click to view] "Jonesgj" <g@btinternet.com> wrote in message
news:c3ifug$k6$1@sparta.btinternet.com...
> Two almost related items:
>
> 1. I have found how to set the values for these dynamically using
VBscript,
> but how can I use these in a Execute SQL Task. For example (from a
previous
> post) I want to collect the sizes of particular drives folders and files
for
> capacity management. I use VBscript FileSystemObject to do this. I can
> update the database directly, but what about storing the values in a
global
> variable and then using a SQL Task, T-SQL to insert the values.
> How do you do this?
>
> 2. I have encountered a problem with my VBscript (above) in that it works
> fine by right clicking and executing the package manually, but I find it
> does not always update the database when run in a scheduled job - I don't
> know why. First look it seems to insert some of the records not all but
what
> ever causes the error, causes the job to fail - I am going to investigate,
> but has anyone else had this problem before??
>
> Thanks
>
> JonesG
>
>