Showing posts with label follows. Show all posts
Showing posts with label follows. Show all posts

Sunday, March 11, 2012

Error in Programming DTS using VB.net

Hi ,

i am using VS.NET 2003 for programming and SQL sever 2005 is my database.

while creating DTS packages,

i am using code as follows

Public Sub Task_Sub4(ByVal goPackage As Object)

Dim oTask As DTS.Task

Dim oLookup As DTS.Lookup

Dim oCustomTask4 As DTS.DataPumpTask2

oTask = CType(goPackage, DTS.Package).Tasks.New("DTSExecuteSQLTask")

oCustomTask4 = CType(oTask.CustomTask, DTS.DataPumpTask2)

oCustomTask4.Name = "Copy Data from contact_info to [content_shriya].[dbo].contact_info] Task"

oCustomTask4.Description = "Copy Data from contact_info to [content_shriya].[dbo].[contact_info] Task"

oCustomTask4.SourceConnectionID = 3

oCustomTask4.SourceSQLStatement = "select * from [Content_management].[dbo].[contact_info]"

oCustomTask4.DestinationConnectionID = 4

oCustomTask4.DestinationObjectName = "[content_shriya].[dbo].[contact_info]"

oCustomTask4.ProgressRowCount = 1000

oCustomTask4.MaximumErrorCount = 0

oCustomTask4.FetchBufferSize = 1

oCustomTask4.UseFastLoad = True

oCustomTask4.InsertCommitSize = 0

oCustomTask4.ExceptionFileColumnDelimiter = "|"

oCustomTask4.ExceptionFileRowDelimiter = vbCrLf

oCustomTask4.AllowIdentityInserts = False

oCustomTask4.FirstRow = 0

oCustomTask4.LastRow = 0

oCustomTask4.FastLoadOptions = 2

oCustomTask4.ExceptionFileOptions = 1

oCustomTask4.DataPumpOptions = 0

'Call oCustomTask4_Trans_Sub1(oCustomTask4)

goPackage.Tasks.Add(oTask)

oCustomTask4 = Nothing

oTask = Nothing

End Sub

But i am geeting error in line

oCustomTask4 = CType(oTask.CustomTask, DTS.DataPumpTask2)

giving error 'System.InvalidCastException'

Additional information: Specified cast is not valid.

i changed it with oCustomTask4 = oTask.CustomTask ,

then also similar error appear.

Please solve my problem, i need to create DTS Packages by using VS.NET 2003 and Database is SQL server 2005.

Thank you

You might have better success posting this in the DTS forum.

I'm not an expert in DTS programming, but since you created oTask as an ExecuteSQLTask, I don't think you can cast it to a DataPumpTask. You need to create it as a DataPumpTask.

|||

Thank you Jhon the code works.

|||Mark the response that was helpful as an answer, please. It helps with searching in the forum.

Sunday, February 26, 2012

Error in deploying cube

Hi,

I'm getting an internal exception error while deploying the solution. The error is as follows -

"Error - 1056964586: Internal error: An unexpected exception occured."

When deployed for the first time, it went through and subsequent changes processed as well. For a specific reason I had to delete the database and redeploy.

From then on I'm getting this error. Earlier threads said try SP2, still the error persists.

Had to share this solution with my teammate as well and even he is getting this error, even though he is deploying it for the first time.

Any help on this would really help, otherwise I would have to recreate the entire solution, changes etc.

Thanks in advance.

Hi,

I do not know this sepcific error message or number.

But I now - you cannot deploy the cube if you have a role with a user which does not exists. Remove incorrect users from you roles (or try remove all and then deploy again)

I had such issues in most of my deployment scenarios.

Else - does the message come from deployment or processing - try only deploy the solution and do not process.

HANNES

|||

Hi Hannes,

I dont have any user roles defined. Also I'm the administrator of the system and the Analysis Services server as well.

And the error comes when I'm trying to deploy the solution.

|||

"Unexpected Exception" errors usually indicate a bug in the server, and we would require either a crash dump or a copy of the solution in order to diagnose exactly why we're hitting it. I'd recommend opening a support ticket if that option is available to you.

- Brad

|||

I was able to track down the problem in my case.

I had 3 cubes and there was 2 relationships (linked objects), viz. Cube 1 refering Cube 2 and Cube 2 refering Cube 3.

When I removed one of the references, the deployment and processing went through.

I guess this is a limitation not to have such kind of references.

-

Vivek C.

Wednesday, February 15, 2012

Error handling in Stored procedure

I have a table called 'Testtable'
It has two columns
age int , notnull
name varhar(10), notnull
I wrote a stored procedure as follows to trap the error.
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
ALTER procedure sperror
@.a int,
@.n varchar(10),
@.err int,
@.ro int
As
insert into testtable(name,age) values (@.n,@.a)
select @.err = @.@.error, @.ro = @.@.rowcount
print @.ro
if @.err <> 0
print 'Error occorrred in stored procedure ' + str(@.err)
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
I was unable to get the message that I bold, when I execute it from query analyzer.
Regards,
Bhuwan
Regards,
Bhuwan
http://www.sommarskog.se/error-handling-II.html
"Bhuwan Bhaskar" <kxxx@.gmail.com> wrote in message news:OiwnD4fnIHA.1768@.TK2MSFTNGP05.phx.gbl...
I have a table called 'Testtable'
It has two columns
age int , notnull
name varhar(10), notnull
I wrote a stored procedure as follows to trap the error.
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
ALTER procedure sperror
@.a int,
@.n varchar(10),
@.err int,
@.ro int
As
insert into testtable(name,age) values (@.n,@.a)
select @.err = @.@.error, @.ro = @.@.rowcount
print @.ro
if @.err <> 0
print 'Error occorrred in stored procedure ' + str(@.err)
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
I was unable to get the message that I bold, when I execute it from query analyzer.
Regards,
Bhuwan
Regards,
Bhuwan