Hi All,
I need help in MS-SQL USING VB.NET
I have to pass dynamic arrays as parameter and have to use to fetch data.
I have multiple @IMPORTRULE but in that case I can fetch only one by one.
Also want to replace in ( exp :- importruleid in ('100',3002,'4550')
CREATE PROCEDURE [dbo].[usp_Reporting_import_rule]
(
@IMPORTRULE VARCHAR(100),
@StartDate DateTime,
@EndDate DateTime
)
AS
BEGIN TRY
SELECT
[Import_Rule_History].[StartDateTime],[dbo].[Import_Rule_History].[ImportRul
eID],
[Import_Rule].[ImportRuleName],[Import_Rule_History].[GoodRecords],[Import_R
ule_History].[BadRecords],[Import_Rule_History].[TotalRecords]
FROM [Import_Rule_History] WITH(NOLOCK)
INNER JOIN [Import_Rule]
WITH(NOLOCK) ON
[Import_Rule].[ImportRuleID]=[Import_Rule_History].[ImportRuleID]
AND [Import_Rule_History].[StartDateTime]>=@StartDate
AND [Import_Rule_History].[EndDateTime]<=@EndDate
AND [ImportRuleID]=@IMPORTRULE
END TRY
BEGIN CATCH
DECLARE @ERRMESSAGE NVARCHAR(4000),
@ERRSEVERITY INT,
@ERRSTATE INT
SELECT
@ERRMESSAGE = ERROR_MESSAGE(),
@ERRSEVERITY = ERROR_SEVERITY(),
@ERRSTATE = ERROR_STATE()
RAISERROR (@ERRMESSAGE, @ERRSEVERITY, @ERRSTATE)
END CATCH
Can you help me?
_____
From: [email protected]
[mailto:[email protected]] On Behalf Of Jamie Fraser
Sent: Wednesday, March 02, 2011 9:55 PM
To: [email protected]
Subject: Re: [DotNetDevelopment] Re: Stored Procdure complete response
Except that he is performing SELECTs.....
If you are performing SELECTs... how can you determine "success" or
"failure"?
On Wed, Mar 2, 2011 at 4:20 PM, crazy <[email protected]> wrote:
You can Use try.. catch in each sp for check its success or failure...
see below..
Begin Try
Begin Transaction
--INSERT
--UPDATE
Commit
End Try
Begin
Catch
IF @@TRANCOUNT > 0
ROLLBACK
End Catch
On Wed, Mar 2, 2011 at 7:26 PM, littleccguy <[email protected]>
wrote:
In this case, all the jobs are just SELECTS (reports), so I think -1
is success and anything else would be a failure. Does that sound
right?
so if (i == -1) {...} in a try catch should do it - i think.
--
"People who never make mistakes, never do anything."
dEv
--
You received this message because you are subscribed to the Google
Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML
Web Services,.NET Remoting" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en
or visit the group website at http://megasolutions.net