How To Handle Recurring Actions

Dec 8, 2004

Hi!


My problem/"goal to achieve" is the following..


Users can insert orders in a db-table. The date on which they've been created is stored.


I want the server to insert a new record in another table (accounts) for every order which is older than 2 weeks.


How should I do that?


With a custom action which checks all orders (a customer must press some button every day).


Or a static "update-class" with a kind of timer which does the action every 24 hours?


Of course an automatic solution will be the best! Another question is: how can i ensure that an instance of this "update-class" will never die?


Thanks so far...

View 2 Replies


ADVERTISEMENT

Recurring SQL. Maybe?

Jan 5, 2007

Guys can you help please...
At the moment I have an unknwon number of ID's and need their related info in another table (1,2,3,4,5 for example) and I'm looping and merging to get them as one table: 
For i = 1 to however many...
 Dataset = Select where ID = array(i)
  FinalDataset.Merge(Dataset)
Next
How can I write a stored proceedure or something where the loop is happening at the database end, to avoid going back and forth?
I was thinking dynamically generating the sql statement:
Select * from table where ID = 1 or ID =2 or ID =3......
But this could become huge if you had a couple of hundred to do...there must be a more efficient way to do it...

View 2 Replies View Related

How Do I Manage 100.000 Actions A Day ?

Mar 27, 2008

In a previous application i stored about 100.000 actions ( coming from an external system )in an access database for each day. Therefore i created everyday a new accessdatabase to have enough performance. Each month i copied automatically all databases in a new 'month' map as a backup.

The goal of the application is the view all actions of one day of week in one grid. This is a kind of history of the external system.

I'm afraid the application will become to slow if i save all actions in one database. ( after 1 month i will have 3.000.000 actions.

How this is done in an sql server ?
Do i have to use a different kind of method ?

View 2 Replies View Related

Recurring Date

Dec 17, 2004

Here's my problem:

I have a date that is entered into the field, 12/17/2004. My client wants the site set up so that when after the date is entered, it automatically updates itself every week. So the date represents an event, and he wants to update the event date automatically instead of having a user login and update the date manually. So 12.17/2004 shoudl turn into 12/24/2004, and then 12/31/2004 and so forth.

One brilliant guy told me that if you entered a start date of and an end date then some how that might me be a little easier.

Any thoughts good people?

View 6 Replies View Related

Recurring Inconsistencies

Feb 28, 2007

I have a situation where a common table within multiple databases across multiple servers is randomly getting corrupt. The database schema is identical for each database. There are approx. 200 copies of the database on each server. I am seeing one or two errors per week. There doesn't seem to be any similarities between the databases that are effected... It is always the same table that gets corrupted. The mulitple servers are using a SAN but since it is different databases / common table I have a hard time believing it is hardware related.

The error that the application throws is:
Microsoft OLE DB Provider for ODBC Drivers (-2147467259) [Microsoft][ODBC SQL Server Driver][SQL Server]Could not find the index entry for RID '16b700000000000000030002' in index page (1:5366), index ID 0, database 'DISOPT'.

When running a DBCC on the table the following is returned:

Database DISOPT consistency errors in table TF_FILE_METADATA_VALUES fixed no data loss reported.
DBCC results for 'TF_FILE_METADATA_VALUES'.
The error has been repaired.
Clustered index successfully restored for object 'dbo.TF_FILE_METADATA_VALUES' in database 'MUTGEN'.
There are 277 rows in 2 pages for object 'TF_FILE_METADATA_VALUES'.
CHECKDB found 0 allocation errors and 1 consistency errors in table 'TF_FILE_METADATA_VALUES' (object ID 1332199796).
CHECKDB fixed 0 allocation errors and 1 consistency errors in table 'TF_FILE_METADATA_VALUES' (object ID 1332199796).

This corrects the problem and the app functions as normal. The errors are random across databases but ALWAYS the same table.

Any thoughts?

View 7 Replies View Related

Recurring Scheduled Job

Sep 13, 2006

Is it possible to display when a scheduled job is next due to run ineither a view or a table?If so, how?thanksBryan

View 3 Replies View Related

Actions On SQL Job Step Failure

Feb 26, 2001

Hi Team,

I've recently had a situation where some of the steps in the daily backup job failed. The job is defined such that if a step fails, it goes on to the next step (these are dev. backups :)

Is there a way that I can tell it to notfy me of the step failure AND go on to the next step? The notification is reporting that the job was successful when in fact a couple of the steps failed. Is there any way around this?

Thanks in advance,

View 2 Replies View Related

Question On Cube Actions

May 22, 2007

Hi, all experts here,

I am having a question on cube actions. What is the easiest way for us to see all actions properties(including objects to trigger the actions, etc.), hope it is clear for your help and I am looking forward to hearing from you shortly.

Thanks a lot in advance.

With best regards,

Yours sincerely,

View 7 Replies View Related

How To Compare And Take Actions From 2 Different Data Sources

Mar 17, 2008



Hi,

I have to get all the customer records from one table and compare this records with another table and finally if there is same record I have to perform an update but the record does not exist I have to make an insert.
How can I do it with SSIS Except writing sql or tsql scripts ?

thanks,
J

View 1 Replies View Related

DB Engine :: Deadlock Detection And Actions From A DBA

Jul 29, 2015

what are the best ways to action on the Deadlock issues. I am aware how a deadlock is occurred and we can get the queries causing by the Trace, and Profiler. What will en best steps to Investigate from DBA end later collecting the stats.What steps will ensure to get these deadlocks addressed.

View 4 Replies View Related

Recurring Meeting On Multiple Days UGH!

Nov 10, 2004

Ugh!

I need to create some SQL that will generate all the dates for a recurring meeting on multiple days per week.

For example:
a meeting on Monday , Wednesday and Friday at 10:00 am - 10:30 am from December 1st 2004 to Feb 28th 2005.

I'm not sure what to do here.

Any Ideas?

Regards
Russ

View 1 Replies View Related

Recurring Tasks Stored Procedure

Jan 4, 2008

Hi,

I have been asked to add a feature to some software I have written which needs to send reminder emails.

The reminders can have a recurrence, for example it might recur every 3 days or every 2 weeks. The reminders also have a start and end date. I have created a sql table with these fields:

Reminder ID
RecurrenceType (e.g. Daily, Weekly, Monthly)
RecurrenceAmount (e.g. 1, 2 etc.)
StartDate
EndDate
ReminderText
AddedBy
DateTimeStamp

I now need to write a stored procedure that will run every morning and send the reminders. I have no problem with sending emails from sql, the trouble I am having is I cannot figure out how to get the recurrences for the current day.

Hope this makes sense!

Sorry there is no code sample, I have been thinking about this one for a couple of days but I still don't know where to begin!

If anyone could offer any help it would be greatly appreciated!

Thanks

Jimbo

View 7 Replies View Related

Recurring Problem When Attempting Install

Jun 21, 2007

I downloaded VisualBasic 2005 Express Edition recently, and the installation went flawlessly, but when I tried to download the optional component SQL server express, the installation failed. When two subsequent installations failed, I decided I'd get along without it, until such time as I discovered I *needed* it. Well, I'm here, and the installation is still failing. I've tried both installing it though the VBstudio setup, and downloading it separately, but both fail at roughly the same point. The error from the standalone installation is more descriptive:



TITLE: Microsoft SQL Server 2005 Setup
------------------------------

SQL Server Setup Failed to compile the Managed Object Format (MOF) file c:Program FilesMicrosoft SQL Server90Sharedsqlmgmproviderxpsp2up.mof. To proceed, see "Troubleshooting an Installation of SQL Server 2005" or "How to: View SQL Server 2005 Setup Log Files" in SQL Server 2005 Setup Help documentation.

For help, click: http://go.microsoft.com/fwlink?LinkID=20476&ProdName=Microsoft+SQL+Server&ProdVer=9.00.3042.00&EvtSrc=setup.rll&EvtID=29513&EvtType=sqlca%5csqlmofca.cpp%40Do_sqlMofcomp%40Do_sqlMofcomp%40x80041002



The link leads to an apology - they have no information on this subject. Of the help files, the troubleshooting page contains nothing (noticeably) relevant, and the log files have nothing obvious either, at least as far as I could tell... but then, I have no idea, which is why I'm here

View 1 Replies View Related

Problem When Adding Cascade Actions To A Relationship

Aug 21, 2007

Hello everyone,
I wanted to change a relationship in a database in order for it to have a cascading effect on update and on delete in order to preserve the data integrity. The problem is that when I click the save button I get the following error message:
'Role (Application)' table saved successfully'Usergroup_Role (Security)' table- Unable to create relationship 'FK_Usergroup_Role_RoleId_Application_Role_Id'.  Introducing FOREIGN KEY constraint 'FK_Usergroup_Role_RoleId_Application_Role_Id' on table 'Usergroup_Role' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints.Could not create constraint. See previous errors.
Any suggestion on how can I fix this? For a better understanding of the real problem I've uploaded a picture of the tables diagram. Here's the link
Best regards.

View 2 Replies View Related

Performing Completion Actions, Cursor_close_on_commit Setting

Jul 20, 2005

Hello,I have several SQL Server jobs that execute procedures written to rundeletes and updates against tables in my data warehouse. Some jobsoccasionally get stuck with the status "Performing Completion Actions"and can only be reset by restarting SQL Server or rebooting theserver.I have seen one answer to this problem in a DTS package is to checkthe box specifying "Close Connection on Completion" for each task. Isthis the equivalent of setting "cursor_close_on_commit" to "on" inT-SQL?? If not, what is the equivalent in T-SQL??Thanks in advance!Cliff

View 3 Replies View Related

Problem When Adding Cascade Actions To A Relationship

Aug 22, 2007





Hello everyone,

I wanted to change a relationship in a database in order for it to have a cascading effect on update and on delete in order to preserve the data integrity. The problem is that when I click the save button I get the following error message:

'Role (Application)' table saved successfully
'Usergroup_Role (Security)' table
- Unable to create relationship 'FK_Usergroup_Role_RoleId_Application_Role_Id'.
Introducing FOREIGN KEY constraint 'FK_Usergroup_Role_RoleId_Application_Role_Id' on table 'Usergroup_Role' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints.
Could not create constraint. See previous errors.

Any suggestion on how can I fix this? For a better understanding of the real problem I've uploaded a picture of the tables diagram. Here's the link

Best regards.

View 12 Replies View Related

SSIS Package Recurring Schedule Issue

Sep 15, 2006

We have some SSIS packages that are running on a recurring SQL Job. They work and play fine. They ran for about three iterations and then decided to stop....they don't report errors, they just don't do anything. They sit as if they were disabled (but they aren't disabled, I checked the MSDB database).

You can manually execute the packages and they work fine.

I have dumped and reloaded these packages and that hasn't fixed the issue.

If I setup a simple recuring job that executes a sql script every few minutes that works fine and you can see that it executes every few minutes. But these SSIS packages just sit....and do nothing. But they were working for the first few iterations.

I have also redeployed the SSIS packages and that hasn't fixed it either.

Anybody seen anything like it?

View 1 Replies View Related

Recurring VS_NEEDSNEWMETADATA Error...whats Wrong?

Aug 11, 2007

Hi guys, wonder if you could help.

Ok, basically, my SSIS flow gets data from different excel worksheets and puts in the db.

For some reason its being very incosistent. I fixed all the problems I was having but one component keeps coming up with the [ component "Excel Source" (1)" failed validation and returned validation status "VS_NEEDSNEWMETADATA" ] error.

So, I click on the component, it asks if i want to fix the metadata stuff, I say yes, it fixes it, I run the app, everything's cool.

The I run the app again and again it comes up with this f** error?

Is there anyway SSIS can't just ignore this metadata stuff??

thanks!

View 5 Replies View Related

Problem With Recurring Execution Of SSIS Package

Jun 22, 2007

Hi All,



I have created a SSIS package which calls child packages internally. In other words there is hierarchy of packages. I am using For Loop Container with certain check conditions to execute whole set of packages repeatedly. I have to execute this set for almost 5000 times. But my problem is this set fails after every 50 and sometimes 55 cycles. Can Anybody let me know how to get solution for such a problem?



Regards,

Prash

View 1 Replies View Related

SQL 2012 :: SSAS Actions Not Appearing In Excel 2010?

Nov 28, 2012

I have an SSAS cube that i want to add some actions to. I've had problems adding a reporting action to the cube so decided just to add a URL action instead. Start simple and build on the concepts...

So i add a new action, give it a name, set the Target Type to Cells, Taget object to All Cells. I've put no condition on the action since i want it to appear all the time.

The action content type is set to URL the action expression is set to [URL] I've also set a caption of "Google" under the additional properties and said that the caption is MDX (I'm aware that it isn't but i do intend to expand on this...).

I then build and deploy my cube, call up excel (2010) and then create a pivot table off the back of the cube but when i right-click the cells in the pivot table and go to "additional actions" it tells me that there are none specified.

[URL]

View 6 Replies View Related

SQL 2012 :: Creating A Popup Window From SSAS Actions?

Nov 19, 2014

I have a cube where i would like to define some actions. I have done report Actions but they are limiting in terms of what i am trying to achieve.I want a popup window from the action from relevant cells at the moment i can use the urlaction type to open the link in a new window which is ok but i want this as a popup.

View 0 Replies View Related

SQL Tools :: How To Trace Or Monitor Previous Actions In 2012

Sep 12, 2015

how to trace or monitor previous actions in sql server 2012. Like previous using delete command . I want to know who is used that command in server.

View 2 Replies View Related

Error Log Peppered With --&&> 'The Conversation Handle Is Missing. Specify A Conversation Handle.'

Dec 3, 2007

Hi

I'm using service broker and keep getting errors in the log even though everythig is working as expected

SQL Server 2005
Two databases
Two end points - 1 in each database
Two stored procedures:
SP1 is activated when a message enters the sending queue. it insert a new row in a table
SP2 is activated when a response is sent from the receiving queue. it cleans up the sending queue.

I have a table with an update trigger
In that trigger, if the updted row meets a certain condition a dialogue is created and a message is sent to the sending queue.
I know that SP1 and SP2 are behaving properly because i get the expected result.
Sp1 is inserteding the expected data in the table
SP2 is cleaning up the sending queue.

In the Sql Server log however i'm getting errors on both of the stored procs.
error #1
The activated proc <SP 1 Name> running on queue Applications.dbo.ffreceiverQueue output the following: 'The conversation handle is missing. Specify a conversation handle.'

error #2
The activated proc <SP 2 Name> running on queue ADAPT_APP.dbo.ffsenderQueue output the following: 'The conversation handle is missing. Specify a conversation handle.'

I would appreceiate anybody's help into why i'm getting this. have i set up the stored procs in correctly?

i can provide code of the stored procs if that helps.

thanks.

View 10 Replies View Related

Recurring Appointments Calendar Design (was The Most Challenging Project)

Jan 14, 2005

Hello,
This is my first project at the company I recently joined. It is the most challenging project I ever had.

It is a kind of web-scheduler.
it let you save appointments which could be one time or periodic.
For example, it could be like every monday, every other monday, first tuesday every monday, and so on.

once they are saved, it should be able to display only those appointments the user have on a specific day.

I'd like to know how database has to be designed to meet such a challenging requirement?
I'd like to hear anything from you if you have had similar project before.

Thank you,
Charlie

View 2 Replies View Related

SQL 2012 :: Using Database Mail To Send Emails Based On Certain Actions

Jun 12, 2014

I have been using database mail for quite a few years now. I started using it with SQL Server 2005 and then it worked fine. Then we went over to SQL 2012 and the problems started. At first I could not get any e-mails out and read a post by Microsoft that a patch needs to come out but not available yet. That was in 2012. Presumably the patch came out with windows updates and my DB Mail started working. Now, however, I have the problem that some e-mails do get sent but the majority failed.

I use this so that whenever a user captures certain data to update a person's status on the database then an automatic e-mail will be sent to that person to inform them of their status at this company.

View 0 Replies View Related

Why RS Lets User To Create BookmarkID And Actions By Using A Different Query That The Reportitem Is Using.

Jun 20, 2007

It seems in the spec that Data Regions can only reference a single dataset, then why bookmarkID and bookmark action can reference a different dataset than the one that the Data Region is using?

Like in this case:

1) create a table with dataset1

2) create another table with dataset2

3) create a bookmarkID using =Last(somefield, "dataset1") in any table cell in the first table

4) create a bookmark action using =Last(somefield, "dataset1") in any table cell in the SECOND table.

This is valid report, and it can preview....



I know this example not practical at all, it is just used to illustrate my question.

Is this a scoping rule exception for any special reasons? or it's just a bug?



If it is a scoping rule exception, please explain, and a practical example would be great.

View 4 Replies View Related

Configuration Warning Loading Project REAL Etl Package Recurring ETL

Feb 29, 2008



I am trying to load Project Real. I get warnings when opening the RecurringETL package. However I created the two environment variables it's looking for and have confirmed these variables are functional.
I am unsure how to troubleshoot this and am afraid to do anything given these warnings. Where is the configurations collection??????:

Warning 1 Warning loading TestHarness.dtsx: The configuration environment variable was not found. The environment variable was: "REAL_Configuration". This occurs when a package specifies an environment variable for a configuration setting but it cannot be found. Check the configurations collection in the package and verify that the specified environment variable is available and valid. C:Microsoft Project REALETLTestHarness.dtsx 1 1

Warning 2 Warning loading TestHarness.dtsx: The configuration environment variable was not found. The environment variable was: "REAL_Root_Dir". This occurs when a package specifies an environment variable for a configuration setting but it cannot be found. Check the configurations collection in the package and verify that the specified environment variable is available and valid. C:Microsoft Project REALETLTestHarness.dtsx 1 1


Warning 3 Warning loading TestHarness.dtsx: Failed to load at least one of the configuration entries for the package. Check configurations entries and previous warnings to see descriptions of which configuration failed. C:Microsoft Project REALETLTestHarness.dtsx 1 1
Thanks

View 8 Replies View Related

SQL Server 2012 :: Replacing Recurring Characters In A String With Single Character

Jan 20, 2014

I have a problem where I want to write a function to remove recurring characters from a string and replace them with a single same character.

For instance I have the string '12333345566689' and the result should be '12345689'. In Oracle I could do this with "regexp_replace('12333345566689', '(.)1+', '1')", but in T-SQL the only solution I could think of is something like this:

DECLARE @code NVARCHAR(255)
SET @code = '12333345566689';
SET @code = REPLACE(REPLACE(REPLACE(@Code, '1', '~1'), '1~', ''), '~1', '1');

and repeat this for 2 - 9. But I'm sure there is a more elegant version for this in SQL Server 2012.

View 9 Replies View Related

Conversation Handle Reuse And Conversation Handle XXX Not Found

Jan 18, 2008



We have implemented our service broker architecture using conversation handle reuse per MS/Remus's recommendations. We have all of the sudden started receiving the conversation handle not found errors in the sql log every hour or so (which makes perfect sense considering the dialog timer is set for 1 hour). My question is...is this expected behavior when you have employed conversation recycling? Should you expect to see these messages pop up every hour, but the logic in the queuing proc says to retry after deleting from your conversation handle table so the messages is enqueued as expected?

Second question...i think i know why we were not receiving these errors before and wanted to confirm this theory as well. In the queuing proc I was not initializing the variable @Counter to 0 so when it came down to the retry logic it could not add 1 to null so was never entering that part of the code...I am guessing with this set up it would actually output the error to the application calling the queueing proc and NOT into the SQL error logs...is this a correct assumption?

I have attached an example of one of the queuing procs below:




Code Block
DECLARE @conversationHandle UNIQUEIDENTIFIER,
@err int,
@counter int,
@DialogTimeOut int,
@Message nvarchar(max),
@SendType int,
@ConversationID uniqueidentifier
select @Counter = 0 -- THIS PART VERY IMPORTANT LOL :)
select @DialogTimeOut = Value
from dbo.tConfiguration with (nolock)
where keyvalue = 'ConversationEndpoints' and subvalue = 'DeleteAfterSec'
WHILE (1=1)
BEGIN
-- Lookup the current SPIDs handle
SELECT @conversationHandle = [handle] FROM tConversationSPID with (nolock)
WHERE spid = @@SPID and messagetype = 'TestQueueMsg';
IF @conversationHandle IS NULL
BEGIN
BEGIN DIALOG CONVERSATION @conversationHandle
FROM SERVICE [InitiatorQueue_SER]
TO SERVICE 'ReceiveTestQueue_SER'
ON CONTRACT [TestQueueMsg_CON]
WITH ENCRYPTION = OFF;
BEGIN CONVERSATION TIMER ( @conversationHandle )
TIMEOUT = @DialogTimeOut
-- insert the conversation in the association table
INSERT INTO tConversationSPID
([spid], MessageType,[handle])
VALUES
(@@SPID, 'TestQueueMsg', @conversationHandle);

SEND ON CONVERSATION @conversationHandle
MESSAGE TYPE [TestQueueMsg] (@Message)

END
ELSE IF @conversationHandle IS NOT NULL
BEGIN
SEND ON CONVERSATION @conversationHandle
MESSAGE TYPE [TestQueueMsg] (@Message)
END
SELECT @err = @@ERROR;
-- if succeeded, exit the loop now
IF (@err = 0)
BREAK;
SELECT @counter = @counter + 1;
IF @counter > 10
BEGIN
-- Refer to http://msdn2.microsoft.com/en-us/library/ms164086.aspx for severity levels
EXEC spLogMessageQueue 20002, 8, 'Failed to SEND on a conversation for more than 10 times. Error %i.'
BREAK;
END
-- We tried on the said conversation, but failed
-- remove the record from the association table, then
-- let the loop try again
DELETE FROM tConversationSPID
WHERE [spid] = @@SPID;
SELECT @conversationHandle = NULL;
END;

View 2 Replies View Related

Recurring Issue - OPENROWSET For Excel Query Stops Working , Cured By Restart Of SQL Server

May 25, 2007

Hi,

I am having a recurring issue that involves a stored proc using OPENROWSET to query an excel file. I used the surface area config to enable this on the server, and made sure that is still set. After an undetermined amount of time, the OPENROWSET query starts failing with this message:

OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" returned message "Unspecified error".
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)".

I corrected this previously by restarting the SQL server, but not before I checked permissions, the excel file itself, etc, and that was the last thing to try.

I am using SQL 2005 with SP1 installed - my primary approach to tackling this issue is to install the SP2, but I did not find this bug referenced in the fixes, and was wondering if anyone else had further insight.

Thanks,
Darrell Young

View 3 Replies View Related

Is There A Better Way To Handle This IF..ELSE IF?

Mar 30, 2004

Do I have other option beside using IF..ELSE IF? TIF



-- GET INFORMATION OF THE JOB
DECLARE @JOBIDAS Char(10)
DECLARE @VRUSERVICEHRSAS Decimal(18,2)
DECLARE @VRUSERVICEMINAS Decimal(18,2)
DECLARE @BILLEDFLATAS Decimal(18,2)
DECLARE @BILLREGRATEAS Decimal(18,2)
DECLARE @MIN_HRSAS Decimal(18,2)

DECLARE @COUNT_GREATER_MINTinyInt
DECLARE @COUNT_LESS_MINTinyInt

SET @VRUSERVICEMIN = 46
SET @BILLEDFLAT = 0
-- PROCESS ONLY RECORDS WHERE THERE IS NO FLAT FEE
IF @BILLEDFLAT = 0
BEGIN
IF @VRUSERVICEMIN BETWEEN 0 AND 15
BEGIN
SET @VRUSERVICEMIN = .25
END
ELSE IF @VRUSERVICEMIN = 15
BEGIN
SET @VRUSERVICEMIN = .25
END
ELSE IF @VRUSERVICEMIN BETWEEN 15 AND 30
BEGIN
SET @VRUSERVICEMIN = .5
END
ELSE IF @VRUSERVICEMIN = 30
BEGIN
SET @VRUSERVICEMIN = .5
END
ELSE IF @VRUSERVICEMIN BETWEEN 30 AND 45
BEGIN
SET @VRUSERVICEMIN = .75
END
ELSE IF @VRUSERVICEMIN = 45
BEGIN
SET @VRUSERVICEMIN = .75
END
ELSE IF @VRUSERVICEMIN > 45
BEGIN
SET @VRUSERVICEMIN = 1
END
END

PRINT @VRUSERVICEMIN

View 6 Replies View Related

How Can I Handle An Error

Apr 1, 2007

Is it possible to catch and error and then keep the process going in a stored procedure?
So if an update encounters a primary key violation on a row, is it possible to skip that row and keep the process going?

View 4 Replies View Related

How To Handle Particular Sql Error

Oct 21, 2007

Hi! I have some try .. catch block trying to insert some data into database. During its action duplicate key row insert error could raise, for example. The question is how could I know distinguish it from other sql errors? Object ex (Catch ex As Exception) has only message property '{"Cannot insert duplicate key row in object 'dbo.Group_Courses' with unique index 'IX_Group_Courses'.The statement has been terminated."}' and type System.Data.SqlClient.SqlException. Knowing the type of error is not enough, because there are different SqlExceptions. Even the message is not unique for this error, because now i deal with 'dbo.Group_Courses'  and then it could be other table. Is there something that unique identifies each error? For example error code. If it exists, where could I get it?
Thanks in  advance!
 

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved