Showing posts with label amazing. Show all posts
Showing posts with label amazing. Show all posts

Wednesday, March 7, 2012

An Amazing Errorrrrrrrrrrrrrrrr

Hi All Friends

i have an amazing error in my project

i wrote a project in ASP.NET 2

a part of this project change a value in a row in a table in sql 2005 to another value

i used it in my computer (With Local host and my own iis) and it works properly and without any problem

but when i upload it in internet it have this error:

"Concurrency violation: the UpdateCommand affected 0 of the expected 1 records. "

can anyone help me?

i think the error is from my table in sql 2005 but i dont know what is wrong in it

thanks for your cares friends and im waiting for your usefull answers

It means that someone changed the row between the time you initially retrieved it, and the time you did the update. Or you are pointing at the wrong database for the update.

|||

No it cannot happen

because this form has a password that no one have it and no one know about this form

it cant be

but it's a Notice here :When i delete my table and recreate it again it work probably but sometimes it has this error again

|||

Well, if you're absolutely sure that there is no way that the row could have been changed--there could be other forms or other apps that are updating the table--then there is something wrong in the concurrency code. Did a wizard generate this for you, or did you write some custom code?

Don

Thursday, February 16, 2012

Amazing scenario

OK Here it is.
The production database was detached so it could be moved. Upon
reattachment it decided it was corrupt and refused to allow me to reattach.
Another member of the dba team had a physical copy of the MDF and LDF from a
few days ago. He copied the current files off for safe keeping and
reattached the old copy. Now he wants to apply the current LDF log to the 5
day old database that was attached. Is this possible?
This nightmare is neverending. Please someone help!
Richard> He copied the current files off for safe keeping and reattached the old copy. Now he want
s to
> apply the current LDF log to the 5 day old database that was attached. Is this po
ssible?
No, SQL Server keep track of the internal "timestamp" of the database files
and you have to attach
from the same point in time. Otherwise, we would have chaos.
I suggest you open a ticket with MS Support and see if they can assist with
the attach. I always do
a DBCC CHECKDB and also a backup before these things, btw...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Richard Douglass" <RDouglass@.arisinc.com> wrote in message
news:uDSpGga3GHA.5024@.TK2MSFTNGP02.phx.gbl...
> OK Here it is.
> The production database was detached so it could be moved. Upon reattachm
ent it decided it was
> corrupt and refused to allow me to reattach. Another member of the dba tea
m had a physical copy of
> the MDF and LDF from a few days ago. He copied the current files off for
safe keeping and
> reattached the old copy. Now he wants to apply the current LDF log to the
5 day old database that
> was attached. Is this possible?
> This nightmare is neverending. Please someone help!
> Richard
>

Amazing scenario

OK Here it is.
The production database was detached so it could be moved. Upon
reattachment it decided it was corrupt and refused to allow me to reattach.
Another member of the dba team had a physical copy of the MDF and LDF from a
few days ago. He copied the current files off for safe keeping and
reattached the old copy. Now he wants to apply the current LDF log to the 5
day old database that was attached. Is this possible?
This nightmare is neverending. Please someone help!
Richard
> He copied the current files off for safe keeping and reattached the old copy. Now he wants to
> apply the current LDF log to the 5 day old database that was attached. Is this possible?
No, SQL Server keep track of the internal "timestamp" of the database files and you have to attach
from the same point in time. Otherwise, we would have chaos.
I suggest you open a ticket with MS Support and see if they can assist with the attach. I always do
a DBCC CHECKDB and also a backup before these things, btw...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Richard Douglass" <RDouglass@.arisinc.com> wrote in message
news:uDSpGga3GHA.5024@.TK2MSFTNGP02.phx.gbl...
> OK Here it is.
> The production database was detached so it could be moved. Upon reattachment it decided it was
> corrupt and refused to allow me to reattach. Another member of the dba team had a physical copy of
> the MDF and LDF from a few days ago. He copied the current files off for safe keeping and
> reattached the old copy. Now he wants to apply the current LDF log to the 5 day old database that
> was attached. Is this possible?
> This nightmare is neverending. Please someone help!
> Richard
>

Amazing scenario

OK Here it is.
The production database was detached so it could be moved. Upon
reattachment it decided it was corrupt and refused to allow me to reattach.
Another member of the dba team had a physical copy of the MDF and LDF from a
few days ago. He copied the current files off for safe keeping and
reattached the old copy. Now he wants to apply the current LDF log to the 5
day old database that was attached. Is this possible?
This nightmare is neverending. Please someone help!
Richard> He copied the current files off for safe keeping and reattached the old copy. Now he wants to
> apply the current LDF log to the 5 day old database that was attached. Is this possible?
No, SQL Server keep track of the internal "timestamp" of the database files and you have to attach
from the same point in time. Otherwise, we would have chaos.
I suggest you open a ticket with MS Support and see if they can assist with the attach. I always do
a DBCC CHECKDB and also a backup before these things, btw...
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Richard Douglass" <RDouglass@.arisinc.com> wrote in message
news:uDSpGga3GHA.5024@.TK2MSFTNGP02.phx.gbl...
> OK Here it is.
> The production database was detached so it could be moved. Upon reattachment it decided it was
> corrupt and refused to allow me to reattach. Another member of the dba team had a physical copy of
> the MDF and LDF from a few days ago. He copied the current files off for safe keeping and
> reattached the old copy. Now he wants to apply the current LDF log to the 5 day old database that
> was attached. Is this possible?
> This nightmare is neverending. Please someone help!
> Richard
>

Amazing

Hi everyone,

I've got a dts 2000 which owns a Sql Task:

werweuroweuroiweruewr

DECLARE @.CONTADOR BIGINT

SET @.CONTADOR = 0

WHILE @.CONTADOR <= 100000

BEGIN

INSERT INTO TABLA1 (ID,NOMBRE) VALUES(@.CONTADOR,'PRUEBAS')

SET @.CONTADOR = @.CONTADOR + 1

END

'werweuroweuroiweruewr' obviously doesn't exists in my database, but it's ignored 110 times.

Then I see that TABLA1 own 100 rows. After that fails, of course.

Could you please so kind to give me any explanation for this behaviour. I'm totally stuck,

I haven't enought words (in english) in order to define this!

Why SQL executes 110 times that loop and then, oh my god, discover that 'weerrrr...' doesn't exists at all and stop!

If possible and there is explanation for that it could happen in SQL 2005?

Thanks in advance,

What is "werweuro..." supposed to represent? I'm confused.|||

Enric,

Where are you getting the error? This seems to be a DB/T-sql related issue.

I just ran that sample code in SSMS, I don't have Table1 of course, and the first error I received is:

Msg 2812, Level 16, State 62, Line 1

Could not find stored procedure 'werweuroweuroiweruewr'.

Msg 208, Level 16, State 1, Line 13

Invalid object name 'TABLA1'.

So, I am not sure...

|||

Hi both,

That's simply garbage. It doesn't exits at all. I don't know why it insert rows.

Ok, guys, run this code in your Query Analyzer:

werewr
DECLARE @.CONTADOR BIGINT
SET @.CONTADOR = 0

WHILE @.CONTADOR <= 100000
BEGIN
INSERT INTO TABLA1 (ID,NOMBRE) VALUES(@.CONTADOR,'PRUEBAS')
SET @.CONTADOR = @.CONTADOR + 1

END

I'll tested it and at the end TABLA1 have 100000 rows (despite the error)

|||At the end of the day it only demonstrate that Sql Task from DTS have a different behaviour than a Query Analyzer session. I knew that but anuway, how to configure?