Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


sign of corrupt database?


sign of corrupt database?

Author
Message
briancampbellmcad
briancampbellmcad
SSC-Enthusiastic
SSC-Enthusiastic (163 reputation)SSC-Enthusiastic (163 reputation)SSC-Enthusiastic (163 reputation)SSC-Enthusiastic (163 reputation)SSC-Enthusiastic (163 reputation)SSC-Enthusiastic (163 reputation)SSC-Enthusiastic (163 reputation)SSC-Enthusiastic (163 reputation)

Group: General Forum Members
Points: 163 Visits: 403
When I manually run this insert script below I'm usually expecting to see (2 lines due to a trigger that posts a log entry):

(1 row(s) affected)

(1 row(s) affected)

However this is what I see:

(0 row(s) affected)

(1 row(s) affected)

(0 row(s) affected)

(0 row(s) affected)

(0 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

INSERT INTO [TrackIT].[dbo].[tblTransactions]
([PO_Number]
,[Buyer_Initial]
,[Quantity]
,[Unit_Price]
,[Software_Description]
,[HeatTicketNumber]
,[Transaction_Date]
,[Transaction_Type])
VALUES
('3347304',
'OCC',
10,
'479.36',
'MS Project Std 2010',
'1939854',
'12/7/2012',
'Bulk Purchase')
GO

Is this a sign of a corrupted database? This happened just after I manually deleted all records from a table and a few of them gave errors of something like "cannot delete" due to some type of unique key violation... I was able to eventually delete them all but this may have corrupted it? I dropeed and recreated the tables in question and the associated triggers, but still getting these results and the web application I have connected is unable to add records, although one I add a record manually I can modify it from my app so I am getting a connection.

If the database is corrupt should I script out the entire database and recreate it?
GilaMonster
GilaMonster
SSC-Forever
SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)

Group: General Forum Members
Points: 47241 Visits: 44377
briancampbellmcad (12/8/2012)
Is this a sign of a corrupted database?


No.

This happened just after I manually deleted all records from a table and a few of them gave errors of something like "cannot delete" due to some type of unique key violation... I was able to eventually delete them all but this may have corrupted it?


Nope.

If the database is corrupt should I script out the entire database and recreate it?


Well, it's not a sign of corruption anyway, and scripting out a DB is not the way you recover from corruption.

It looks like either the trigger does more than one operation or the trigger's operations are firing other triggers or there's more than one trigger on the table.


Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


briancampbellmcad
briancampbellmcad
SSC-Enthusiastic
SSC-Enthusiastic (163 reputation)SSC-Enthusiastic (163 reputation)SSC-Enthusiastic (163 reputation)SSC-Enthusiastic (163 reputation)SSC-Enthusiastic (163 reputation)SSC-Enthusiastic (163 reputation)SSC-Enthusiastic (163 reputation)SSC-Enthusiastic (163 reputation)

Group: General Forum Members
Points: 163 Visits: 403
That makes sense about the number of transactions and those are consistent with the dependent triggers. I dropped them temporarily and recreated them and the number of transactions reponded accordingly. My problem must be on the application side. In Visual Studio I have an ASP.net app that my pages for reading data are working fine and my pages for manipulating data are doing fine as well, but my page for entering data is not. I tried reconfiguring the SqlDataSource and the usual place where I can instruct it to Generate Update, Delete, and Modify statements is strangely grayed out.
Jeff Moden
Jeff Moden
SSC-Forever
SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)

Group: General Forum Members
Points: 45071 Visits: 39907
As a side bar, I recommend adding SET NOCOUNT ON at the beginning of each trigger so that it suppresses all of that unnecessary IO. To wit, sometimes a GUI will interpret such returned row count as an indication of an error.

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
Although they tell us that they want it real bad, our primary goal is to ensure that we dont actually give it to them that way.
Although change is inevitable, change for the better is not.
Just because you can do something in PowerShell, doesnt mean you should. Wink

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
briancampbellmcad
briancampbellmcad
SSC-Enthusiastic
SSC-Enthusiastic (163 reputation)SSC-Enthusiastic (163 reputation)SSC-Enthusiastic (163 reputation)SSC-Enthusiastic (163 reputation)SSC-Enthusiastic (163 reputation)SSC-Enthusiastic (163 reputation)SSC-Enthusiastic (163 reputation)SSC-Enthusiastic (163 reputation)

Group: General Forum Members
Points: 163 Visits: 403
Could the above be a permissions issue? It is peculiar that in VS my ASP.net SqlDataSource has the "Generate INSERT, DELETE, MODIFY Statements" grayed out... my other tables do not behave like this when attempting a SqlDataSource creation. Some posts have suggested a lack of a Primary Key, but my table has one.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search