Showing posts with label fails. Show all posts
Showing posts with label fails. Show all posts

Thursday, March 29, 2012

Error reporting from SP to .NET code, how?

Hey

ASP.NET 2.0 + MS Sql Server 2005 Express (that version which comes with VS2005)

This code below fails. The Delete method executes a stored procedure, but somehow this SP fails. The SP shown here is a short version of the actual SP. As you see from the code below, there are no way the Delete method can know if SP executed successfully. I assume I just could have returned @.@.error, but that just gives an error number, and not the description of the error??.. And how should I capture exceptions like these?? How should code this SP so it report the error??

Any suggestions??

public override void Delete(System.Guid id, int user)
{
using (SqlConnection cn = new SqlConnection(this.ConnectionString))
{
SqlCommand cmd = new SqlCommand("SendMessage", cn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@.id", SqlDbType.UniqueIdentifier).Value = id;
cmd.Parameters.Add("@.user", SqlDbType.Int).Value = user;
}
}

ALTER PROCEDURE dbo.DeleteMessage @.id uniqueidentifier, @.user int
AS
BEGIN
UPDATE table_A set column_A = 1 WHERE Id = @.id;
DELETE FROM table_B WHERE Id = @.id;
IF (@.@.error = 0)
COMMIT TRAN;
ELSE
ROLLBACK TRAN;
END

there is a couple of way to report that what happened, you can use execute nonquery to get number of rows affected by last SQL command, you can return from your procedure single cell using SELECT with value 0 for success and 1 for error and finally you can use output parameters and read its values after procedure executes. See T-SQL help in SQL management studio express which is very good and you can find everything you wont.

Error rendering to PDF, after installing SP1

After installing SP1, reports fails to render to PDF, with the following
error from IE:
"Internet Explorer cannot download Format=PDF from myserver.
Internet Explorer was not able to open this Internet site. The requested
site is either unavailable or cannot be found. Please try again later."
Before installing SP1 there were no problems rendering to PDF. Export to
EXCEL and other formats works just fine.
The installation is configured like this:
WEBSERVER:
Windows Sever 2003
Reporting Services Standard Edition + SP1 (Microsoft SQL Server Reporting
Services Version 8.00.878.00)
DBSERVER:
Windows Sever 2003
SQL Server 2000 SP3
The ReportServer, MSSQLSERVER services uses the same Domain account.
I've also seen this problem posted on
http://www.sqlmonster.com/Uwe/Forum.aspx/sql-server-reporting/710/Error-rendering-to-PDF-after-installing-SP1
However there is no solution posted.
Any suggestions on how to resolve this problem would be appreciated
Regards,After hours of testing, i found <Language>no</Language> in the <Style> tag in
one of my textbox... I removed the whole tag and everything works fine. You
need the whole language kode us-en, nb-no etc. search for language in your
xml code
"Jögren Wendel" wrote:
> After installing SP1, reports fails to render to PDF, with the following
> error from IE:
> "Internet Explorer cannot download Format=PDF from myserver.
> Internet Explorer was not able to open this Internet site. The requested
> site is either unavailable or cannot be found. Please try again later."
> Before installing SP1 there were no problems rendering to PDF. Export to
> EXCEL and other formats works just fine.
> The installation is configured like this:
> WEBSERVER:
> Windows Sever 2003
> Reporting Services Standard Edition + SP1 (Microsoft SQL Server Reporting
> Services Version 8.00.878.00)
> DBSERVER:
> Windows Sever 2003
> SQL Server 2000 SP3
> The ReportServer, MSSQLSERVER services uses the same Domain account.
> I've also seen this problem posted on
> http://www.sqlmonster.com/Uwe/Forum.aspx/sql-server-reporting/710/Error-rendering-to-PDF-after-installing-SP1
> However there is no solution posted.
> Any suggestions on how to resolve this problem would be appreciated
> Regards,
>

Tuesday, March 27, 2012

Error Redirected to Script Component : Package Doesnt fail.

I have created a data flow task. In that, in a 'data conversion', if a column fails validation then that row is redirected to a script component, which in turn writes the error to a variable.

But though the error is generated and script component receives the error, package doesnt fail.

Is there any way to set the package result to failure inside the script component? I tried set 'FailPackageOnFailure' to true but doesnt work.

Any help is greatly appreciated.

Thanks,

Don

donMahya wrote:

I have created a data flow task. In that, in a 'data conversion', if a column fails validation then that row is redirected to a script component, which in turn writes the error to a variable.

But though the error is generated and script component receives the error, package doesnt fail.

Is there any way to set the package result to failure inside the script component? I tried set 'FailPackageOnFailure' to true but doesnt work.

Any help is greatly appreciated.

Thanks,

Don

You could raise an error within the script component using:

Me.Events.FireError(...) (something like that anyway)

-Jamie

|||

Sorry for the delay. Wasnt working on this part for some time.

I tried

Me.ComponentMetaData.FireError(0, "", strErrDesc, "", 0, True) - Where strErrDesc is error decription.

but still no luck

I tried setting the maxerrorcount to 0 but No Luck. Package still completes without any failure.

Any help or ideas are greatly appreciated.

Thanks,

Don

|||

You should return the failure value inside of your script main method. I do not remember the exact enumeration value but the intellisence will give it to you.

Thanks.

Error Redirected to Script Component : Package Doesnt fail.

I have created a data flow task. In that, in a 'data conversion', if a column fails validation then that row is redirected to a script component, which in turn writes the error to a variable.

But though the error is generated and script component receives the error, package doesnt fail.

Is there any way to set the package result to failure inside the script component? I tried set 'FailPackageOnFailure' to true but doesnt work.

Any help is greatly appreciated.

Thanks,

Don

donMahya wrote:

I have created a data flow task. In that, in a 'data conversion', if a column fails validation then that row is redirected to a script component, which in turn writes the error to a variable.

But though the error is generated and script component receives the error, package doesnt fail.

Is there any way to set the package result to failure inside the script component? I tried set 'FailPackageOnFailure' to true but doesnt work.

Any help is greatly appreciated.

Thanks,

Don

You could raise an error within the script component using:

Me.Events.FireError(...) (something like that anyway)

-Jamie

|||

Sorry for the delay. Wasnt working on this part for some time.

I tried

Me.ComponentMetaData.FireError(0, "", strErrDesc, "", 0, True) - Where strErrDesc is error decription.

but still no luck

I tried setting the maxerrorcount to 0 but No Luck. Package still completes without any failure.

Any help or ideas are greatly appreciated.

Thanks,

Don

|||

You should return the failure value inside of your script main method. I do not remember the exact enumeration value but the intellisence will give it to you.

Thanks.

Error processing a cube while transactions are made to the database

Hi,
I am testing SASS by trying to process a cube while bombarding the
transactional database with new records. The process fails.
It works only when I stop making transactions.
Is there some configuration that enables cube processing while transactions
are still being made ?
Thank you.
Hello Ron,
Based on my scope, it is usually suggest that we do not perform normal
transactions on data warehouse unless when use DTS/SSIS to import data from
OLTP database. I think it is not support to process cube from database
warehouse while perform transactions at the same time.
You may want to consider incremental update feature. This will allow
contents of a cube current without requiring to reprocess the cube in full
when you add new data. The server creates a copy of the object that is
being processed and works on the copy until a commit request is received.
This permits the Analysis Services server to continue answering queries
against existing objects.
Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ===
This posting is provided "AS IS" with no warranties, and confers no rights.
--
>From: "Ron" <ron@.newsgroups.nospam>
>Subject: Error processing a cube while transactions are made to the
database
>Date: Thu, 27 Oct 2005 10:33:32 -0700
>Lines: 12
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
>Message-ID: <OiOgOyx2FHA.2624@.TK2MSFTNGP09.phx.gbl>
>Newsgroups: microsoft.public.sqlserver.datawarehouse
>NNTP-Posting-Host: 209-77-216-34.utopy.com 209.77.216.34
>Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP09.phx.gbl
>Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.datawarehouse:2381
>X-Tomcat-NG: microsoft.public.sqlserver.datawarehouse
>Hi,
>I am testing SASS by trying to process a cube while bombarding the
>transactional database with new records. The process fails.
>It works only when I stop making transactions.
>Is there some configuration that enables cube processing while transactions
>are still being made ?
>Thank you.
>
>
|||But its that tweaking the new "proactive cache" & using snapshot isolation
you should be able to do easy incremental processes.
HTH
Pablo S. Mugica
MCDBA, MCSA
"Peter Yang [MSFT]" <petery@.online.microsoft.com> wrote in message
news:Z8Rvp$22FHA.3936@.TK2MSFTNGXA01.phx.gbl...
> Hello Ron,
> Based on my scope, it is usually suggest that we do not perform normal
> transactions on data warehouse unless when use DTS/SSIS to import data
> from
> OLTP database. I think it is not support to process cube from database
> warehouse while perform transactions at the same time.
> You may want to consider incremental update feature. This will allow
> contents of a cube current without requiring to reprocess the cube in full
> when you add new data. The server creates a copy of the object that is
> being processed and works on the copy until a commit request is received.
> This permits the Analysis Services server to continue answering queries
> against existing objects.
> Regards,
> Peter Yang
> MCSE2000/2003, MCSA, MCDBA
> Microsoft Online Partner Support
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ================================================== ===
>
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
> --
> database
>
sql

Error processing a cube while transactions are made to the database

Hi,
I am testing SASS by trying to process a cube while bombarding the
transactional database with new records. The process fails.
It works only when I stop making transactions.
Is there some configuration that enables cube processing while transactions
are still being made ?
Thank you.Hello Ron,
Based on my scope, it is usually suggest that we do not perform normal
transactions on data warehouse unless when use DTS/SSIS to import data from
OLTP database. I think it is not support to process cube from database
warehouse while perform transactions at the same time.
You may want to consider incremental update feature. This will allow
contents of a cube current without requiring to reprocess the cube in full
when you add new data. The server creates a copy of the object that is
being processed and works on the copy until a commit request is received.
This permits the Analysis Services server to continue answering queries
against existing objects.
Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
=============
This posting is provided "AS IS" with no warranties, and confers no rights.
--
>From: "Ron" <ron@.newsgroups.nospam>
>Subject: Error processing a cube while transactions are made to the
database
>Date: Thu, 27 Oct 2005 10:33:32 -0700
>Lines: 12
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
>Message-ID: <OiOgOyx2FHA.2624@.TK2MSFTNGP09.phx.gbl>
>Newsgroups: microsoft.public.sqlserver.datawarehouse
>NNTP-Posting-Host: 209-77-216-34.utopy.com 209.77.216.34
>Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
>Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.datawarehouse:2381
>X-Tomcat-NG: microsoft.public.sqlserver.datawarehouse
>Hi,
>I am testing SASS by trying to process a cube while bombarding the
>transactional database with new records. The process fails.
>It works only when I stop making transactions.
>Is there some configuration that enables cube processing while transactions
>are still being made ?
>Thank you.
>
>|||But its that tweaking the new "proactive cache" & using snapshot isolation
you should be able to do easy incremental processes.
HTH
Pablo S. Mugica
MCDBA, MCSA
"Peter Yang [MSFT]" <petery@.online.microsoft.com> wrote in message
news:Z8Rvp$22FHA.3936@.TK2MSFTNGXA01.phx.gbl...
> Hello Ron,
> Based on my scope, it is usually suggest that we do not perform normal
> transactions on data warehouse unless when use DTS/SSIS to import data
> from
> OLTP database. I think it is not support to process cube from database
> warehouse while perform transactions at the same time.
> You may want to consider incremental update feature. This will allow
> contents of a cube current without requiring to reprocess the cube in full
> when you add new data. The server creates a copy of the object that is
> being processed and works on the copy until a commit request is received.
> This permits the Analysis Services server to continue answering queries
> against existing objects.
> Regards,
> Peter Yang
> MCSE2000/2003, MCSA, MCDBA
> Microsoft Online Partner Support
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ========================================
=============
>
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
> --
> database
>

Friday, March 23, 2012

error on sp3a URGENT HELP !

After past MDAC it fails running 1st script with error sp3_serv_uni.SQL(1) PLEASE HELPDid you expand the service pack into the default directory, or some directory you created? Also, what's the error?|||Are you sure nobody snuck up on you and attempted to log on to the server while you were busy running the upgrade?

This script performs quite a bit of modifications to the system tables including dropping and recreating of sysprocesses table.

Friday, March 9, 2012

Error Msg 8626

Hi all,
I have an sp which works fine on a server, but fails on my desktop engine
with the following error code:
Server: Msg 8626, Level 16, State 1,
Only text pointers are allowed in work tables, never text, ntext, or image
columns. The query processor produced a query plan that required a text,
ntext, or image column in a work table.
I have checked the sp but no text, ntext, or image column is involved in the
code !
Got any idea about it ?!
ThanksCould you provide a repro?
Please post DDL, sample data and desired results.
See http://www.aspfaq.com/5006 for info.
"fdudan" <fdudan@.discussions.microsoft.com> wrote in message
news:0437938D-8959-47F7-826A-B95B6022286B@.microsoft.com...
> Hi all,
> I have an sp which works fine on a server, but fails on my desktop engine
> with the following error code:
> Server: Msg 8626, Level 16, State 1,
> Only text pointers are allowed in work tables, never text, ntext, or image
> columns. The query processor produced a query plan that required a text,
> ntext, or image column in a work table.
> I have checked the sp but no text, ntext, or image column is involved in
> the
> code !
> Got any idea about it ?!
> Thanks
>

Sunday, February 19, 2012

Error message in a job, SQLSTATE 42S02 (Error 208)

I have a scheduled job where it's failing intermittently every few days.
The job fails in one of two steps, but with the same error above.
Step 18 is where I do a drop of the table and a create of the table, and
its indexes. It doesn't fail here, but fails in one of the next two
steps.
Step 19 is an insert into the table created in step 18. It takes a
source table, and puts into it mostly the same information, except that
it sums stuff up by purcase order instead of by line item. It also does
some max(dates) to record the most recent activity on the items in this
summary table.
Step 20 is an insert into the same table from the same source table as
in step 19, except that it processes everything excluded from the first
pass.
It's failed on step 19 & step 20 over the last several days. The error
message itself displays like:
"Executed as user: Mydomain\Mysqlaccount. Invalid Object Name
'tablename'. [SQLSTATE 42S02] (Error 208). The step failed."
To fix the problem, we've simply re-started in the failed step (did not
re-create the table, only picked up with the insert into it), and the
job has run to completion.
One thing that has occurred to me is to have the table drop, create and
load all in stored procedures, instead of how it is now - in TSQL code
within the batch job. I don't know if this would fix the problem though.
Any ideas as to what's happening? The info I've found on the 42S02
error hasn't been much help yet.
SCBased on the fact that I can't see your DTS workflow diagram, I'd urge you t
o
check the workflow.
ML|||> Based on the fact that I can't see your DTS workflow diagram, I'd urge you toed">
> check the workflow.
There is no DTS Workflow diagram.
These are just steps in a job created under the Management folder in
Enterprise Manager, under the SQL Server Agent, under the Jobs link.
It's 3 steps inside 1 of those jobs that is dying on step 19 or 20 with
the 42S02 Error 208 message.
18 runs okay, 19 & 20 are the ones that have died intermittently.
The steps are:
-- Step 18
CREATE TABLE [dbo].[posummary] (
[sSalesOrganization] [varchar] (8) NULL ,
[sSalesGroup] [varchar] (3) NULL ,
[sSalesRepCode] [varchar] (10) NULL ,
[sDistributionChannel] [varchar] (2) NULL ,
[sSoldTo] [varchar] (10) NULL ,
[sShipTo] [varchar] (10) NULL ,
[sCustName1] [varchar] (45) NULL ,
[sCustName2] [varchar] (35) NULL ,
[PO_Num] [varchar] (20) NULL ,
[Order_date] [smalldatetime] NULL ,
[Req_Ship_Date] [smalldatetime] NULL ,
[Inv_Date] [smalldatetime] NULL ,
[Inv_Nr] [varchar] (10) NULL ,
[lOrderQuantity] [int] NULL ,
[lOrderValue] [money] NULL ,
[lShipValue] [money] NULL ,
[OpenVal] [money] NULL ,
[lShipQuantity] [int] NULL ,
[sAccountSoldTo] [varchar] (10) NULL ,
[sMasterSoldTo] [varchar] (10) NULL
) ON [PRIMARY]
GO
CREATE INDEX [posummary] ON [dbo].[posummary]([sSalesOrganization],
[sDistributionChannel], [sSalesGroup], [sSalesRepCode], [sSoldTo],
[sShipTo], [PO_Num], [Inv_Nr]) ON [PRIMARY]
GO
CREATE INDEX [sorg] ON [dbo].[posummary]([sSalesOrganization]) ON
[PRIMARY]
GO
CREATE INDEX [distchnl] ON [dbo].[posummary]([sDistributionChannel])
ON [PRIMARY]
GO
CREATE INDEX [sgroup] ON [dbo].[posummary]([sSalesGroup]) ON [PRIMARY]
GO
CREATE INDEX [sRep] ON [dbo].[posummary]([sSalesRepCode]) ON [PRIMARY]
GO
CREATE INDEX [SoldTo] ON [dbo].[posummary]([sSoldTo]) ON [PRIMARY]
GO
CREATE INDEX [ShipTo] ON [dbo].[posummary]([sShipTo]) ON [PRIMARY]
GO
CREATE INDEX [PO] ON [dbo].[posummary]([PO_Num]) ON [PRIMARY]
GO
CREATE INDEX [InvNr] ON [dbo].[posummary]([Inv_Nr]) ON [PRIMARY]
GO
CREATE INDEX [Ord Date] ON [dbo].[posummary]([Order_date]) ON [PRIMARY]
GO
CREATE INDEX [ACCTSOLDTO] ON [dbo].[posummary]([sAccountSoldTo]) ON
[PRIMARY]
GO
CREATE INDEX [MASTERSOLDTO] ON [dbo].[posummary]([sMasterSoldTo]) ON
[PRIMARY]
GO
-- Step 19
insert into posummary
select
podetail.ssalesorganization,
podetail.Ssalesgroup,
podetail.ssalesrepcode,
podetail.sDistributionChannel,
podetail.ssoldto,
podetail.sshipto,
max(tblmaster_shipto.scustname1) as Custname1,
max(tblmaster_shipto.scustname2) as Custname2,
PO_Num,
max(Order_Date) as Order_Date,
max(Req_Ship_Date) as Req_Ship_Date,
max(Inv_Date) as Inv_Date,
max(Inv_Nr) as Inv_Nr,
sum(lorderquantity) as lorderquantity,
sum(lordervalue) as lordervalue,
sum(lshipvalue) as lshipvalue,
sum(lordervalue) - sum(lshipvalue) as Openval,
sum(lshipquantity) as lshipquantity,
max(tblmaster_accountsoldto.saccountsoldto) as AccountSoldTo,
max(tblmaster_accountsoldto.smastersoldto) as MasterSoldTo
from podetail
left outer join tblmaster_shipto on
((tblmaster_shipto.ssoldto = podetail.ssoldto) and
(tblmaster_shipto.sshipto = podetail.sshipto) and
(tblmaster_shipto.ssalesgrp = podetail.ssalesgroup) and
(tblmaster_shipto.ssalesrep = podetail.ssalesrepcode) and
(tblmaster_shipto.sdistrchnl = podetail.sdistributionchannel))
left outer join tblmaster_accountsoldto on
(tblmaster_accountsoldto.ssoldto = podetail.ssoldto)
and (tblmaster_accountsoldto.ssalesgroup not in ('R1','R2','R3'))
where podetail.sdistributionchannel != 'WL'
group by
podetail.ssalesorganization,
podetail.Ssalesgroup,
podetail.ssalesrepcode,
podetail.sDistributionChannel,
podetail.ssoldto,
podetail.sshipto,
PO_Num
-- step 20
insert into posummary
select
podetail.ssalesorganization,
podetail.Ssalesgroup,
podetail.ssalesrepcode,
podetail.sDistributionChannel,
podetail.ssoldto,
podetail.sshipto,
max(tblmaster_shipto.scustname1) as Custname1,
max(tblmaster_shipto.scustname2) as Custname2,
PO_Num,
max(Order_Date) as Order_Date,
max(Req_Ship_Date) as Req_Ship_Date,
max(Inv_Date) as Inv_Date,
max(Inv_Nr) as Inv_Nr,
sum(lorderquantity) as lorderquantity,
sum(lordervalue) as lordervalue,
sum(lshipvalue) as lshipvalue,
sum(lordervalue) - sum(lshipvalue) as Openval,
sum(lshipquantity) as lshipquantity,
max(tblmaster_accountsoldto.saccountsoldto) as AccountSoldTo,
max(tblmaster_accountsoldto.smastersoldto) as MasterSoldTo
from podetail
left outer join tblmaster_shipto on
((tblmaster_shipto.ssoldto = podetail.ssoldto) and
(tblmaster_shipto.sshipto = podetail.sshipto) and
(tblmaster_shipto.ssalesgrp = podetail.ssalesgroup) and
(tblmaster_shipto.ssalesrep = podetail.ssalesrepcode) and
(tblmaster_shipto.sdistrchnl = podetail.sdistributionchannel))
left outer join tblmaster_accountsoldto on
(tblmaster_accountsoldto.ssoldto = podetail.ssoldto)
and (tblmaster_accountsoldto.ssalesgroup in ('R1','R2','R3'))
where podetail.sdistributionchannel = 'WL'
group by
podetail.ssalesorganization,
podetail.Ssalesgroup,
podetail.ssalesrepcode,
podetail.sDistributionChannel,
podetail.ssoldto,
podetail.sshipto,
PO_Num|||Your insert statement is not optimal - it's missing the column list for the
destination table. Maybe that's it.
ML|||> Your insert statement is not optimal - it's missing the column list for the
> destination table. Maybe that's it.
You mean where I have:
insert into posummary
select
podetail.ssalesorganization,
podetail.Ssalesgroup,
podetail.ssalesrepcode,
podetail.sDistributionChannel,
podetail.ssoldto,
podetail.sshipto......
it should now read:
insert into posummary
select
sSalesOrganization = podetail.ssalesorganization,
sSalesGroup = podetail.Ssalesgroup,
sSalesRepCode = podetail.ssalesrepcode,
sDistributionChannel = podetail.sDistributionChannel,
sSoldTo = podetail.ssoldto,
sShipTo = podetail.sshipto,
Is that correct?
I didn't think that made a lot of difference. The error message surely
doesn't lead you in that direction. The error message makes you think
it cannot find the table.
BC