Showing posts with label hit. Show all posts
Showing posts with label hit. Show all posts

Tuesday, March 20, 2012

Cant drop constraint...?

Hello, I have hit the wall here...can't make sense of this one.

I have a script that creates a PRIMARY KEY constraint called PK_tblDRG
CODE:

ALTER TABLE [dbo].[tblDRG]
ALTER COLUMN [record_id] Uniqueidentifier NOT NULL
Go
ALTER TABLE [dbo].[tblDRG]
WITH NOCHECK ADD PK_tblDRG PRIMARY KEY CLUSTERED
(
[record_id]
) WITH FILLFACTOR = 90 ON [PRIMARY]

All is fine with that. I run this to verify:

EXEC sp_pkeys @.table_name = 'tblDRG'
,@.table_owner = 'dbo' ,@.table_qualifier = 'Relational_05Q3'

which returns this:

TABLE_QUALIFIER TABLE_OWNER TABLE_NAME COLUMN_NAME KEY_SEQ PK_NAME
Relational_05Q3 dbo tblDRG record_id 1 PK_tblDRG

Now I want to drop the constriant if it exists:

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[PK__tblDRG]') and OBJECTPROPERTY(id, N'IsPrimaryKey') = 1)
ALTER TABLE [dbo].[tblDRG] DROP CONSTRAINT PK__tblDRG

AND I get this in return:

The command(s) completed successfully.

So, lets double check:

EXEC sp_pkeys @.table_name = 'tblDRG'
,@.table_owner = 'dbo' ,@.table_qualifier = 'Relational_05Q3'

AND I STILL GET THIS:

TABLE_QUALIFIER TABLE_OWNER TABLE_NAME COLUMN_NAME KEY_SEQ PK_NAME
Relational_05Q3 dbo tblDRG record_id 1 PK_tblDRG

Hmmmmm. Looks like the IF statement didn't do it's job. Ok fine. I'll just kill it myself:

ALTER TABLE [dbo].[tblDRG] DROP CONSTRAINT PK__tblDRG

AND I GET THIS?!?!?!?!

Server: Msg 3728, Level 16, State 1, Line 1
'PK__tblDRG' is not a constraint.

What am I not getting here? Is it me...I can take If I am a bone head here.

Any help would be appreciated. Thanks!Nevermind...I am a moron.
PK__tblDRG doesn't exists because it's PK_tblDRG!!!

Sorry!

Thursday, March 8, 2012

can't debug SP in VS 2003

I can't debug SP in VS 2003
My config:
* Windows XP Pro
* VS.NET 2003
* SQL Server 2000 SP3a
* Breakpoints are not hit in stored procs either... they become question
marks when I run and the tooltip text says "The breakpoint will not
currently be hit. Unable to bind SQL breakpoint at this time. Object
containing the breakpoint not loaded."
I have followed ALL these instructions :
* I have granted myself EXEC permissions on sp_sdidebug -- GRANT EXEC
on master..sp_sdidebug to [MYDOMAIN\ME]
* I have run -- exec sp_sdidebug 'legacy on'
* Sqlle.dll and sqldbreg2.exe exist on your debugging workstation. The
former library is the SQL language engine for the debugger.
* Sqldbg.dll exists on both the database server and the debugging
work-station. This library is the SQL debugging proxy.
* Mssdi98.dll exists in the \binn subfolder of every SQL Server instance
on the database server.
* If you're running the full version of SQL Server
* My domain account has permission to the master database itself.
* I re- execute sp_sdidebug 'legacy on' every time I reboot SQL Server.
* I turned on SQL debugging for every project in my VS solution -
* Connection pooling is disabled.
Any help?i usually debug sp's using query analyzer. i right click the stored
procedure in the debug manager and chose debug. u can even pass paramaters
to it
"Oleg Bulay" wrote:

> I can't debug SP in VS 2003
> My config:
> * Windows XP Pro
> * VS.NET 2003
> * SQL Server 2000 SP3a
> * Breakpoints are not hit in stored procs either... they become question
> marks when I run and the tooltip text says "The breakpoint will not
> currently be hit. Unable to bind SQL breakpoint at this time. Object
> containing the breakpoint not loaded."
> I have followed ALL these instructions :
> * I have granted myself EXEC permissions on sp_sdidebug -- GRANT EXEC
> on master..sp_sdidebug to [MYDOMAIN\ME]
> * I have run -- exec sp_sdidebug 'legacy on'
> * Sqlle.dll and sqldbreg2.exe exist on your debugging workstation. The
> former library is the SQL language engine for the debugger.
> * Sqldbg.dll exists on both the database server and the debugging
> work-station. This library is the SQL debugging proxy.
> * Mssdi98.dll exists in the \binn subfolder of every SQL Server instance
> on the database server.
> * If you're running the full version of SQL Server
> * My domain account has permission to the master database itself.
> * I re- execute sp_sdidebug 'legacy on' every time I reboot SQL Server.
> * I turned on SQL debugging for every project in my VS solution -
> * Connection pooling is disabled.
> Any help?
>
>|||Check out this article...
http://support.microsoft.com/?kbid=839280
HTH
"Oleg Bulay" wrote:

> I can't debug SP in VS 2003
> My config:
> * Windows XP Pro
> * VS.NET 2003
> * SQL Server 2000 SP3a
> * Breakpoints are not hit in stored procs either... they become question
> marks when I run and the tooltip text says "The breakpoint will not
> currently be hit. Unable to bind SQL breakpoint at this time. Object
> containing the breakpoint not loaded."
> I have followed ALL these instructions :
> * I have granted myself EXEC permissions on sp_sdidebug -- GRANT EXEC
> on master..sp_sdidebug to [MYDOMAIN\ME]
> * I have run -- exec sp_sdidebug 'legacy on'
> * Sqlle.dll and sqldbreg2.exe exist on your debugging workstation. The
> former library is the SQL language engine for the debugger.
> * Sqldbg.dll exists on both the database server and the debugging
> work-station. This library is the SQL debugging proxy.
> * Mssdi98.dll exists in the \binn subfolder of every SQL Server instance
> on the database server.
> * If you're running the full version of SQL Server
> * My domain account has permission to the master database itself.
> * I re- execute sp_sdidebug 'legacy on' every time I reboot SQL Server.
> * I turned on SQL debugging for every project in my VS solution -
> * Connection pooling is disabled.
> Any help?
>
>