Showing posts with label dts. Show all posts
Showing posts with label dts. Show all posts

Wednesday, March 28, 2012

Problems with SQL Server agent

Hi,
I have som problems with a SQL Server agent job.
I have created a DTS package that extracts data from database and saves
the data to a csv file on the
network.
When I run the DTS package manually the file is created and all is OK.
But when I create a scheduled SQL Server agent job to run my DTS
package I get the following error message:
"Executed as user: SERVER\SYSTEM.
DTSRun: Loading...
DTSRun: Executing...
DTSRun OnStart: DTSStep_DTSDataPumpTask_1
DTSRun OnError: DTSStep_DTSDataPumpTask_1, Error = -2147467259
(80004005)
Error string: Error opening datafile: Access is denied.
Error source: Microsoft Data Transformation Services Flat File Rowset
Provider
Help file: DTSFFile.hlp
Help context: 0
Error Detail Records:
Error: 5 (5); Provider Error: 5 (5)
Error string: Error opening datafile: Access is denied.
Error source: Microsoft Data Transformation Services Flat File Rowset
Provider
Help file: DTSFFile.hlp
Help context: 0
DTSRun OnFinish: DTSStep_DTSDataPumpTask_1 D
TSRun: Package execution complete. Process Exit Code 1. The step
failed."
I understand as much as the user running the job hasn't got access to
the file...
So.. how do I change the user that executes the job?
Thanks for your help.
Mikael
McA wrote:
> Hi,
> I have som problems with a SQL Server agent job.
> I have created a DTS package that extracts data from database and saves
> the data to a csv file on the
> network.
> When I run the DTS package manually the file is created and all is OK.
> But when I create a scheduled SQL Server agent job to run my DTS
> package I get the following error message:
> "Executed as user: SERVER\SYSTEM.
> DTSRun: Loading...
> DTSRun: Executing...
> DTSRun OnStart: DTSStep_DTSDataPumpTask_1
> DTSRun OnError: DTSStep_DTSDataPumpTask_1, Error = -2147467259
> (80004005)
> Error string: Error opening datafile: Access is denied.
> Error source: Microsoft Data Transformation Services Flat File Rowset
> Provider
> Help file: DTSFFile.hlp
> Help context: 0
> Error Detail Records:
> Error: 5 (5); Provider Error: 5 (5)
> Error string: Error opening datafile: Access is denied.
> Error source: Microsoft Data Transformation Services Flat File Rowset
> Provider
> Help file: DTSFFile.hlp
> Help context: 0
> DTSRun OnFinish: DTSStep_DTSDataPumpTask_1 D
> TSRun: Package execution complete. Process Exit Code 1. The step
> failed."
> I understand as much as the user running the job hasn't got access to
> the file...
> So.. how do I change the user that executes the job?
> Thanks for your help.
> Mikael
>
Are the SQL Server and SQL Agent services configured to run as "Local
System" or as a domain user? When you run the DTS package manually, it
runs using the permissions that your personal login has. When it runs
from a job, it uses the permissions that SQL Server has. To access
network resources, SQL must be running as a domain user, and that domain
user must have the necessary permissions to access the resource.
Tracy McKibben
MCDBA
http://www.realsqlguy.com
|||Check the services application. Is the SQL Server Agent service running as
a domain user account or as the local system?
You need to make sure that the account that the SQL Server Agent is running
under has permissions to the file/directory.
Keith Kratochvil
"McA" <mikael.ahlberg@.gmail.com> wrote in message
news:1160055899.543735.146020@.i42g2000cwa.googlegr oups.com...
> Hi,
> I have som problems with a SQL Server agent job.
> I have created a DTS package that extracts data from database and saves
> the data to a csv file on the
> network.
> When I run the DTS package manually the file is created and all is OK.
> But when I create a scheduled SQL Server agent job to run my DTS
> package I get the following error message:
> "Executed as user: SERVER\SYSTEM.
> DTSRun: Loading...
> DTSRun: Executing...
> DTSRun OnStart: DTSStep_DTSDataPumpTask_1
> DTSRun OnError: DTSStep_DTSDataPumpTask_1, Error = -2147467259
> (80004005)
> Error string: Error opening datafile: Access is denied.
> Error source: Microsoft Data Transformation Services Flat File Rowset
> Provider
> Help file: DTSFFile.hlp
> Help context: 0
> Error Detail Records:
> Error: 5 (5); Provider Error: 5 (5)
> Error string: Error opening datafile: Access is denied.
> Error source: Microsoft Data Transformation Services Flat File Rowset
> Provider
> Help file: DTSFFile.hlp
> Help context: 0
> DTSRun OnFinish: DTSStep_DTSDataPumpTask_1 D
> TSRun: Package execution complete. Process Exit Code 1. The step
> failed."
> I understand as much as the user running the job hasn't got access to
> the file...
> So.. how do I change the user that executes the job?
> Thanks for your help.
> Mikael
>
|||Hello
It looks like the SQLSERVERAGENT runs with the Local System account.
So if I change the "Log On As" user to at user with rights to my file
I'll be OK?
I'll try that thanks..
Mikael
|||McA wrote:
> Hello
> It looks like the SQLSERVERAGENT runs with the Local System account.
> So if I change the "Log On As" user to at user with rights to my file
> I'll be OK?
> I'll try that thanks..
> Mikael
>
There's more to consider than whether the user has rights to your file,
but yes, that's the solution to your problem. You need to read about
Service Accounts in Books Online before changing anything, to make sure
you understand the requirements.
Tracy McKibben
MCDBA
http://www.realsqlguy.com

Problems with SQL Server agent

Hi,
I have som problems with a SQL Server agent job.
I have created a DTS package that extracts data from database and saves
the data to a csv file on the
network.
When I run the DTS package manually the file is created and all is OK.
But when I create a scheduled SQL Server agent job to run my DTS
package I get the following error message:
"Executed as user: SERVER\SYSTEM.
DTSRun: Loading...
DTSRun: Executing...
DTSRun OnStart: DTSStep_DTSDataPumpTask_1
DTSRun OnError: DTSStep_DTSDataPumpTask_1, Error = -2147467259
(80004005)
Error string: Error opening datafile: Access is denied.
Error source: Microsoft Data Transformation Services Flat File Rowset
Provider
Help file: DTSFFile.hlp
Help context: 0
Error Detail Records:
Error: 5 (5); Provider Error: 5 (5)
Error string: Error opening datafile: Access is denied.
Error source: Microsoft Data Transformation Services Flat File Rowset
Provider
Help file: DTSFFile.hlp
Help context: 0
DTSRun OnFinish: DTSStep_DTSDataPumpTask_1 D
TSRun: Package execution complete. Process Exit Code 1. The step
failed."
I understand as much as the user running the job hasn't got access to
the file...
So.. how do I change the user that executes the job'
Thanks for your help.
MikaelMcA wrote:
> Hi,
> I have som problems with a SQL Server agent job.
> I have created a DTS package that extracts data from database and saves
> the data to a csv file on the
> network.
> When I run the DTS package manually the file is created and all is OK.
> But when I create a scheduled SQL Server agent job to run my DTS
> package I get the following error message:
> "Executed as user: SERVER\SYSTEM.
> DTSRun: Loading...
> DTSRun: Executing...
> DTSRun OnStart: DTSStep_DTSDataPumpTask_1
> DTSRun OnError: DTSStep_DTSDataPumpTask_1, Error = -2147467259
> (80004005)
> Error string: Error opening datafile: Access is denied.
> Error source: Microsoft Data Transformation Services Flat File Rowset
> Provider
> Help file: DTSFFile.hlp
> Help context: 0
> Error Detail Records:
> Error: 5 (5); Provider Error: 5 (5)
> Error string: Error opening datafile: Access is denied.
> Error source: Microsoft Data Transformation Services Flat File Rowset
> Provider
> Help file: DTSFFile.hlp
> Help context: 0
> DTSRun OnFinish: DTSStep_DTSDataPumpTask_1 D
> TSRun: Package execution complete. Process Exit Code 1. The step
> failed."
> I understand as much as the user running the job hasn't got access to
> the file...
> So.. how do I change the user that executes the job'
> Thanks for your help.
> Mikael
>
Are the SQL Server and SQL Agent services configured to run as "Local
System" or as a domain user? When you run the DTS package manually, it
runs using the permissions that your personal login has. When it runs
from a job, it uses the permissions that SQL Server has. To access
network resources, SQL must be running as a domain user, and that domain
user must have the necessary permissions to access the resource.
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||Check the services application. Is the SQL Server Agent service running as
a domain user account or as the local system?
You need to make sure that the account that the SQL Server Agent is running
under has permissions to the file/directory.
Keith Kratochvil
"McA" <mikael.ahlberg@.gmail.com> wrote in message
news:1160055899.543735.146020@.i42g2000cwa.googlegroups.com...
> Hi,
> I have som problems with a SQL Server agent job.
> I have created a DTS package that extracts data from database and saves
> the data to a csv file on the
> network.
> When I run the DTS package manually the file is created and all is OK.
> But when I create a scheduled SQL Server agent job to run my DTS
> package I get the following error message:
> "Executed as user: SERVER\SYSTEM.
> DTSRun: Loading...
> DTSRun: Executing...
> DTSRun OnStart: DTSStep_DTSDataPumpTask_1
> DTSRun OnError: DTSStep_DTSDataPumpTask_1, Error = -2147467259
> (80004005)
> Error string: Error opening datafile: Access is denied.
> Error source: Microsoft Data Transformation Services Flat File Rowset
> Provider
> Help file: DTSFFile.hlp
> Help context: 0
> Error Detail Records:
> Error: 5 (5); Provider Error: 5 (5)
> Error string: Error opening datafile: Access is denied.
> Error source: Microsoft Data Transformation Services Flat File Rowset
> Provider
> Help file: DTSFFile.hlp
> Help context: 0
> DTSRun OnFinish: DTSStep_DTSDataPumpTask_1 D
> TSRun: Package execution complete. Process Exit Code 1. The step
> failed."
> I understand as much as the user running the job hasn't got access to
> the file...
> So.. how do I change the user that executes the job'
> Thanks for your help.
> Mikael
>|||Hello
It looks like the SQLSERVERAGENT runs with the Local System account.
So if I change the "Log On As" user to at user with rights to my file
I'll be OK?
I'll try that thanks..
Mikael|||McA wrote:
> Hello
> It looks like the SQLSERVERAGENT runs with the Local System account.
> So if I change the "Log On As" user to at user with rights to my file
> I'll be OK?
> I'll try that thanks..
> Mikael
>
There's more to consider than whether the user has rights to your file,
but yes, that's the solution to your problem. You need to read about
Service Accounts in Books Online before changing anything, to make sure
you understand the requirements.
Tracy McKibben
MCDBA
http://www.realsqlguy.com

Problems with SQL Server agent

Hi,
I have som problems with a SQL Server agent job.
I have created a DTS package that extracts data from database and saves
the data to a csv file on the
network.
When I run the DTS package manually the file is created and all is OK.
But when I create a scheduled SQL Server agent job to run my DTS
package I get the following error message:
"Executed as user: SERVER\SYSTEM.
DTSRun: Loading...
DTSRun: Executing...
DTSRun OnStart: DTSStep_DTSDataPumpTask_1
DTSRun OnError: DTSStep_DTSDataPumpTask_1, Error = -2147467259
(80004005)
Error string: Error opening datafile: Access is denied.
Error source: Microsoft Data Transformation Services Flat File Rowset
Provider
Help file: DTSFFile.hlp
Help context: 0
Error Detail Records:
Error: 5 (5); Provider Error: 5 (5)
Error string: Error opening datafile: Access is denied.
Error source: Microsoft Data Transformation Services Flat File Rowset
Provider
Help file: DTSFFile.hlp
Help context: 0
DTSRun OnFinish: DTSStep_DTSDataPumpTask_1 D
TSRun: Package execution complete. Process Exit Code 1. The step
failed."
I understand as much as the user running the job hasn't got access to
the file...
So.. how do I change the user that executes the job'
Thanks for your help.
MikaelMcA wrote:
> Hi,
> I have som problems with a SQL Server agent job.
> I have created a DTS package that extracts data from database and saves
> the data to a csv file on the
> network.
> When I run the DTS package manually the file is created and all is OK.
> But when I create a scheduled SQL Server agent job to run my DTS
> package I get the following error message:
> "Executed as user: SERVER\SYSTEM.
> DTSRun: Loading...
> DTSRun: Executing...
> DTSRun OnStart: DTSStep_DTSDataPumpTask_1
> DTSRun OnError: DTSStep_DTSDataPumpTask_1, Error = -2147467259
> (80004005)
> Error string: Error opening datafile: Access is denied.
> Error source: Microsoft Data Transformation Services Flat File Rowset
> Provider
> Help file: DTSFFile.hlp
> Help context: 0
> Error Detail Records:
> Error: 5 (5); Provider Error: 5 (5)
> Error string: Error opening datafile: Access is denied.
> Error source: Microsoft Data Transformation Services Flat File Rowset
> Provider
> Help file: DTSFFile.hlp
> Help context: 0
> DTSRun OnFinish: DTSStep_DTSDataPumpTask_1 D
> TSRun: Package execution complete. Process Exit Code 1. The step
> failed."
> I understand as much as the user running the job hasn't got access to
> the file...
> So.. how do I change the user that executes the job'
> Thanks for your help.
> Mikael
>
Are the SQL Server and SQL Agent services configured to run as "Local
System" or as a domain user? When you run the DTS package manually, it
runs using the permissions that your personal login has. When it runs
from a job, it uses the permissions that SQL Server has. To access
network resources, SQL must be running as a domain user, and that domain
user must have the necessary permissions to access the resource.
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||Check the services application. Is the SQL Server Agent service running as
a domain user account or as the local system?
You need to make sure that the account that the SQL Server Agent is running
under has permissions to the file/directory.
--
Keith Kratochvil
"McA" <mikael.ahlberg@.gmail.com> wrote in message
news:1160055899.543735.146020@.i42g2000cwa.googlegroups.com...
> Hi,
> I have som problems with a SQL Server agent job.
> I have created a DTS package that extracts data from database and saves
> the data to a csv file on the
> network.
> When I run the DTS package manually the file is created and all is OK.
> But when I create a scheduled SQL Server agent job to run my DTS
> package I get the following error message:
> "Executed as user: SERVER\SYSTEM.
> DTSRun: Loading...
> DTSRun: Executing...
> DTSRun OnStart: DTSStep_DTSDataPumpTask_1
> DTSRun OnError: DTSStep_DTSDataPumpTask_1, Error = -2147467259
> (80004005)
> Error string: Error opening datafile: Access is denied.
> Error source: Microsoft Data Transformation Services Flat File Rowset
> Provider
> Help file: DTSFFile.hlp
> Help context: 0
> Error Detail Records:
> Error: 5 (5); Provider Error: 5 (5)
> Error string: Error opening datafile: Access is denied.
> Error source: Microsoft Data Transformation Services Flat File Rowset
> Provider
> Help file: DTSFFile.hlp
> Help context: 0
> DTSRun OnFinish: DTSStep_DTSDataPumpTask_1 D
> TSRun: Package execution complete. Process Exit Code 1. The step
> failed."
> I understand as much as the user running the job hasn't got access to
> the file...
> So.. how do I change the user that executes the job'
> Thanks for your help.
> Mikael
>|||Hello
It looks like the SQLSERVERAGENT runs with the Local System account.
So if I change the "Log On As" user to at user with rights to my file
I'll be OK?
I'll try that thanks..
Mikael|||McA wrote:
> Hello
> It looks like the SQLSERVERAGENT runs with the Local System account.
> So if I change the "Log On As" user to at user with rights to my file
> I'll be OK?
> I'll try that thanks..
> Mikael
>
There's more to consider than whether the user has rights to your file,
but yes, that's the solution to your problem. You need to read about
Service Accounts in Books Online before changing anything, to make sure
you understand the requirements.
Tracy McKibben
MCDBA
http://www.realsqlguy.com

Monday, March 12, 2012

problems with import using DTS

OK this is a strange one.

I'm using the DTS to import a csv file into a table sql server. The test works fine but when I go to execute I get an error saying theirs a conversion problem with one of the fields in the csv file and the db field. The first one was a column called price which in the csv file takes the format $3.99 etc, the corresponding field type in the db is 'Money'.

So to make it happy I just removed the association between them and tried it again. This time I got another conversion error on a Field called 'Weight' ie 1.3, the corresponding field in the db is of type Decimal.?@.#$$#%

Why won't DTS accept these conversions they look correct to me.

Please help.I think you should use the Microsoft Text Driver instead of OLEDB to import CVS, and sometimes SQL Server have problem taking money from CVS or other sources try Numeric for money and integer for Decimals. Hope this helps.

Kind regards,
Gift Peddie

Friday, March 9, 2012

Problems with DTS package. Access denied

Hi,

I made a DTS-package and it works when I execute it manually, but when it is
run by the SQL Server Agent, it fails.

I have use the guide to create a maintenance plan. That doesn't work so good
either. It runs Optimizations, but not integrity checks or backups (probably
because integrity checks failed).

The following from the log file:
Executed as user: HT-DOMAIN\INTRAB-SQL. ...:

DTSStep_DTSExecuteSQLTask_2 DTSRun OnFinish: DTSStep_DTSExecuteSQLTask_2
DTSRun OnStart: DTSStep_DTSExecuteSQLTask_1 DTSRun OnFinish:
DTSStep_DTSExecuteSQLTask_1 DTSRun OnStart: DTSStep_DTSDataPumpTask_1
DTSRun OnStart: DTSStep_DTSDataPumpTask_3 DTSRun OnError:
DTSStep_DTSDataPumpTask_1,

Error = -2147024891 (80070005) Error string: Access is denied.
Error source: Microsoft Data Transformation Services (DTS) Package
Help file: sqldts80.hlp Help context: 1100 Error Detail Records:
Error: -2147024891 (80070005); Provider Error: 0 (0) Error string:
Access is denied. Error source: Microsoft Data Transformation
Services (DTS) Package Help file: sqldts80.hlp Help context:
1100 Error: -2147024891 (80070005); Provider Error: 0 (0)
Error string: Cannot open a log file of specified name. Access is denied.
Error source: Micr... Process Exit Code 1. The step failed.

Log-file endeth here....

My "data-sources"/Connections is set up to use sql-server
authentication where I enter superuser name+password, not windows
authentication.

If I browse around using SQL-EM:
Under Security - Logins HT-DOMAIN\intrab-sql:
Tab General: Grant Access
Tab Server Roles: System Administrators
Tab Database Access: checkmark at Mbestil, user=dbo; database roles
for mbestil = public + db_owner

I also have som problems identifying where the package fails. I have given
the individual "steps"/"transformations" some pretty good names, but in the
log-file it still shows the "old" names.

The DTS package empties a table, then fills it by copying data from another
table in another database on another server.

Anyone with some useful tips ?

/jimIn the services management you will find SQL Agent is
configured with a user account on the operating system.
What OS are you on?

This OS account needs the appropriate DB access that is
equivalent to yours when running interactively.

Once this is fixed, because SQL Agent handles the automated
tasks, your backups, reorganisations, maintenance plans,
DTS tasks and anything else you need to automate in
the environment should have no problems in running
unattended.

Hope this helps.

Pete Brown
Falls Creek
Oz

"Jim Andersen" <jimVK@.officeconsult.dk> wrote in message
news:btdvco$1ad$1@.sunsite.dk...
> Hi,
> I made a DTS-package and it works when I execute it manually, but when it
is
> run by the SQL Server Agent, it fails.
> I have use the guide to create a maintenance plan. That doesn't work so
good
> either. It runs Optimizations, but not integrity checks or backups
(probably
> because integrity checks failed).
> The following from the log file:

...[trim]...

> Log-file endeth here....
> My "data-sources"/Connections is set up to use sql-server
> authentication where I enter superuser name+password, not windows
> authentication.
> If I browse around using SQL-EM:
> Under Security - Logins HT-DOMAIN\intrab-sql:
> Tab General: Grant Access
> Tab Server Roles: System Administrators
> Tab Database Access: checkmark at Mbestil, user=dbo; database roles
> for mbestil = public + db_owner
> I also have som problems identifying where the package fails. I have given
> the individual "steps"/"transformations" some pretty good names, but in
the
> log-file it still shows the "old" names.
> The DTS package empties a table, then fills it by copying data from
another
> table in another database on another server.
> Anyone with some useful tips ?
> /jim|||mountain man wrote:
> In the services management you will find SQL Agent is
> configured with a user account on the operating system.

Found it.

> What OS are you on?

Will check (not at problem site right now)

> This OS account needs the appropriate DB access that is
> equivalent to yours when running interactively.

Why ? I can understand it, when it comes to the backup, etc. But I have
supplied the name and password in the Connection properties in the DTS
package. And I _think_ (will have to check) that it actually empties the
table (first step in the package).

> Once this is fixed, because SQL Agent handles the automated
> tasks, your backups, reorganisations, maintenance plans,
> DTS tasks and anything else you need to automate in
> the environment should have no problems in running
> unattended.

I sure hope it has some kind of domino-effect :-)

> Hope this helps.

Me too. Will get back.
thx
Jim

> "Jim Andersen" <jimVK@.officeconsult.dk> wrote in message
> news:btdvco$1ad$1@.sunsite.dk...
>> Hi,
>>
>> I made a DTS-package and it works when I execute it manually, but
>> when it is run by the SQL Server Agent, it fails.
>>
>> I have use the guide to create a maintenance plan. That doesn't work
>> so good either. It runs Optimizations, but not integrity checks or
>> backups (probably because integrity checks failed).
>>
>> The following from the log file:
> ...[trim]...
>> Log-file endeth here....
>>
>> My "data-sources"/Connections is set up to use sql-server
>> authentication where I enter superuser name+password, not windows
>> authentication.
>>
>> If I browse around using SQL-EM:
>> Under Security - Logins HT-DOMAIN\intrab-sql:
>> Tab General: Grant Access
>> Tab Server Roles: System Administrators
>> Tab Database Access: checkmark at Mbestil, user=dbo; database roles
>> for mbestil = public + db_owner
>>
>> I also have som problems identifying where the package fails. I have
>> given the individual "steps"/"transformations" some pretty good
>> names, but in the log-file it still shows the "old" names.
>>
>> The DTS package empties a table, then fills it by copying data from
>> another table in another database on another server.
>>
>> Anyone with some useful tips ?
>>
>> /jim|||"Jim Andersen" <jimVK@.officeconsult.dk> wrote in message
news:btgjk3$r7u$1@.sunsite.dk...
> mountain man wrote:

> > This OS account needs the appropriate DB access that is
> > equivalent to yours when running interactively.
> Why ? I can understand it, when it comes to the backup, etc.

I believe all tasks run via SQL Agent will try to use the SQL Agent
user account nominated in the services detail.

> But I have
> supplied the name and password in the Connection properties in the DTS
> package. And I _think_ (will have to check) that it actually empties the
> table (first step in the package).

Also check the name of the owner (you, admin?) of the automated package.
The SQL Agent account needs to have equivalent access on the database end.

> > Hope this helps.
> Me too. Will get back.

Good luck with it Jim. Sometimes it is a little fiddly getting SQL Agent
up and running for the first time. Also, there have been a multitude of
threads in here in the past concerning this very issue.

So if the MS doco is not conducive to the solution, try an advance google
through the mssql newsgroups only, for the term "SQL Agent". If all else
fails write back.

Pete Brown
Falls Creek
Oz|||mountain man wrote:
> "Jim Andersen" <jimVK@.officeconsult.dk> wrote in message
> news:btgjk3$r7u$1@.sunsite.dk...
>> mountain man wrote:
>>> This OS account needs the appropriate DB access that is
>>> equivalent to yours when running interactively.
>>
>> Why ? I can understand it, when it comes to the backup, etc.
> I believe all tasks run via SQL Agent will try to use the SQL Agent
> user account nominated in the services detail.
>> But I have
>> supplied the name and password in the Connection properties in the
>> DTS package. And I _think_ (will have to check) that it actually
>> empties the table (first step in the package).
> Also check the name of the owner (you, admin?) of the automated
> package. The SQL Agent account needs to have equivalent access on the
> database end.

User JIM is now system administrator equivalent on the server. I split the
package in 3 parts to avoid any misunderstandings about workflow. All
packages are owned by JIM

Pack1 copies data from a remote server table to local table X.
Pack2 massages data from local table X and copies it to another local table
Y.
Pack3 copies some other data from remote server to another local table.

And then 3 jobs in sql server agent, 1 minute apart (each task takes a
second or 2).
It is Pack2 that fails. "Error string: Cannot open a log file of specified
name. Access is denied."
What does that mean ?

All packages run fine when I execute them manually.

I would have expected it to be either pack1 or 3. But now I think I'm gonna
change pack3 so it reads AND massages data from the remote server table to
local table Y.

It just puzzles me...

/jim|||"Jim Andersen" <jimVK@.officeconsult.dk> wrote in message news:<bu5svi$s7t$1@.sunsite.dk>...
> mountain man wrote:
> > "Jim Andersen" <jimVK@.officeconsult.dk> wrote in message
> > news:btgjk3$r7u$1@.sunsite.dk...
> >> mountain man wrote:
> >>> This OS account needs the appropriate DB access that is
> >>> equivalent to yours when running interactively.
> >>
> >> Why ? I can understand it, when it comes to the backup, etc.
> > I believe all tasks run via SQL Agent will try to use the SQL Agent
> > user account nominated in the services detail.
> >> But I have
> >> supplied the name and password in the Connection properties in the
> >> DTS package. And I _think_ (will have to check) that it actually
> >> empties the table (first step in the package).
> > Also check the name of the owner (you, admin?) of the automated
> > package. The SQL Agent account needs to have equivalent access on the
> > database end.
> User JIM is now system administrator equivalent on the server. I split the
> package in 3 parts to avoid any misunderstandings about workflow. All
> packages are owned by JIM
> Pack1 copies data from a remote server table to local table X.
> Pack2 massages data from local table X and copies it to another local table
> Y.
> Pack3 copies some other data from remote server to another local table.
> And then 3 jobs in sql server agent, 1 minute apart (each task takes a
> second or 2).
> It is Pack2 that fails. "Error string: Cannot open a log file of specified
> name. Access is denied."
> What does that mean ?
> All packages run fine when I execute them manually.
> I would have expected it to be either pack1 or 3. But now I think I'm gonna
> change pack3 so it reads AND massages data from the remote server table to
> local table Y.
> It just puzzles me...
> /jim

You might find this KB article useful - it gives quite a lot of detail
on how scheduled DTS packages are executed, and which security
contexts are relevant:

http://support.microsoft.com/defaul...4&Product=sql2k

Simon

Problems with DTS package

I am working on sql server 2000.

here is my question.

How can I update a table from the data in a text file.

I created a DTS package to do this job. I am able to insert the data from text file to a table perfectly. But What I want is to update the existing row instead of inserting a new row.

Here is sample data:

text file:

col1 col2

1 A

2 B

data in the table:

Col1 Col2

1 C

2 B

Now I want to update the first row for which the col2 is not matching. How can i do this. I wrote a activex script (for transformation) to update but it alwasy trys to insert rather than update, Here is the script.

Function Main()
if DTSDestination("Col1") = DTSSource("Col001") and DTSDestination("Col002") <> DTSSource("Col002") then
update DTSDestination
set DTSDestination("Col002") = DTSSource("Col002")
end if
Main = DTSTransformStat_OK
End Function

Thanks in advance

The script code that you posted should actually error out. It contains VB code with TSQL code. In any case, it looks like you should use a staging table approach and simply insert all the rows into server first & then use DMLs. This is the most efficient way. If you do it from the DTS package you are doing row-by-row processing and performance will suffer. Below are steps

1. Create staging table on server that contains same structure as destination table

2. Create a SP that does the following:

begin

update your_table

set Col2 = s.Col2, Col3 = s.Col3, ...

from staging_table as s

where s.Col1 = your_table.Col1

insert into your_table (Col1, Col2, Col3, ....)

select s.Col1, s.Col2, s.Col3, ...

from staging_table as s

where not exists(

select * from your_table as t

where t.key_col1 = s.key_col1

and ....

)

truncate staging_table

end

Now, modify your DTS package to do the following:

1. Bulk insert into the staging table

2. Call SP to update data from staging to main table

|||Thanks a lot for your advice

Problems With DTS Migration of Database

I am trying to migrate a database from one server to another. The existing database is running under MS SQL Server 7.0, and the new one is running under MS SQL Server 2000.

I'm using SQL Server 7.0's Enterprise manager to transfer the database using DTS.

Both databases are on large SQL servers, shared by many users at the ISP, meaning that my SQL login is not the dbo, and has full permissions to the specific database, but not the the SQL server itself ( ie. I can't add logins, databases, etc. )

When I try to copy the tables from the existing database, to the new one running 2000 I get the following error:

::Error::
In file in statement on line 0
Transfer Status: Beginning Transfer of Data
[Microsoft][ODBC SQL Server Driver][SQL Server]Only members of the sysadmin role or the database owner may set database options.


I've told DTS to "transfer objects and data between sql server 7.0 databases". Further, under "options" I deselected "Transfer database users and database roles", "Transfer SQL Server Logins", and "Transfer object-level permissions"

I get the same error to matter what tables/views/stored procedures I try to transfer, and no matter which options I seem to have selected..

What is causing this error? Is it simply that I'm using SQL 7.0 DTS ( w/ SP4 ) to do the transfering from a SQL 7.0 to a SQL 2000 database?

Thanks!

BriceBriceB,

You can`t transfer objects, because your are not a member of sysadmins.

The DTS try to keep some properties, that only this members can create!

------------------------

You may try this too:

Generate all Scripts (tables, SP, triggers, Contraints, etc) and execute then in your new SQL Server.

Then, use DTS only to transfer DATA to the new server.|||Diogo,
Thanks for the response. As you probably know, I am a complete newbie to MS SQL & DTS alltogether.

I don't understand the difference between "objects" and tables/sps/etc..

Also, how do you have DTS only transfer "data" to the tables/sps/etc. I've created using scripts? Under my understanding, DTS offers 3 options:

1) Copy Table(s) from source database
2) Use Query
3) Copy Objects and Data

I guess under #3 I should deselect create destination objects, and transfer all objects, then go into options and deselect all the security options??

Thanks,

Brice|||Make this:
In the SQL 7.0
- Right-Click on the Database, "All Tasks", "Generate SQL Script"
- Then, click on the button "SHOW ALL"
- Select "Script All Objects"
- Then, go to the OPTIONS TAB
- Mark, "Script Indexes", "Script full-text indexes", "Script Triggers", "Script PRIMARY, keys, FOREIGN keys..."
- Now, click OK
- Save this file.

Now, open SQL Query Analyzer and connect to your new Database in SQL Server 2000
- Open the saved File (script from database objects above)
- execute it! (Is should create all tables, SP, etc.;)

ufa!

Now,
Go to DTS, and when he ask for you:
1) Copy Table(s) from source database <--
2) Use Query
3) Copy Objects and Data

Your answer will be 1)!!!!

He will copy all the data from the source tables to the destination tables.

------------------------

You can do this choosing 3) too! But you shouldn`t execute the created script;

Your answer should work too! But I like to create the scripts and execute them. Therefore, bring Data!

Problems with DTS in SQL 2005

Hi, I'm try to edit/run DTS packages against a SQL 2005 (developer edition)
database. I installed the download to support the DTS designer, but
occasionally the designer still prompts for the download and then (usually)
crashes.
Sometimes, however, it works fine -- sort of. In Bulk Insert task, I can't
get the task to recognize the .fmt file specified. The step fails and then
the format file name is changed in the step to the destination table name in
the step properties. It looks like DTS is ignoring the .fmt file and trying
to do the conversion itself. Weird.
Any help or appropriate KB articles would be appreciated.
Thanks,
Beige Bond
http://www.aspnetworkshop.com/
More detail on this: SQL 2005 seems to have a problem importing 2000 DTS
packages correctly in some situations. I think it depends on how they were
exported. I can get export/import to work but it takes a couple tries
sometimes.
The .fmt problem was just an error in the DTS. (oops)
"Beige Bond" <BeigeBond@.hotmail.com> wrote in message
news:%23j%23MK5UPGHA.3016@.tk2msftngp13.phx.gbl...
> Hi, I'm try to edit/run DTS packages against a SQL 2005 (developer
> edition) database. I installed the download to support the DTS designer,
> but occasionally the designer still prompts for the download and then
> (usually) crashes.
> Sometimes, however, it works fine -- sort of. In Bulk Insert task, I can't
> get the task to recognize the .fmt file specified. The step fails and then
> the format file name is changed in the step to the destination table name
> in the step properties. It looks like DTS is ignoring the .fmt file and
> trying to do the conversion itself. Weird.
> Any help or appropriate KB articles would be appreciated.
> Thanks,
> Beige Bond
> http://www.aspnetworkshop.com/
>

Problems with DTS execution

I am new to this thing so don't know where exactly to post this thread.

Pls help me to solve the problem.

I am having DTS package which uploads a database table in SQL server 2000. When I am executing the package manually I get the desired results. Now when I call the pacakge execution from C# directly without using stored procedures,I get a customised label which says the package was executed successfully but I dont find any changes reflected in the database.Moreover this method of calling DTS is a sychronous call which I want to avoid. I also want to catch the exact msg that a DTS package dispalys after execution.

Any help in this regard will be highly appreciated.

Thanks in advance.

You don't give much details on the package, so it is impossible to say why the changes are not in the database. Use SSIS logging to trace what is going on during the package execution: either configure the package to log to e.g. text file, or implement of IDTSLogging interfaces and supply it to package Execute method.

Regarding the sync issue, there is no async version of Execute - so you'll need to create a background thread to do the package execution without blocking UI. See if BackgroundWorker class in .NET framework suits you need - it is easy to use.

|||

Loads and loads of thanks for the explanation. I will surely do that.

As u asked lemme clarify my position exactly. Right now I am having package that reads an excel sheet,updates and inserts them into some database tables. Once execution completed it sends a mail to the concerned persons along with the logfiles. When I execute them from the 2000 enterprise server I can successfully execute them.

From C# code I am calling them directly without the useage of any extended stored procedure or any OLE store procs.

I write the following lines to serve the purpose.

try

{

DTSClass package=new DTSClass();

package.loadfromSQLServer("localhost","sa","sa",null,null,null,.....);

package.execute();

}

catch(interop.COMException Ex)

{

label.text=Ex.Msg;

}

finally

{

package.uninitialize();

}

So that's the basic steps.

I am missing something that I was not supposed to. Any help in this concern will be highly appreciated

|||

Ops, sorry I just realized your question was about DTS 2000. This forum is about SSIS, so I often automatically assume people talk about SSIS when they say "DTS".

I don't remember the DTS API, but I think you should get each step result to see the package result in DTS 2000.

See http://msdn2.microsoft.com/en-us/library/aa176237(SQL.80).aspx and http://support.microsoft.com/kb/240221 for details.

Problems with DTS

Hi there,
Suddenly, I am experiencing problems with DTS. When I right-click Local
Packages (in Data Transformation Services) an empty window appear. I can't
see the menus and toolbars.
If I choose Customize view... in the new DTS Package the following options
are disabled:
- Console tree
- Standard menus (Action and View)
- Standard toolbar
Anyone knows why? It worked just fine two weeks ago.Hello, Stefan!
It does sound as though something trod on the DTS dlls, MDAC
Have a look at reregistering then DTS dlls and maybe reinstalling MDAC.
Redistributing DTS with your program
http://www.sqldts.com/default.aspx?6,105,225,0,1
--
Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org
: Suddenly, I am experiencing problems with DTS. When I right-click Local
: Packages (in Data Transformation Services) an empty window appear. I can't
: see the menus and toolbars.
: If I choose Customize view... in the new DTS Package the following options
: are disabled:
: - Console tree
: - Standard menus (Action and View)
: - Standard toolbar
-- Microsoft Outlook Express 6.00.2800.1158