CCommand Open freezing.
- From: "Inquirer" <sdaman29@xxxxxxxxx>
- Date: 11 Mar 2007 15:52:32 -0700
Hi,
I execute the following statement in a database;
if exists (SELECT [dbo].[sysobjects].[name] FROM [dbo].[sysobjects]
WHERE [dbo].[sysobjects].[name] = N'sp_SomeStoredProc' AND
[sysobjects].[type] = N'P' ) DROP PROCEDURE [dbo].[sp_SomeStoredProc']
it used to work with SQL Server 2000 but hangs/freezes indefinitely
when run with SQL Server 2005.
it was originally like this:
IF EXISTS (SELECT name FROM sysobjects WHERE name =
'sp_SomeStoredProc' AND type = 'P') DROP PROCEDURE [sp_SomeStoredProc]
but my changes (putting name and type columns into [...], etc) did not
help. still freezing.
I run several other statements before and they end successfully. I
even run:
IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id(N'[dbo].
[SomeTable]') AND OBJECTPROPERTY(id, N'IsUserTable') = 1) DROP TABLE
[dbo].[SomeTable]
and it still goes fine.
only in the case of :
IF EXISTS (SELECT name FROM sysobjects WHERE name =
'sp_SomeStoredProc' AND type = 'P') DROP PROCEDURE [sp_SomeStoredProc]
or
if exists (SELECT [dbo].[sysobjects].[name] FROM [dbo].[sysobjects]
WHERE [dbo].[sysobjects].[name] = N'sp_SomeStoredProc' AND
[sysobjects].[type] = N'P' ) DROP PROCEDURE [dbo].[sp_SomeStoredProc']
it freezes, even though the stored procedures NEVER exist, so the
problem should be somewhere in the select statements, not in the
dropping of procedures itself. Plus: I can run the statements from SQL
Server Management Studio console and they still run fine! Does ADO
interpret something wrongly?
Many thanks in advance!
.
- Prev by Date: Re: ADO - Bad when it is time to Optimize
- Next by Date: Re: C++ support for ADO
- Previous by thread: Re: Public member not found
- Next by thread: ADO: Stored Procedures & Parameters Insert Problem
- Index(es):
Relevant Pages
|
|