Showing posts with label following. Show all posts
Showing posts with label following. Show all posts

Thursday, March 29, 2012

DTS Fully process dimensions code

Using the following code to fully process dimension in a catalog on SQL Server 2000.

for each objDimension in dsoDatabase.Dimensions
dsoDimension = objDimension
dsoDimension.Process processFull
Next

However this appears to do an incremental process of dimension rather than full process. (I would expect the cubes to be unprocessed after a full process.

Whats wrong with the code.
Cheers.
Mark.for each objDimension in dsoDatabase.Dimensions
dsoDimension = objDimension
dsoDimension.Process (1)
Next

Have tested this and believe it to work. Still do not understand why above did not work.|||I assume you are using vbscript to process. If so you need to reference to the Constant "processFull" so that it applies it correctly. Otherwise it always just does it as a process default.sql

DTS Fully process dimensions code

Using the following code to fully process dimension in a catalog on SQL Server 2000.

for each objDimension in dsoDatabase.Dimensions
dsoDimension = objDimension
dsoDimension.Process processFull
Next

However this appears to do an incremental process of dimension rather than full process. (I would expect the cubes to be unprocessed after a full process.

Whats wrong with the code.
Cheers.
Mark.for each objDimension in dsoDatabase.Dimensions
dsoDimension = objDimension
dsoDimension.Process (1)
Next

Have tested this and believe it to work. Still do not understand why above did not work.|||I assume you are using vbscript to process. If so you need to reference to the Constant "processFull" so that it applies it correctly. Otherwise it always just does it as a process default.

DTS FTP Task: Is it possible to get beyond the root directory of the ftp site

Hi, I have the following problem
I am trying to download files from a ftp site using FTP task in DTS. The files reside in a subfolder of the root directory but I don't see a way to get there. Any ideas how to go around this?
ThanksI don't know what version of SQL server you are using, but in 2000 the FTP task allows you to specify the directory to retrieve the file from. After you enter the id and password you can go to the 'Files' tab and navigate through the directory structure.

Tuesday, March 27, 2012

DTS Execution Error in SQL server 2000..please help asap

Hi,

when i execute a dts to copy one database from one server to another i am getting the following error:

[Microsoft][ODBC SQL Server Driver][SQL Server]OLE DB 'SQL OLEDB' reported an error.Authentication Failed.
[Microsoft][ODBC SQL Server Driver][SQL Server]OLE/DB provider returned message: Invalid authorization specification]
[Microsoft][ODBC SQL Server Driver][SQL Server]OLE DB error trace [OLE/DB Provider 'SQLOLEDB' IDB Initialize: Initiliaze returned 0x80040e4d: Authentication failed.].

Please help me solve it.

DTS questions should be redirected to the DTS group: http://groups.google.com/group/microsoft.public.sqlserver.dts?lnk=sg

DTS execution error

when i execute a DTS to copy a database from one server to another, I am getting the following error:

[Microsoft][ODBC SQL Server Driver][SQL Server]OLE DB 'SQL OLEDB' reported an error.Authentication Failed.
[Microsoft][ODBC SQL Server Driver][SQL Server]OLE/DB provider returned message: Invalid authorization specification]
[Microsoft][ODBC SQL Server Driver][SQL Server]OLE DB error trace [OLE/DB Provider 'SQLOLEDB' IDB Initialize: Initiliaze returned 0x80040e4d: Authentication failed.].

Can somebody please help?

I understand you run DTS Import/Export wizard in SQL 2000; if it is true i think you entered in Windows with an account that can not log on that SQL Server (that windows account have not a login in SQL Server ).
Check this problem|||NO I am not using an import export wizard.it is a copy sql server objects task which is being used

Sunday, March 25, 2012

DTS excution error from ASP Page

Hi,
I have to execute the DTS package from ASP file.
But the following line throws error
Set oPkg = Server.CreateObject("DTS.Package")
Error type:
Server object, ASP 0177 (0x800401F3)
Invalid ProgID.
Does anybody know the solution?
Thanks,
Mamatha
--
Message posted via http://www.sqlmonster.comHi
At a guess you need the DTS redistributables on the web server. This method
seems to be a better one:
http://www.sqldts.com/default.aspx?207,2
Alteratively you may want to run it through a stored procedure.
John
"Mamatha MD via SQLMonster.com" <forum@.SQLMonster.com> wrote in message
news:7aefeb75208d4814b21443be6e91a5dd@.SQLMonster.com...
> Hi,
> I have to execute the DTS package from ASP file.
> But the following line throws error
> Set oPkg = Server.CreateObject("DTS.Package")
> Error type:
> Server object, ASP 0177 (0x800401F3)
> Invalid ProgID.
> Does anybody know the solution?
> Thanks,
> Mamatha
> --
> Message posted via http://www.sqlmonster.com

DTS erroring on index in unicode conversion

I have undertaken the following process to convert a database to unicode support. This is sql 2000 SP4

- Create a new database dbnew
- Script the old database dbold with all objects, everything, and dependencies
- Global replace varchar with nvarchar (etc etc) in the script
- Execute the script to create all objects into dbnew
- (Objects all exist fine)
- Startup DTS and choose olddb as the source, newdb as the destination
- On DTS step 3 choose "Copy Objects and Data between Sql Server Databases"
- Untick "Create destination objects"
- Change copy data to append data (all tables in dbnew are empty)
- Tick copy all objects
- Untick "Use default options" and clear every option (so hopefully we are only copying data)
- Click next and run

DTS gets through the first "phase" to 100% but then it fails on a duplicate key error on a table that has a unique key on its (now nvarchar) description field

Yet in Query Analyser I can do "insert into failingtable select * from olddb..failingtable" and the data comes across fine.

So why is it failing in DTS ? And are there any other options or settings I can try ?

thanks

One development on this..

The tables that are getting across are showing the nvarchar data as chinese symbols (where the source db was varchar not nvarchar, so just A-Z ascii etc). So I think this problem translates to how to get DTS to copy varchar data into nvarchar fields

I have been reading this article

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql2k/html/intlfeaturesinsqlserver2000.asp

Which implies that everything is ok copying varchar to nvarchar, not so in my case. I think possible m$ only tested their software with US collection sequence and not UK default. ? Otherwise I'm lost.

sql

DTS error when Copying Objects

I am getting the following error when executing a Copy SQL Server Objects Task. If it helps these objects are User Defined functions and also this had worked in the past it is only after changing the destination server to one that is offsite, has a different OS then the source and also runs as a DC. We are running SQL 2000 Server Standard with Spk 3a on both boxes.

Step 'DTSStep_DTSTransferObjectsTask_6' failed

Step Error Source: Microsoft SQL-DMO (ODBC SQLState: 42S02)
Step Error Description:[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'dbo.GetRightsAbbreviations'.
[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'dbo.GetRights'.
[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'dbo.GetTerritoryAbbreviations'.
[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'dbo.GetTerritories'.
[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'dbo.GetShow'.
[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'dbo.GetTvEpisodes'.
[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'dbo.GetTvSegments'.
[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'dbo.GetTvSegmentsString'.
Step Error code: 800400D0
Step Error Help File:SQLDMO80.hlp
Step Error Help Context ID:1131Check object owner. This is the most common reason which is clearly seen from the error message you provided.sql

DTS Error problems driving me mad!

I have a DTS scheduled to run daily. It has run OK for the past few months, but now always fails, the following error appears:

dtsrun.exe - application error

the instruction at 'xxxxxxx' referenced memory at 'yyyyyyy'. The memory could not be 'read'. click on ok to terminate the program.

The dts itself runs fine if started manually, but always fails as a scheduled job, even if its started manually.

Help!!!!!Eventhough a serious violation like this shouldn't happen, it may be caused by insufficient permissions. The job is run with the permissions the user has who is configured to run sqlserver (EM, Server properties, Security-tab).|||I have never encountered this particular error myself; however if I may toss in a couple of thoughts:

1. Is there an increased load being placed on the server of late?
2. Are there a number of DTS tasks scheduled to run simultaneously?
3. Are there other OS or application tasks scheduled to run at or near the same time as this package?
4. Do you know precisely what step DTS is failing on?
5. Is it possible to schedule and run this task from another SQL Server?

Some additional thoughts (which you may already know and I apologize if you do):

1. DTS runs in a separate memory space from SQL Server; multiple DTS packages running simultaneously will degrade the amount of RAM available.
2. There is a windows registry setting for throttling the number of DTS (or was it command -- .exe -- objects that can run simultaneously). I think the default is 10. Search MSDN.
3. If you use DTS heavily on one server, consider throttling back the amount of memory available to SQL Server; I know that this is NOT recommended by MS, but I have done this in the past with a good deal of success.

I hope that you can trace the roots of your issue; good luck.

Regards,

hmscott

Thursday, March 22, 2012

DTS Error

Hi,
Can any body help me to sort out this problem

I am running a DTS package source as dbf file and destination as sqlserver database the following error occurs

for row number 2035 errors encountered so far on this
task 1. insert error, column 3 ('arch_dt', DB_TYPE DBTIMESTAMP)

when i was opening dbf file in foxbase its showing (arch_dt field) date as datatype the same when i was importing to access the datatype is changing to text type.

so daily manually i am opening in excel file and delete the records where the line error occurs.

in excel file that particular row will have some text format instead of dateformat.

how can i solve this error without manual interaction..

with regards
rajkumarIf you insert it as a chracter datatype then you can check the value and correct it.
You could also probably use an activex script on it but that would be slow.

DTS Designer Error - Specified file not found

Hi there,

lately I had the following message on win2000 sp4 with sqlserver2000 sp3a: "DTS Designer Error - Specified file not found".
Then in the DTS editor the Task menu objects are missing and it is not possible to link a source and a target using Transform Data Task.

Before it used to work fine.

I have done the following:

- installing again last sp: same issue again
- reinstalling sqserver with a registry deep cleaning: same issue again
- started disabled windows services: same issue again

any idea?

Carsten

edit:
Could it be possible that a lately installed fix for Win2K interferes with DTS-Designer?Finally found a solution for this problem!

http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=19&messageid=112035

DTS Design Error - Access is denied

I am pretty new to MS SQL Server ...

I have installed SQL Server Enterprise Manager Version 8.0. I am getting the following error while try to create a new DTS Package.

"DTS designer Error ... Access Denied"

getting the DTS packge design window but there is no TASK icon visible
either in the tool bar or menu....

Enterprise Manager Version 8.0

OS : Windows XP pro with SP1If you go to the msdb database, the user you are using needs to have EXEC permissions on the procs that have dts in the name. This is by default granted to public, so I'm not sure why your user wouldn't have that. ?|||See whether this KBA http://support.microsoft.com/default.aspx?scid=kb;EN-US;814113 is any help to you.

Wednesday, March 21, 2012

DTS cube processing from a non sa account

We are running a DTS package from a non-sa owned job and I am getting the following message:

A problem occurred while attempting to logon as the Windows user 'SQLAgentCmdExec': The parameter is incorrect.

When I set the Sql Agent proxy account to an windows administrator on the sql server it works fine.

However when the Sql Agent proxy account is not administrator I get the above error.

Please note that the Analysis Services is located on a different machine.

Thanks

LiorGrant admin privileges to the SQLAgent service account, which is required to carry on such tasks and to overcome this issue.|||Originally posted by Satya
Grant admin privileges to the SQLAgent service account, which is required to carry on such tasks and to overcome this issue.

Do you mean that the sqlagent stratup account should be windows sys admin?

Can I do it with less power priviliges?

Thanks

Lior|||You can do it, but you may have issues again if any of the jobs have to deal with admin tasks.

Its always better and recommended to keep SQL service accounts with Admin privileges on the box.|||Originally posted by Satya
You can do it, but you may have issues again if any of the jobs have to deal with admin tasks.

Its always better and recommended to keep SQL service accounts with Admin privileges on the box.

Hi,

Thanks again for your help.

Do you know what permissions are required for sql server to run cube processing that resides on a different machine.

Lior

DTS Code works only with VS 2003 but not with VS 2005 ?

Hi;

I wanted to use the following code to run a DTS package from a 2005 Web Page code behind partial class. This code works fine in a VB 2003 module

going against SQl Srvr 2000.

Here is the code: (It initiates from a button click handler)

Dim conn As New SqlConnection("initial catalog=MY_Data;server= XYZ081552X7X441\TRSQL;integrated security=SSPI")

Dim hold1 As Integer

Dim hold_source As String = ""

Dim hold_desc As String = ""

Try

conn.Open()

Catch ex1 As Exception

MsgBox("The Test connection failed to open" & vbCrLf & ex1.Message)

End Try

MsgBox("About to create a DTS object")

Dim oPackage As New DTS.Package2Class (Compiler doesn't like this line) Type DTS.Package2Class is not defined.

Dim oStep As DTS.Step (Or this one) Type DTS.step is not defined.

oPackage.LoadFromSQLServer("XYZ81552X7X441\TRSQL", , , DTS.DTSSQLServerStorageFlags.DTSSQLStgFlag_UseTrustedConnection, , , , "cpyPrinters2Excel", )

For Each oStep In oPackage.Steps

oStep.ExecuteInMainThread = True

Next

oPackage.Execute()

For Each oStep In oPackage.Steps

If oStep.ExecutionResult = DTS.DTSStepExecResult.DTSStepExecResult_Failure Then

oStep.GetExecutionErrorInfo(hold1, , )

Else

End If

Next

oPackage.UnInitialize()

oPackage = Nothing

conn.Close()

Has Microsoft changed the DTS objects so that they work only with SQL Srv 2005 ?

Thanks for your insights.

DTS has been replaced with SSIS, so yes, plenty of things have changed.

DTS questions can be asked over at the DTS news group, if that helps: http://groups.google.com/group/microsoft.public.sqlserver.dts?lnk=srg|||Thanks very much.

Monday, March 19, 2012

DTS automatic dat file import

Hi y'all

I'm having some trouble with the following script I use in a
dts-package. I use it to automatically import a dat-file of which the
name changes every day. Today the name f.e. is P0000020.dat, tomorrow
it's P0000021.dat and the day after P0000022.dat etc etc The error I
get is end of instruction expected.
This is the script:

'************************************************* *********************
' Visual Basic ActiveX Script
'************************************************* ***********************

Function Main()
Dim oPkg, oDataPump
Dim sSourceTable, sDestinationTable

' Derive the new table names
sSourceTable ="" & GetName
sDestinationTable = sSourceTable
' Get reference to the DataPump Task
Set oPkg = DTSGlobalVariables.Parent
Set oDataPump = oPkg.Tasks("DTSTask_DTSDataPumpTask_1").CustomTask

' Set the new values
oDataPump.SourceObjectName = sSourceTable
oDataPump.DestinationObjectName = "[Test].[test].[tblXafaxOutput]"
' Clean Up
Set oDataPump = Nothing
Set oPkg = Nothing

Main = DTSTaskExecResult_Success
End Function

Function GetName
Dim number, counter, file
counter = 1
number = DTSGlobalVariables("NextNumber").Value
number = number + 1
For counter = 1 To 7 - Len(number)
file = file & "O"
Next teller
file = "P" & file & getal & ".dat"
DTSGlobalVariables("NextNumber").Value = number
GetName = file
End Function

I've used this script before in another dts-package where the
file-name needs to be based up-on the date and it worked just fine.
You can find the script at:
http://groups.google.be/groups?hl=n...l e.com#link10

I hope anyone can help me.
thanx in advance
Piedro

PS I've my english is crap it's because it ain't my mothertongue."Piedro" <pproost@.hotmail.com> wrote in message
news:b7e3650a.0309231319.7d8d0ffa@.posting.google.c om...
> Hi y'all
> I'm having some trouble with the following script I use in a
> dts-package. I use it to automatically import a dat-file of which the
> name changes every day. Today the name f.e. is P0000020.dat, tomorrow
> it's P0000021.dat and the day after P0000022.dat etc etc The error I
> get is end of instruction expected.
> This is the script:
> '************************************************* *********************
> ' Visual Basic ActiveX Script
> '************************************************* ***********************
> Function Main()
> Dim oPkg, oDataPump
> Dim sSourceTable, sDestinationTable
> ' Derive the new table names
> sSourceTable ="" & GetName
> sDestinationTable = sSourceTable
> ' Get reference to the DataPump Task
> Set oPkg = DTSGlobalVariables.Parent
> Set oDataPump = oPkg.Tasks("DTSTask_DTSDataPumpTask_1").CustomTask
> ' Set the new values
> oDataPump.SourceObjectName = sSourceTable
> oDataPump.DestinationObjectName = "[Test].[test].[tblXafaxOutput]"
> ' Clean Up
> Set oDataPump = Nothing
> Set oPkg = Nothing
> Main = DTSTaskExecResult_Success
> End Function
> Function GetName
> Dim number, counter, file
> counter = 1
> number = DTSGlobalVariables("NextNumber").Value
> number = number + 1
> For counter = 1 To 7 - Len(number)
> file = file & "O"
> Next teller
> file = "P" & file & getal & ".dat"
> DTSGlobalVariables("NextNumber").Value = number
> GetName = file
> End Function
>
> I've used this script before in another dts-package where the
> file-name needs to be based up-on the date and it worked just fine.
> You can find the script at:
http://groups.google.be/groups?hl=n...l e.com#link10
> I hope anyone can help me.
> thanx in advance
> Piedro
>
> PS I've my english is crap it's because it ain't my mothertongue.

The message you get is probably because of the For .. Next loop. In
VBScript, you can't put the counter variable name after Next (as you would
in VB):

For x = 1 To 10
' Do something
Next ' This is OK

For x = 1 To 10
' Do something
Next x ' This is wrong

Simon

Sunday, March 11, 2012

DTS ActiveX Script

Hi All,
I have the following NewBie Question:

If I have the sources:
StartDate: e.g. 23/3/2002
ApproveDate: e.g. 26/7/2002

And I want the destination be count in no.of days
(TotalDays), what should I write in the ActiveX Script?

Please give me some hints, thanks!

RickSolved.

Friday, March 9, 2012

dts ackage failing

hi

i have a dts package that runs fine in sql7.0 ,os win NT ,but the same dts fails in sql2000 Win2000 OS, with the following eror

cursor opeartion couldnot be completed since the set options for the cursor have been changed since the cursor was last declared.

please help.Are you using global cursors ?|||yes|||yes|||make sure u 'close' or 'deallocate' ur cursors after usage otherwise it has sum undesirable effects

DTS 2000 Designer Components

After installing the DTS 2000 designer components from the feature packI get the following error message when trying to open a package:

-

SQL Server 2000 DTS Designer components are required to edit DTS packages. Install the special Web download, "SQL Server 2000 DTS Designer Components" to use this feature. (Microsoft.SqlServer.DtsObjectExplorerUI)

The thing is that I have installed them!! so what's going on here, is there a registry key I need to remove or something?, I've uninstalled and re-installed them, rebooted the server numerous times but still no joy, SQL Server just tells me that they're not installed, as you can imagine this is a real pain as I cannot do anything with my legacy packages on the 2005 server.

I cannot just migrate the packages from my 2000 server as they are in daily use on a production server. Is there an option to migrate/copy packages but leave the source packages untouched?

Help!

Yay, I seem to have stumbled across a solution for this:-

1. Uninstall SQL Server 2005 Backward Compatibilty

2. Uninstall SQL Server 2000 DTS Designer Components

3. Re-install SQL Server 2005 Backward Compatibilty

4. Re-install SQL Server 2000 DTS Designer Components

5. On the SQL Server 2000, open te DTS package and save it to the 2005 Server ( it will be placed in the <server name>\Management\Legacy\Data Transformation Services folder)

6. Edit the package on the 2005 server, NB. if you make any changes and save the package, the designer will take it upon itself to kindly auto-arrange your package so the package you had taken time to lay out in a nice readable format now resembles a bowl of spaghetti.

I found that moving the 2000 DTS packages in any other way than in step 5 resulted in the designer throwing up all sort of errors, although it did still work until you actually tried to save it. In my opinion, this is far too flaky and I am very hesitant to upgrade to SQL 2005 and leave my DTS packages in the hands of this designer.

|||I am trying to to the same thing, where do I find the download "SQL Server DTS Designer Components"? Second question, did you get it to work?|||

The DTS designer components are part of the SQL Server 2005 feature pack, just do a search for it on the microsoft website.

I found that the designer components work ok for some of my 2000 packages but not for others. I don't know why it behaves like this and there is no pattern to it, all I know is that it is a pain in the backside.

hope this helps

|||

Feature Pack for Microsoft SQL Server 2005 - November 2005 http://www.microsoft.com/downloads/details.aspx?familyid=d09c1d60-a13c-4479-9b91-9e8b9d835cdc&displaylang=en

Which includes -

Microsoft SQL Server 2000 DTS Designer Components http://download.microsoft.com/download/4/4/D/44DBDE61-B385-4FC2-A67D-48053B8F9FAD/SQLServer2005_DTS.msi

|||Thank you this solved my problem.

Wednesday, March 7, 2012

DTS - The directory name is invalid

I am trying to save a dts package that I modified to sql server and am getting the following error:

"The directory name is invalid"

I've also tried saving it as a structured storage file and get the same error!

I've been working with dts packages for years and I've never gotten this error.

Can anyone help?

Pete

Try the DTS group: http://groups.google.com/group/microsoft.public.sqlserver.dts?lnk=sg

DTS - SQL Task question

Hi,

I have a DTS package. One of the steps is SQL task step. I have the following code under SQL statment.

declare
@.p_dtProcessDate DateTime,
@.p_iResultCode int
SET @.p_dtProcessDate = getdate()
EXEC SPCreateMLRDailyRpt @.p_dtProcessDate,@.p_iResultCode out

I want to evaluate @.p_iResultCode and if it is not equal to zero, I want to make this SQL task step to be failed so that the entire DTS package itself fails.

Does any one know how to do this ? I appreciate all your help.

-BheemNot that familure with DTS but how about RAISERROR?|||Paul,

Thanx for the response. But that does not fail the step. It says DTS package completed successfully.

-Bheem|||Using RAISERROR is the correct answer. Please post your code that did not function correctly using RAISERROR.|||A RAISERROR will trigger the 'On Failure' workflow. This was used in the flowing past post

Problem with package creation (http://dbforums.com/showthread.php?s=&threadid=314650)|||My code is below.

declare @.p_iResultCode int

EXEC spValidateCLLITemp @.p_iResultCode out
IF @.p_iResultCode = 0
RAISERROR('Failed',16,1)

When I run the same query using query analyzer, RAISERROR works fine with the message displayed as 'Failed'.

But in DTS the SQL task step is completed successfully without any problem. What am I doing wrong here ?

Thanx for all the responses.

-Bheem|||Have you tried the same code but leaving out the "if" statement ? Basically, forcing a RAISERROR.|||Yes, I did. It is not working either. Basically RAISERROR is not finctioning in DTS.

Does anyone know why this code is not working ?

-Bheem|||What version/service pack of sql server are you using ?|||I am using

SQL Server 7.0
Version 4.0
Service pack 6

If I use the following in DTS SQL task it works.

declare @.test int
set @.test = 0
if @.test = 0
RAISERROR('Failed', 16,1)

But RAISERROR is not working when I use EXEC <stored proc>
Thanx..
-Bheem|||I've created a small DTS package to test RAISERROR. I use a OLEDB connect that points to the local server and Pubs database using NT authentication. It starts with a SQL Task that get the milliseconds of the current time using DATEPART. If the value is less than 500 then RAISERROR and else do nothing. The SQL Task has 2 workflows ON SUCCESS and ON FAILURE, each with a message box. I've attached the DTS package see if you can run this.

I had to rename the extension from .DTS to .TXT so that I could attach|||achorozy,

The attachment is unreadable. Can you please paste your code here.

thanx..
-Bheemsen|||It's a DTS package that you can't read with notepad but import into DTS using Enterprise Manager.

Long form:

1) Create OLEDB connection to any database
2) Create SQL Task, set connection to OLEDB created in (1). Set SQL statement toif (SELECT DATEPART(ms,GETDATE())) < 500
raiserror('',16,1)
3) Create ActiveX Script called Good, code
Function Main()
Msgbox "Good"
Main = DTSTaskExecResult_Success
End Function
5) Set workflow 'ON SUCCESS' from SQL Task to ActiveX 'Good'
6) Create ActiveX Script called Bad, code
Function Main()
Msgbox "Bad"
Main = DTSTaskExecResult_Success
End Function
7) Set workflow 'ON FAILURE' from SQL Task to ActiveX 'Bad'

Run the package, it should flip from msgbox 'Good' to 'Bad' as the milliseconds in GETDATE() change from over 500 to under 500.|||achorozy,

Thanx for your response. Your code perfectly works. As I said, I had already tested RAISERROR with a SQL statment in the SQL task. That works.

But the RAISERROR is not working in my following code.

declare @.p_iResultCode int

EXEC spValidateCLLITemp @.p_iResultCode out
IF @.p_iResultCode = 0
RAISERROR('Failed',16,1)

When I run the same query using query analyzer, RAISERROR works fine with the message displayed as 'Failed'.

But in DTS the SQL task step says it is "completed successfully", it should fail actually. What am I doing wrong here ?

-Bheemsen|||Now I've changed my SQL Task.

I created a stored procedure :
CREATE PROC sp_Test (@.x int OUTPUT)
AS
SET NOCOUNT ON

SELECT @.x = DATEPART(ms,GETDATE())
Then I modified my SQL Task's SQL Statement to be
declare @.x int

exec sp_Test @.x OUTPUT

IF (@.x < 500)
raiserror('',16,1) This works fine for me. I get the RAISERROR sometimes (@.x < 500) and sometomes not (@.x >= 500).|||Are you still having the problem ?|||rnealejr,

Yes, I still have the problem. It is really weird. The same code works well in query analyzer, but not in DTS sql task step. It never fails there.

Your code is very perfect. It is wroking fine in DTS sql step as well as in query analyzer.

Looks like may be something wrong with my procedure. It is working fine when I write a small stored procedure and test the same return code in sql task step.

It is still a mystery for me.

Thanx for all responses. Please let me know if you find something for me. All the information regarding my problem is in this thread.

-Bheemsen|||There is a problem with the OLEDB provider for SQL. You need to download the latest mdac for your machine. If install version 2.6 or greater you should be ok. This should correct the non-failure in your dts script. If not, let me know.

Good luck.|||rnealejr,

I am sorry to ask this question. How do I check my OLEDB version and from where I should download the latest mdac ?

Thanx for all your help.
-Bheemsen|||Search for sqloledb.dll - right click on the file and go to properties - go to the version tab. Let me know which version you have installed.|||The OLEDB version installed is 07.01.0819

When I run "select @.@.version" in query analyzer, I got the following.

Microsoft SQL Server 7.00 - 7.00.842 (Intel X86)
Mar 2 2000 06:49:37
Copyright (c) 1988-1998 Microsoft Corporation
Desktop Edition on Windows NT 4.0 (Build 1381: Service Pack 6)

Thanx..
-Bheemsen|||Go to the following web site for mdac version 2.6:

mdac (http://www.microsoft.com/data/download_260rtm.htm)

After the installation, make a note as to which version is installed now. It should begin with 2000. You can also upgrade to 2.7 version.
FYI: There is a service pack for 2.6.

Good luck.|||rnealejr,

Thanx a million for all that help. It worked like a charm. It looks like this bug fix is incorporated by Microsoft in its recent SP4 also. I had installed SP4 too on my machine. I need to inform my production support people to install the same.

Thanx again.
-Bheemsen|||Good deal. Be careful, because not even sp4 has the latest drivers and your dts problem will still be around. You can test it out on your existing servers and let me know (or uninstall the sp4 on your machine).

Good luck.|||Thanx. I will. How did you figure out this fix ??

Also, when you have time, can you please take a look at my another question at thread "Delete query to remove duplicate rows"

-Bheemsen