Re: Hung up using a SELECT MAX when an alter database has been execute in a SQL Server database
- From: "Gustavo Echevarria" <g.echevarria@#REMOVETHIS#lantek.es>
- Date: Wed, 16 Aug 2006 08:12:04 +0200
"Mark J. McGinty" <mmcginty@xxxxxxxxxxxxxxx> escribió en el mensaje
news:%23Qllw1kvGHA.324@xxxxxxxxxxxxxxxxxxxxxxx
"Gustavo Echevarria" <g.echevarria@#REMOVETHIS#lantek.es> wrote in message
news:u1hXI$EvGHA.1436@xxxxxxxxxxxxxxxxxxxxxxx
Hi all
i've reach a very strange sql server hung up when executing the following
code. I modified a table with an alter table, the sql server locks the
table with SCH-M and it hung up whe using a locktype greater than
ADODB.LockTypeEnum.adLockReadOnly when making a select to that table with
a select max of any field.
The conflict seems to be a SCH-S lock on the same table that waits
(deadlock?) the release of the SCH-M lock?
How can the same connection make a deadlock with itself? Is SQL Server
bugged with this to kind of locks?
Why the SELECT MAX blocks with a SCH-S and a SELECT TOP 1 FIELD ORDER BY
FIELD DESC didn't?
If someone has the same problem or know a issue that can help me
understanding why this happens all help will be appreciatted.
It is probably because you are trying to do it all within the same
transaction. Commit the schema changes first, then run your select
statement.
-Mark
But if i use a SELECT TOP 1 FIELD ORDER BY FIELD DESC it didn't hung the
transacction, which is the difference between one SELECT statement and
another?
This is the problem, i do not know why one hungs the transacction with a
SCH-M and SCH-S deadlock in the same transaction, and the other do not.
Gustavo Echevarria
.
- References:
- Hung up using a SELECT MAX when an alter database has been execute in a SQL Server database
- From: Gustavo Echevarria
- Re: Hung up using a SELECT MAX when an alter database has been execute in a SQL Server database
- From: Mark J. McGinty
- Hung up using a SELECT MAX when an alter database has been execute in a SQL Server database
- Prev by Date: Re: Syntax Error in FROM clause
- Next by Date: Re: ADOX - Create Table
- Previous by thread: Re: Hung up using a SELECT MAX when an alter database has been execute in a SQL Server database
- Next by thread: Hung up using a SELECT MAX when an alter database has been execute in a SQL Server database
- Index(es):
Relevant Pages
|