Showing posts with label drop. Show all posts
Showing posts with label drop. Show all posts

Tuesday, March 27, 2012

Can't get groups to work

Hi,
1. I have an Access ADP on SQL2000, uaing Windows users and groups..
2. Individual users with granted permissions work OK.
3. However, if I drop the individual users and try to uses the Windows
groups which contain them with same permissions granted, the app cannot make
connection.
4. Have revoked logins, re-added logins, database grants, and permissions,
but to no avail.
Any suggestions on what to look for?
Thanks.
AlanCan you make successfull connections from Query Analyser or OSQL.exe based
upon the group ?
Is the group a local group or domain based group?
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.|||Kevin,
Thanks for your reply.
1. I can't connect with query analyzer, logging on to users's machine with
user's login but only his group login and group database access existing in
SQLServer.
2. User's group is a Universal domain group.
Using SQL@.000.
Useer: WinXP
OS: Win2000Server
DB Machine: Win2000 Server.
Regards,
Alan
"Kevin McDonnell [MSFT]" <kevmc@.online.microsoft.com> wrote in message
news:0WvCdgfxEHA.3640@.cpmsftngxa10.phx.gbl...
> Can you make successfull connections from Query Analyser or OSQL.exe based
> upon the group ?
> Is the group a local group or domain based group?
> Thanks,
> Kevin McDonnell
> Microsoft Corporation
> This posting is provided AS IS with no warranties, and confers no rights.
>
>|||Ah. The problem may be the Universal Group.. There was a fix for this. Try
this update.
825042 FIX: SQL Server Jobs That Are Owned by Non-sysadmin Users May Not
Start
http://support.microsoft.com/?id=825042
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.|||Kevin,
Thanks for your reply.
This sounds like it applies to jobs only, not regular database accesss. Do
you know if it applies to database access as well.
I'd like to avoid hotfixes on client's computers as well, plus I don't know
if they have installed required Win2000 SP4.
Thanks.
Alan
"Kevin McDonnell [MSFT]" <kevmc@.online.microsoft.com> wrote in message
news:7AkfzfpxEHA.768@.cpmsftngxa10.phx.gbl...
> Ah. The problem may be the Universal Group.. There was a fix for this.
Try
> this update.
> 825042 FIX: SQL Server Jobs That Are Owned by Non-sysadmin Users May Not
> Start
> http://support.microsoft.com/?id=825042
>
> Thanks,
> Kevin McDonnell
> Microsoft Corporation
> This posting is provided AS IS with no warranties, and confers no rights.
>
>|||Its' been some time since I did testing, but I don't think we enumerate
Universal Groups only Domain Global Groups.
Try;
xp_logininf groupname
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.|||"Kevin McDonnell [MSFT]" <kevmc@.online.microsoft.com> wrote in message
news:0mIdcZrxEHA.3984@.cpmsftngxa10.phx.gbl...
> Its' been some time since I did testing, but I don't think we enumerate
> Universal Groups only Domain Global Groups.
> Try;
> xp_logininf groupname
Kevin,
Thanks again for your reply.
I've asked net admin to recreate groups as global, not universal.
In meantime, I've put results of xp_logininfo below.
1. xp_login 'GroupAccountName', 'members': properly displays list of members
2. xp_login 'GroupMemberAccountName', 'all': gives NULL RECORD!!
3. If, as a test, I add the GroupMemberAccountName to SQL logins as new
separate login IndividualUserName and do
xp_login 'IndividualUserName', 'all' :
then displays individual user's record, but no additional record for group
path.
CONCLUSION?
--
Does above mean that somewhere no connection is being made in SQLServer
between the group and the individual member?
BOL on xp_logininfo: If account_name is a valid Windows NT account but that
account does not have permission to access SQL Server, an empty result set
is returned.
Thanks very much.
Alan|||I know that Domain Local Groups won't work correctly for jobs and I
couldn't remember the results with Universal Groups.
Another question is , Is SQL Server in the same Domain that the users
groups are defined in?
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.|||Kevin,
It's in a separate domain.
Alan
"Kevin McDonnell [MSFT]" <kevmc@.online.microsoft.com> wrote in message
news:0Jw0SF1xEHA.3984@.cpmsftngxa10.phx.gbl...
> I know that Domain Local Groups won't work correctly for jobs and I
> couldn't remember the results with Universal Groups.
> Another question is , Is SQL Server in the same Domain that the users
> groups are defined in?
> Thanks,
> Kevin McDonnell
> Microsoft Corporation
> This posting is provided AS IS with no warranties, and confers no rights.
>
>

Tuesday, March 20, 2012

can't drop user, owns objects

I migrated copies of a database to a test server, but I cannot log on. My
admin account needs to be dropped and readded but every time I run
sp_dropuser in query analyzer I get the error :
Msg 15183, level 16, state 1, ...
"the user owns objects in the database and cannot be dropped."
then a list of the objects (EG TMP_SYSA_1234) is displayed.
How can I delete these objects? I assume then I will be able to delete the
user and recreate him.
On 20 mar, 19:09, totoro <tot...@.discussions.microsoft.com> wrote:
> I migrated copies of a database to a test server, but I cannot log on. My
> admin account needs to be dropped and readded but every time I run
> sp_dropuser in query analyzer I get the error :
> Msg 15183, level 16, state 1, ...
> "the user owns objects in the database and cannot be dropped."
> then a list of the objects (EG TMP_SYSA_1234) is displayed.
> How can I delete these objects? I assume then I will be able to delete the
> user and recreate him.
Hi,
You're perfectly right... This error means that some objects are still
owned by this user.
In order to drop each object, you will first need to know what kind of
objects are owned by the user you would like to delete. Then, you'll
be able to run the correct drop commands in the query analyser...
As an example, here are some usual drop commands :
DROP TABLE [schema].[Table name]
DROP VIEW [schema].[View name]
DROP PROCEDURE [schema].[Procedure name]
...
Whenever all the objects owned will be dropped, you'll be able to use
the sp_dropuser procedure.
Hope this helps,
Cdric Del Nibbio
MCTS SQL Server 2005
MCSD .NET
MCT
http://cedric-delnibbio-sql.blogspot.com
|||thank you, Cedric
"Cédric Del Nibbio" wrote:

> On 20 mar, 19:09, totoro <tot...@.discussions.microsoft.com> wrote:
> Hi,
> You're perfectly right... This error means that some objects are still
> owned by this user.
> In order to drop each object, you will first need to know what kind of
> objects are owned by the user you would like to delete. Then, you'll
> be able to run the correct drop commands in the query analyser...
> As an example, here are some usual drop commands :
> DROP TABLE [schema].[Table name]
> DROP VIEW [schema].[View name]
> DROP PROCEDURE [schema].[Procedure name]
> ...
> Whenever all the objects owned will be dropped, you'll be able to use
> the sp_dropuser procedure.
> Hope this helps,
> Cédric Del Nibbio
> MCTS SQL Server 2005
> MCSD .NET
> MCT
> http://cedric-delnibbio-sql.blogspot.com
>

can't drop user, owns objects

I migrated copies of a database to a test server, but I cannot log on. My
admin account needs to be dropped and readded but every time I run
sp_dropuser in query analyzer I get the error :
Msg 15183, level 16, state 1, ...
"the user owns objects in the database and cannot be dropped."
then a list of the objects (EG TMP_SYSA_1234) is displayed.
How can I delete these objects? I assume then I will be able to delete the
user and recreate him.On 20 mar, 19:09, totoro <tot...@.discussions.microsoft.com> wrote:
> I migrated copies of a database to a test server, but I cannot log on. My
> admin account needs to be dropped and readded but every time I run
> sp_dropuser in query analyzer I get the error :
> Msg 15183, level 16, state 1, ...
> "the user owns objects in the database and cannot be dropped."
> then a list of the objects (EG TMP_SYSA_1234) is displayed.
> How can I delete these objects? I assume then I will be able to delete the
> user and recreate him.
Hi,
You're perfectly right... This error means that some objects are still
owned by this user.
In order to drop each object, you will first need to know what kind of
objects are owned by the user you would like to delete. Then, you'll
be able to run the correct drop commands in the query analyser...
As an example, here are some usual drop commands :
DROP TABLE [schema].[Table name]
DROP VIEW [schema].[View name]
DROP PROCEDURE [schema].[Procedure name]
.=2E.
Whenever all the objects owned will be dropped, you'll be able to use
the sp_dropuser procedure.
Hope this helps,
C=E9dric Del Nibbio
MCTS SQL Server 2005
MCSD .NET
MCT
http://cedric-delnibbio-sql.blogspot.com|||thank you, Cedric
"Cédric Del Nibbio" wrote:

> On 20 mar, 19:09, totoro <tot...@.discussions.microsoft.com> wrote:
> Hi,
> You're perfectly right... This error means that some objects are still
> owned by this user.
> In order to drop each object, you will first need to know what kind of
> objects are owned by the user you would like to delete. Then, you'll
> be able to run the correct drop commands in the query analyser...
> As an example, here are some usual drop commands :
> DROP TABLE [schema].[Table name]
> DROP VIEW [schema].[View name]
> DROP PROCEDURE [schema].[Procedure name]
> ...
> Whenever all the objects owned will be dropped, you'll be able to use
> the sp_dropuser procedure.
> Hope this helps,
> Cédric Del Nibbio
> MCTS SQL Server 2005
> MCSD .NET
> MCT
> http://cedric-delnibbio-sql.blogspot.com
>sql

Can''t drop trigger assembly

Created an assembly based on this article...

http://sqljunkies.com/Article/4CD01686-5178-490C-A90A-5AEEF5E35915.scuk

Now I want to make changes and redeploy the assembly but when I try to drop I get this.

IF EXISTS (SELECT * FROM sys.assemblies asms WHERE asms.name = N'AuditCommon')

DROP ASSEMBLY [AuditCommon]

Msg 6590, Level 16, State 1, Line 3

DROP ASSEMBLY failed because 'AuditCommon' is referenced by object 'clr_trigger'.

Any ideas?

Figured it out. clr_trigger was a trigger that I created somewhere along the way which was dependent upon the assembly. It didn't appear anywhere in SQL Manager Studio so I thought that it was some sort of system object.|||A late reply,

using show dependencies, list out those need to removed. Remove the listed first and then drop the assembly.

Can't drop trigger assembly

Created an assembly based on this article...

http://sqljunkies.com/Article/4CD01686-5178-490C-A90A-5AEEF5E35915.scuk

Now I want to make changes and redeploy the assembly but when I try to drop I get this.

IF EXISTS (SELECT * FROM sys.assemblies asms WHERE asms.name = N'AuditCommon')

DROP ASSEMBLY [AuditCommon]

Msg 6590, Level 16, State 1, Line 3

DROP ASSEMBLY failed because 'AuditCommon' is referenced by object 'clr_trigger'.

Any ideas?

Figured it out. clr_trigger was a trigger that I created somewhere along the way which was dependent upon the assembly. It didn't appear anywhere in SQL Manager Studio so I thought that it was some sort of system object.|||A late reply,

using show dependencies, list out those need to removed. Remove the listed first and then drop the assembly.

can't drop trigger

Hi,
I just created a tirgger. when I tried to drop it, it say "Cannot drop the
trigger 'trigger_name', because it does not exist in the system catalog." But
it shows when I query as:
SELECT *
FROM sysobjects o INNER JOIN syscomments c
ON o.id = c.id
WHERE o.type = 'TR' and o.name = 'trigger_name'
when I tried to create again, it failed "There is already an object named
'trigger_name' in the database.
what can I do? Thanks
Jen wrote:
> Hi,
> I just created a tirgger. when I tried to drop it, it say "Cannot drop the
> trigger 'trigger_name', because it does not exist in the system catalog." But
> it shows when I query as:
> SELECT *
> FROM sysobjects o INNER JOIN syscomments c
> ON o.id = c.id
> WHERE o.type = 'TR' and o.name = 'trigger_name'
> when I tried to create again, it failed "There is already an object named
> 'trigger_name' in the database.
> what can I do? Thanks
You should always used schema-qualified object names, i.e.
"dbo.MyTriggerName". Sounds like you're dealing with a schema-naming
issue, "dbo.MyTriggerName" vs. "userA.MyTriggerName".
Tracy McKibben
MCDBA
http://www.realsqlguy.com
|||I used "create trigger dbo.trigger_name on userA.table_name..."
I tried to user "sp_helptrigger userA.table_name" it says "Incorrect syntax
near '.'"
How can I drop the trigger? How can I view the trigger? Thanks
"Tracy McKibben" wrote:

> Jen wrote:
> You should always used schema-qualified object names, i.e.
> "dbo.MyTriggerName". Sounds like you're dealing with a schema-naming
> issue, "dbo.MyTriggerName" vs. "userA.MyTriggerName".
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com
>
|||is it in SQL 2000 or 2005
try specifying someting like
Drop Trigger <TriggerName>
ON <Database or ALL Server>
Maninder
MCDBA
On Jan 30, 1:54 pm, Tracy McKibben <t...@.realsqlguy.com> wrote:
> Jen wrote:
>
>
> You should always used schema-qualified object names, i.e.
> "dbo.MyTriggerName". Sounds like you're dealing with a schema-naming
> issue, "dbo.MyTriggerName" vs. "userA.MyTriggerName".
> --
> Tracy McKibben
> MCDBAhttp://www.realsqlguy.com- Hide quoted text -
> - Show quoted text -
|||It's sql2000. I got "Incorrect syntax near the keyword 'on'".
"Maninder" wrote:

> is it in SQL 2000 or 2005
> try specifying someting like
> Drop Trigger <TriggerName>
> ON <Database or ALL Server>
> Maninder
> MCDBA
> On Jan 30, 1:54 pm, Tracy McKibben <t...@.realsqlguy.com> wrote:
>
>
|||Jen wrote:
> I used "create trigger dbo.trigger_name on userA.table_name..."
> I tried to user "sp_helptrigger userA.table_name" it says "Incorrect syntax
> near '.'"
>
sp_helptrigger 'userA.table_name'
Tracy McKibben
MCDBA
http://www.realsqlguy.com
|||As Tracy suggestd, try using the Object owner in the drop statement.
Or if you are db_owner or a sa you can drop the Trigger with the
Schemaname.Triggername
Maninder
MCDBA
On Jan 30, 2:23 pm, Jen <J...@.discussions.microsoft.com> wrote:
> It's sql2000. I got "Incorrect syntax near the keyword 'on'".
>
> "Maninder" wrote:
>
>
>
>
> - Show quoted text -
|||Thanks. I droped it. Even though I specify "dbo.trigger_name" in create
trigger, but the trigger's owner is "userA" by checking sysobjects table. Is
it strange?
Thanks
"Maninder" wrote:

> As Tracy suggestd, try using the Object owner in the drop statement.
> Or if you are db_owner or a sa you can drop the Trigger with the
> Schemaname.Triggername
> Maninder
> MCDBA
>
> On Jan 30, 2:23 pm, Jen <J...@.discussions.microsoft.com> wrote:
>
>
|||We had the same Problem with the windows user accounts.
I had a Workaround for this problem.
I Created a Trigger on the Database for Events we need to capture like
Create_table,Create_procedure
So,every time a user creates a object this trigger Fires and renames
the schema to dbo for the object.
or Use ALTER SCHEMA for single use.
Maninder
MCDBA

can't drop trigger

Hi,
I just created a tirgger. when I tried to drop it, it say "Cannot drop the
trigger 'trigger_name', because it does not exist in the system catalog." Bu
t
it shows when I query as:
SELECT *
FROM sysobjects o INNER JOIN syscomments c
ON o.id = c.id
WHERE o.type = 'TR' and o.name = 'trigger_name'
when I tried to create again, it failed "There is already an object named
'trigger_name' in the database.
what can I do? ThanksJen wrote:
> Hi,
> I just created a tirgger. when I tried to drop it, it say "Cannot drop th
e
> trigger 'trigger_name', because it does not exist in the system catalog."
But
> it shows when I query as:
> SELECT *
> FROM sysobjects o INNER JOIN syscomments c
> ON o.id = c.id
> WHERE o.type = 'TR' and o.name = 'trigger_name'
> when I tried to create again, it failed "There is already an object named
> 'trigger_name' in the database.
> what can I do? Thanks
You should always used schema-qualified object names, i.e.
"dbo.MyTriggerName". Sounds like you're dealing with a schema-naming
issue, "dbo.MyTriggerName" vs. "userA.MyTriggerName".
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||I used "create trigger dbo.trigger_name on userA.table_name..."
I tried to user "sp_helptrigger userA.table_name" it says "Incorrect syntax
near '.'"
How can I drop the trigger? How can I view the trigger? Thanks
"Tracy McKibben" wrote:

> Jen wrote:
> You should always used schema-qualified object names, i.e.
> "dbo.MyTriggerName". Sounds like you're dealing with a schema-naming
> issue, "dbo.MyTriggerName" vs. "userA.MyTriggerName".
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com
>|||is it in SQL 2000 or 2005
try specifying someting like
Drop Trigger <TriggerName>
ON <Database or ALL Server>
Maninder
MCDBA
On Jan 30, 1:54 pm, Tracy McKibben <t...@.realsqlguy.com> wrote:
> Jen wrote:
>
>
>
>
> You should always used schema-qualified object names, i.e.
> "dbo.MyTriggerName". Sounds like you're dealing with a schema-naming
> issue, "dbo.MyTriggerName" vs. "userA.MyTriggerName".
> --
> Tracy McKibben
> MCDBAhttp://www.realsqlguy.com- Hide quoted text -
> - Show quoted text -|||It's sql2000. I got "Incorrect syntax near the keyword 'on'".
"Maninder" wrote:

> is it in SQL 2000 or 2005
> try specifying someting like
> Drop Trigger <TriggerName>
> ON <Database or ALL Server>
> Maninder
> MCDBA
> On Jan 30, 1:54 pm, Tracy McKibben <t...@.realsqlguy.com> wrote:
>
>|||Jen wrote:
> I used "create trigger dbo.trigger_name on userA.table_name..."
> I tried to user "sp_helptrigger userA.table_name" it says "Incorrect synta
x
> near '.'"
>
sp_helptrigger 'userA.table_name'
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||As Tracy suggestd, try using the Object owner in the drop statement.
Or if you are db_owner or a sa you can drop the Trigger with the
Schemaname.Triggername
Maninder
MCDBA
On Jan 30, 2:23 pm, Jen <J...@.discussions.microsoft.com> wrote:
> It's sql2000. I got "Incorrect syntax near the keyword 'on'".
>
> "Maninder" wrote:
>
>
>
>
>
>
>
>
> - Show quoted text -|||Thanks. I droped it. Even though I specify "dbo.trigger_name" in create
trigger, but the trigger's owner is "userA" by checking sysobjects table. Is
it strange?
Thanks
"Maninder" wrote:

> As Tracy suggestd, try using the Object owner in the drop statement.
> Or if you are db_owner or a sa you can drop the Trigger with the
> Schemaname.Triggername
> Maninder
> MCDBA
>
> On Jan 30, 2:23 pm, Jen <J...@.discussions.microsoft.com> wrote:
>
>|||> Even though I specify "dbo.trigger_name" in create
> trigger, but the trigger's owner is "userA" by checking sysobjects table.
Is
> it strange?
Yes, that is strange. If you can provide a repro, we can submit a bug report
. If you create an
object, specifying dbo, then that object will be owned by dbo, or you would
get an error (if you
don't have permissions to do so). Unless you do something like:
CREATE TRIGGER [dbo.mytrigger]
CREATE TRIGGER "dbo.mytrigger"
Now the name of the trigger will be "dbo.mytrigger" and the owner would be w
hoever created the
trigger.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Jen" <Jen@.discussions.microsoft.com> wrote in message
news:CD8044B8-FD3D-4759-8437-EB974F1E0017@.microsoft.com...[vbcol=seagreen]
> Thanks. I droped it. Even though I specify "dbo.trigger_name" in create
> trigger, but the trigger's owner is "userA" by checking sysobjects table.
Is
> it strange?
> Thanks
> "Maninder" wrote:
>|||We had the same Problem with the windows user accounts.
I had a Workaround for this problem.
I Created a Trigger on the Database for Events we need to capture like
Create_table,Create_procedure
So,every time a user creates a object this trigger Fires and renames
the schema to dbo for the object.
or Use ALTER SCHEMA for single use.
Maninder
MCDBA

can't drop trigger

Hi,
I just created a tirgger. when I tried to drop it, it say "Cannot drop the
trigger 'trigger_name', because it does not exist in the system catalog." But
it shows when I query as:
SELECT *
FROM sysobjects o INNER JOIN syscomments c
ON o.id = c.id
WHERE o.type = 'TR' and o.name = 'trigger_name'
when I tried to create again, it failed "There is already an object named
'trigger_name' in the database.
what can I do? ThanksJen wrote:
> Hi,
> I just created a tirgger. when I tried to drop it, it say "Cannot drop the
> trigger 'trigger_name', because it does not exist in the system catalog." But
> it shows when I query as:
> SELECT *
> FROM sysobjects o INNER JOIN syscomments c
> ON o.id = c.id
> WHERE o.type = 'TR' and o.name = 'trigger_name'
> when I tried to create again, it failed "There is already an object named
> 'trigger_name' in the database.
> what can I do? Thanks
You should always used schema-qualified object names, i.e.
"dbo.MyTriggerName". Sounds like you're dealing with a schema-naming
issue, "dbo.MyTriggerName" vs. "userA.MyTriggerName".
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||I used "create trigger dbo.trigger_name on userA.table_name..."
I tried to user "sp_helptrigger userA.table_name" it says "Incorrect syntax
near '.'"
How can I drop the trigger? How can I view the trigger? Thanks
"Tracy McKibben" wrote:
> Jen wrote:
> > Hi,
> >
> > I just created a tirgger. when I tried to drop it, it say "Cannot drop the
> > trigger 'trigger_name', because it does not exist in the system catalog." But
> > it shows when I query as:
> >
> > SELECT *
> > FROM sysobjects o INNER JOIN syscomments c
> > ON o.id = c.id
> > WHERE o.type = 'TR' and o.name = 'trigger_name'
> >
> > when I tried to create again, it failed "There is already an object named
> > 'trigger_name' in the database.
> >
> > what can I do? Thanks
> You should always used schema-qualified object names, i.e.
> "dbo.MyTriggerName". Sounds like you're dealing with a schema-naming
> issue, "dbo.MyTriggerName" vs. "userA.MyTriggerName".
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com
>|||is it in SQL 2000 or 2005
try specifying someting like
Drop Trigger <TriggerName>
ON <Database or ALL Server>
Maninder
MCDBA
On Jan 30, 1:54 pm, Tracy McKibben <t...@.realsqlguy.com> wrote:
> Jen wrote:
> > Hi,
> > I just created a tirgger. when I tried to drop it, it say "Cannot drop the
> > trigger 'trigger_name', because it does not exist in the system catalog." But
> > it shows when I query as:
> > SELECT *
> > FROM sysobjects o INNER JOIN syscomments c
> > ON o.id = c.id
> > WHERE o.type = 'TR' and o.name = 'trigger_name'
> > when I tried to create again, it failed "There is already an object named
> > 'trigger_name' in the database.
> > what can I do? Thanks
> You should always used schema-qualified object names, i.e.
> "dbo.MyTriggerName". Sounds like you're dealing with a schema-naming
> issue, "dbo.MyTriggerName" vs. "userA.MyTriggerName".
> --
> Tracy McKibben
> MCDBAhttp://www.realsqlguy.com- Hide quoted text -
> - Show quoted text -|||It's sql2000. I got "Incorrect syntax near the keyword 'on'".
"Maninder" wrote:
> is it in SQL 2000 or 2005
> try specifying someting like
> Drop Trigger <TriggerName>
> ON <Database or ALL Server>
> Maninder
> MCDBA
> On Jan 30, 1:54 pm, Tracy McKibben <t...@.realsqlguy.com> wrote:
> > Jen wrote:
> > > Hi,
> >
> > > I just created a tirgger. when I tried to drop it, it say "Cannot drop the
> > > trigger 'trigger_name', because it does not exist in the system catalog." But
> > > it shows when I query as:
> >
> > > SELECT *
> > > FROM sysobjects o INNER JOIN syscomments c
> > > ON o.id = c.id
> > > WHERE o.type = 'TR' and o.name = 'trigger_name'
> >
> > > when I tried to create again, it failed "There is already an object named
> > > 'trigger_name' in the database.
> >
> > > what can I do? Thanks
> >
> > You should always used schema-qualified object names, i.e.
> > "dbo.MyTriggerName". Sounds like you're dealing with a schema-naming
> > issue, "dbo.MyTriggerName" vs. "userA.MyTriggerName".
> >
> > --
> > Tracy McKibben
> > MCDBAhttp://www.realsqlguy.com- Hide quoted text -
> >
> > - Show quoted text -
>
>|||Jen wrote:
> I used "create trigger dbo.trigger_name on userA.table_name..."
> I tried to user "sp_helptrigger userA.table_name" it says "Incorrect syntax
> near '.'"
>
sp_helptrigger 'userA.table_name'
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||As Tracy suggestd, try using the Object owner in the drop statement.
Or if you are db_owner or a sa you can drop the Trigger with the
Schemaname.Triggername
Maninder
MCDBA
On Jan 30, 2:23 pm, Jen <J...@.discussions.microsoft.com> wrote:
> It's sql2000. I got "Incorrect syntax near the keyword 'on'".
>
> "Maninder" wrote:
> > is it in SQL 2000 or 2005
> > try specifying someting like
> > Drop Trigger <TriggerName>
> > ON <Database or ALL Server>
> > Maninder
> > MCDBA
> > On Jan 30, 1:54 pm, Tracy McKibben <t...@.realsqlguy.com> wrote:
> > > Jen wrote:
> > > > Hi,
> > > > I just created a tirgger. when I tried to drop it, it say "Cannot drop the
> > > > trigger 'trigger_name', because it does not exist in the system catalog." But
> > > > it shows when I query as:
> > > > SELECT *
> > > > FROM sysobjects o INNER JOIN syscomments c
> > > > ON o.id = c.id
> > > > WHERE o.type = 'TR' and o.name = 'trigger_name'
> > > > when I tried to create again, it failed "There is already an object named
> > > > 'trigger_name' in the database.
> > > > what can I do? Thanks
> > > You should always used schema-qualified object names, i.e.
> > > "dbo.MyTriggerName". Sounds like you're dealing with a schema-naming
> > > issue, "dbo.MyTriggerName" vs. "userA.MyTriggerName".
> > > --
> > > Tracy McKibben
> > > MCDBAhttp://www.realsqlguy.com-Hide quoted text -
> > > - Show quoted text -- Hide quoted text -
> - Show quoted text -|||Thanks. I droped it. Even though I specify "dbo.trigger_name" in create
trigger, but the trigger's owner is "userA" by checking sysobjects table. Is
it strange?
Thanks
"Maninder" wrote:
> As Tracy suggestd, try using the Object owner in the drop statement.
> Or if you are db_owner or a sa you can drop the Trigger with the
> Schemaname.Triggername
> Maninder
> MCDBA
>
> On Jan 30, 2:23 pm, Jen <J...@.discussions.microsoft.com> wrote:
> > It's sql2000. I got "Incorrect syntax near the keyword 'on'".
> >
> >
> >
> > "Maninder" wrote:
> > > is it in SQL 2000 or 2005
> > > try specifying someting like
> > > Drop Trigger <TriggerName>
> > > ON <Database or ALL Server>
> >
> > > Maninder
> > > MCDBA
> > > On Jan 30, 1:54 pm, Tracy McKibben <t...@.realsqlguy.com> wrote:
> > > > Jen wrote:
> > > > > Hi,
> >
> > > > > I just created a tirgger. when I tried to drop it, it say "Cannot drop the
> > > > > trigger 'trigger_name', because it does not exist in the system catalog." But
> > > > > it shows when I query as:
> >
> > > > > SELECT *
> > > > > FROM sysobjects o INNER JOIN syscomments c
> > > > > ON o.id = c.id
> > > > > WHERE o.type = 'TR' and o.name = 'trigger_name'
> >
> > > > > when I tried to create again, it failed "There is already an object named
> > > > > 'trigger_name' in the database.
> >
> > > > > what can I do? Thanks
> >
> > > > You should always used schema-qualified object names, i.e.
> > > > "dbo.MyTriggerName". Sounds like you're dealing with a schema-naming
> > > > issue, "dbo.MyTriggerName" vs. "userA.MyTriggerName".
> >
> > > > --
> > > > Tracy McKibben
> > > > MCDBAhttp://www.realsqlguy.com-Hide quoted text -
> >
> > > > - Show quoted text -- Hide quoted text -
> >
> > - Show quoted text -
>
>|||> Even though I specify "dbo.trigger_name" in create
> trigger, but the trigger's owner is "userA" by checking sysobjects table. Is
> it strange?
Yes, that is strange. If you can provide a repro, we can submit a bug report. If you create an
object, specifying dbo, then that object will be owned by dbo, or you would get an error (if you
don't have permissions to do so). Unless you do something like:
CREATE TRIGGER [dbo.mytrigger]
CREATE TRIGGER "dbo.mytrigger"
Now the name of the trigger will be "dbo.mytrigger" and the owner would be whoever created the
trigger.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Jen" <Jen@.discussions.microsoft.com> wrote in message
news:CD8044B8-FD3D-4759-8437-EB974F1E0017@.microsoft.com...
> Thanks. I droped it. Even though I specify "dbo.trigger_name" in create
> trigger, but the trigger's owner is "userA" by checking sysobjects table. Is
> it strange?
> Thanks
> "Maninder" wrote:
>> As Tracy suggestd, try using the Object owner in the drop statement.
>> Or if you are db_owner or a sa you can drop the Trigger with the
>> Schemaname.Triggername
>> Maninder
>> MCDBA
>>
>> On Jan 30, 2:23 pm, Jen <J...@.discussions.microsoft.com> wrote:
>> > It's sql2000. I got "Incorrect syntax near the keyword 'on'".
>> >
>> >
>> >
>> > "Maninder" wrote:
>> > > is it in SQL 2000 or 2005
>> > > try specifying someting like
>> > > Drop Trigger <TriggerName>
>> > > ON <Database or ALL Server>
>> >
>> > > Maninder
>> > > MCDBA
>> > > On Jan 30, 1:54 pm, Tracy McKibben <t...@.realsqlguy.com> wrote:
>> > > > Jen wrote:
>> > > > > Hi,
>> >
>> > > > > I just created a tirgger. when I tried to drop it, it say "Cannot drop the
>> > > > > trigger 'trigger_name', because it does not exist in the system catalog." But
>> > > > > it shows when I query as:
>> >
>> > > > > SELECT *
>> > > > > FROM sysobjects o INNER JOIN syscomments c
>> > > > > ON o.id = c.id
>> > > > > WHERE o.type = 'TR' and o.name = 'trigger_name'
>> >
>> > > > > when I tried to create again, it failed "There is already an object named
>> > > > > 'trigger_name' in the database.
>> >
>> > > > > what can I do? Thanks
>> >
>> > > > You should always used schema-qualified object names, i.e.
>> > > > "dbo.MyTriggerName". Sounds like you're dealing with a schema-naming
>> > > > issue, "dbo.MyTriggerName" vs. "userA.MyTriggerName".
>> >
>> > > > --
>> > > > Tracy McKibben
>> > > > MCDBAhttp://www.realsqlguy.com-Hide quoted text -
>> >
>> > > > - Show quoted text -- Hide quoted text -
>> >
>> > - Show quoted text -
>>|||We had the same Problem with the windows user accounts.
I had a Workaround for this problem.
I Created a Trigger on the Database for Events we need to capture like
Create_table,Create_procedure
So,every time a user creates a object this trigger Fires and renames
the schema to dbo for the object.
or Use ALTER SCHEMA for single use.
Maninder
MCDBAsql

Can't Drop table in Replication

Dear friends

I restore one database in two database servers which is running on SQL server 2000.I replicated these two through snapshot relication.Snapshot agent is creating snapshot.But when I am starting to synchronize it's telling can't drop table because that table is in replication. Backup I taken from a replicated database.so it's having rowguid both the servers.Another thing the table which it is telling not able to drop it's having primary key.please tell me what may be the problem.In replication why it is going to drop table it's only what to transport data na

Filson

The database that's restored at the subscriber probably still has replication bits set. You can clean up replication at the subscriber database by calling proc sp_removedbreplication.|||

Greg Y wrote:

The database that's restored at the subscriber probably still has replication bits set. You can clean up replication at the subscriber database by calling proc sp_removedbreplication.

I done like that.But I got a problem .I am using backup from replicated database .This backup only i restored on my publisher & subscriber.When I am subscribing three system stored procedure should be generate na for Del,Ins.Upd operations .This is not happening.I tried to delete this system generated procedures in the restored database .But it's not allowing.Then I applied replication Pubs database which is coming along with SQL Server .Then what I seen I published all Tables(10).But Stored procedure only for 5 tables is generated .in these tables whatever changes i am making it's affecting through Replication,Example publisher table in pubs database is not getting any stored procedure after subscription.So it's not getting any change through replication.Then I am getting error message'procedure Sp_MsIns_Publisher not found'.So please tell me what to do remove all old Stored procedures for replication in restored database and how to create the stored procedures for all the tables published

Thanks in Advance

Filson

|||

You need to restore the database at the subscriber and remove all replication components. When using the wizard to set up the subscription, specify the option that the subscriber has the data. if you're doing it via TSQL, then specify 'nosync' for paramter @.sync_type in sp_addsubscription. After the first sync, you can then run sp_scriptpublicationcustomprocs at the subscriber to create the necessary procs for the distribution agent.

|||

Greg Y wrote:

You need to restore the database at the subscriber and remove all replication components. When using the wizard to set up the subscription, specify the option that the subscriber has the data. if you're doing it via TSQL, then specify 'nosync' for paramter @.sync_type in sp_addsubscription. After the first sync, you can then run sp_scriptpublicationcustomprocs at the subscriber to create the necessary procs for the distribution agent.

Greg thanks for suggestion.Previously itself I tried these ways to remove replication components.But still System stored procedures for table Ins,Del,Upd is not dropping.I want a specific way to drop it out.I think i mentioned this in earlier post.So kindly suggest me a better way for that

Filson

|||Sorry, it's not clear to me what the problem is. Are you trying to drop or create the sp_MSins/upd/del stored procedures? And where - at the publisher or subscriber? I'm not too familiar with SQL 2000, maybe you have to manually delete these stored procedures.|||

Greg Y wrote:

Sorry, it's not clear to me what the problem is. Are you trying to drop or create the sp_MSins/upd/del stored procedures? And where - at the publisher or subscriber? I'm not too familiar with SQL 2000, maybe you have to manually delete these stored procedures.

I am describing my problem below .I taken a backup of replicated database.That I restored on another server.I made that one as a publisher.Another instance I made as a subscriber.I restored same database on this subscriber.Then I tried for transactional replication.While synchronizing I got error on my subscriber 'Sp_MsIns_AgentCode is not found'.This I got while Inserting records to AgentCode Table in publisher.Then I come to know for each table article published in Transactional replication will have three system generated stored procedures 1)insertion 2)updation 3)Deletion.This is not generating when i subscribing to my publisher..Here when I am pulling the subscription I am specifying 'No Shema & data transfer'.So I am not able to transport this System generated Procedures.If I am selecting 'Schema & data Tansfer'.It won't able to initialize in subscriber due to Foreign Key criterias. after completing Subscription through Wizard,Can I trnsfer UPD,INS,DEL Procedure Schema through any Sp_procedure call? Give me some better way

Filson

|||

I mentioned above to run stored procedure sp_scriptpublicationcustomprocs at the subscriber database after applying the snapshot, did you do that? That proc is supposed to generate the missing sp_MSins/upd/del procs that the distribution agent is trying to execute.

Can't drop subscription

Either through EM or using sp_dropsubscription. Whole system locks up. I've
even tried to drop it on a per article basis. First few table/articles went
fine, but when went to drop an article for a very large table, whole system
locked up again.
--Thanks,
Kristy
try sp_dropsubscription from QA. You might want to stop your distribution,
merge, log reader agents to be able to do this. Then start them up one by
one.
How many subscribers do you have? are they push or pull? Are you running
them continuously or staggering them. If you have a large number >50 (or
perhaps even >20) use pull, and stagger your schedules, perhaps every 7 or
11 minutes.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Kristy" <pleasereplyby@.posting.com> wrote in message
news:uAVjjbIMFHA.3832@.TK2MSFTNGP12.phx.gbl...
> Either through EM or using sp_dropsubscription. Whole system locks up.
I've
> even tried to drop it on a per article basis. First few table/articles
went
> fine, but when went to drop an article for a very large table, whole
system
> locked up again.
> --Thanks,
> Kristy
>
|||I have run the sp_dropsubscriptions from QA and it locks up. I have also run
it from QA and have been trying to select on a pure article basis. The first
15 articles went fine, but the 16th locked everything up again. This
particular table is massive, so I didn't know if this had anything to do
with it.
We have 1 publisher and 1 subscriber. distributor is currently on publisher.
THe subscriber is really just a hot backup for the publisher since we don't
have clustering. If something were to happen to pub and we couldn't bring
back up then we would switch to sub.
It is currently a push subscription, but we will be using the pull with a
new subscription. the immediate_sync is 1 (which I think means immediate)
and sync_method = 3 (which I have no idea what that means.) The agents have
not been running for 2 days as we are dropping this subscription and
starting over with a remote distributor and pull subscription. I have even
backed up the distribution database, truncated the ms_repltransactions and
ms_replcommands tables and then shrink the distribution database files.
Previously the dist db had grown to about 60 GB with the combined file size.
Now its about 4 MBs.
I have searched all over online and through the repl book and can't find
anything. I don't know what else to do!!!!
Many thanks for your help,
Kristy
we are using tran repl and I have stopped the agents 2 days ago.
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:%232YjarIMFHA.3080@.TK2MSFTNGP10.phx.gbl...
> try sp_dropsubscription from QA. You might want to stop your distribution,
> merge, log reader agents to be able to do this. Then start them up one by
> one.
> How many subscribers do you have? are they push or pull? Are you running
> them continuously or staggering them. If you have a large number >50 (or
> perhaps even >20) use pull, and stagger your schedules, perhaps every 7 or
> 11 minutes.
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
> "Kristy" <pleasereplyby@.posting.com> wrote in message
> news:uAVjjbIMFHA.3832@.TK2MSFTNGP12.phx.gbl...
> I've
> went
> system
>
|||I figured it out. The previous DBA had a job that put an UPDLOCK, HOLDLOCK
on the table I was trying to drop from replication. I can probably do a drop
all now instead of a per article basis.
--K
"Kristy" <pleasereplyby@.posting.com> wrote in message
news:%23a98n9IMFHA.3988@.tk2msftngp13.phx.gbl...
> I have run the sp_dropsubscriptions from QA and it locks up. I have also
run
> it from QA and have been trying to select on a pure article basis. The
first
> 15 articles went fine, but the 16th locked everything up again. This
> particular table is massive, so I didn't know if this had anything to do
> with it.
> We have 1 publisher and 1 subscriber. distributor is currently on
publisher.
> THe subscriber is really just a hot backup for the publisher since we
don't
> have clustering. If something were to happen to pub and we couldn't bring
> back up then we would switch to sub.
> It is currently a push subscription, but we will be using the pull with a
> new subscription. the immediate_sync is 1 (which I think means immediate)
> and sync_method = 3 (which I have no idea what that means.) The agents
have
> not been running for 2 days as we are dropping this subscription and
> starting over with a remote distributor and pull subscription. I have even
> backed up the distribution database, truncated the ms_repltransactions and
> ms_replcommands tables and then shrink the distribution database files.
> Previously the dist db had grown to about 60 GB with the combined file
size.[vbcol=seagreen]
> Now its about 4 MBs.
> I have searched all over online and through the repl book and can't find
> anything. I don't know what else to do!!!!
> Many thanks for your help,
> Kristy
> we are using tran repl and I have stopped the agents 2 days ago.
> "Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
> news:%232YjarIMFHA.3080@.TK2MSFTNGP10.phx.gbl...
distribution,[vbcol=seagreen]
by[vbcol=seagreen]
or
>

Can't drop SQL Mobile subscription at Publisher

I have a program running on Pocket PCs that synchronizes with a desktop SQL database using SQL Mobile. My problem is that I can't delete old subscriptions from the publication; now the publication has 25 subscriptions and won't accept any more (limit of SQL Workgroup edition). I can delete non-SQL Mobile subcriptions just fine.

Running sp_replmonitorhelpsubscription provides this information:

subscriber: LVCONTACTSMERGE - 5FA305234F0C
subscriber_db: Program Files\PocketLVContacts\LVContacts.sdf
publisher_db: LVContacts
publication: LVContactsMerge

So I set up this bit of code:

USE LVContacts
EXEC sp_dropmergesubscription
@.publication = 'LVContactsMerge',
@.subscriber = 'LVCONTACTSMERGE - 5FA305234F0C',
@.subscriber_db = 'Program Files\PocketLVContacts\LVContacts.sdf',
@.subscription_type='all';
GO

No errors are reported, but the subscription doesn't get deleted.

I've tried shutting down SQL Server Agent (mentioned in another thread); makes no difference.

Any ideas?

--Evan

If you query sysmergesubscriptions, do you get the same values returned as|||

If you query sysmergesubscriptions, do you get the same values returned as sp_replmonitorhelpsubscription? I'm just wondering if the subscriber_db name returned is correct or not.

|||

Yes, both sysmergesubscriptions and sp_replmonitorhelpsubscription give the same subscriber_db name. Note that the name returned, i.e. 'Program Files\PocketLVContacts\LVContactsData.sdf', is the path on the mobile device.

I wonder if it is safe to manually delete a row from sysmergesubscriptions. It seems to work, but no Distributor clean-up is done.

|||

I've found where I was going wrong. The code I cited in my original post DOES work, but to see the changes you must use sysmergesubscriptions, NOT sp_replmonitorhelpsubscription. The latter apparently reflects the distribution database, which is not cleaned up when you use sp_dropmergesubscription.

When you use SQL Server Management Studio to delete a subscription on a mobile device running SQL Mobile, the subscription on the Publisher is NOT also deleted; you must do it manually (or wait until the subscription expires). But it is difficult to determine which subscription on the Publisher corresponds to the one you want to delete on the mobile Subscriber. What I did was first query the mobile Subscriber system table __sysMergeSubscriptions, note the SubscriptionID field, then query the sysmergesubscriptions on the Publisher database, and find the row with a SubID that matches. Then you can run sp_dropmergesubscription using the subscriber_server field as @.subscriber and the db_name field as @.subscriber_db.

cant drop rowguid or msrepl_tran_version

sql2k sp3
Ive got these columns on a previously replicated table and
I cant get rid of them. I went so far as to disable
Publisheing from the box and still no luck. I also removed
the default values and the indexes from them. I also tried
sp_repldropcolumn. Any ideas?
TIA, ChrisR
Chris,
there is a stored procedure to do this called sp_MSunmarkreplinfo which
takes a tablename as a parameter. Alternatively, setting replinfo to 0 in
sysobjects for the particular table should do it. Finally, running
sp_removedbreplication can be used to remove all traces of replication in
the subscriber database, but obviously must only be done if this database is
not also configured as a publisher.
HTH,
Paul Ibison
|||I appreciate the help. I had already run the
sp_MSunmarkreplinfo. I have dropped the Subscription db's.
And I ran sp_removedbreplication on the Publisher. I still
cant drop them. Any other ideas?

>--Original Message--
>Chris,
>there is a stored procedure to do this called
sp_MSunmarkreplinfo which
>takes a tablename as a parameter. Alternatively, setting
replinfo to 0 in
>sysobjects for the particular table should do it.
Finally, running
>sp_removedbreplication can be used to remove all traces
of replication in
>the subscriber database, but obviously must only be done
if this database is
>not also configured as a publisher.
>HTH,
>Paul Ibison
>
>.
>

Can't drop procedure ... Snapshot won't run... Help!

Hi,
I have a server set up for Merge replication. It is the publisher and the
distributer. Has been working fine.
It has two publications.
I wanted the subscribers to get a new copy of the data next time they
replicate, so I went to the first publication, which is stored procs and
view, went to Status tab of the publication properties, and clicked the run
agent now. When it was done, I right clicked on the publication and selected
reinitialize subscriptions.
Then I went to the publication for tables. Right clicked and selected
Re-initialize subscritions. Then I went to the status tab and selected run
agent now. When it came back with a timestamp, red x's appeared on the
replication monitor on the snap shot agents.
The error message it give is :
Cannot drop the procedure 'dbo.sp_sel_B4AC8FE9123F47EDB952DCE5249B4F84_pal'
because it is being used for replication.
As a last resort, I tried to delete the publication, I was going to re do
it. When I try to delete it
it gives me the same error message as above, but with a different sp_sel_
name.
What should I do, or what did I do. I really need it back to working today.
.. .
Any help,
Thanks,
Steve
Well, here is what I did.
I kept trying to delete the publication that I could not get the snapshot
agent to run on, and kept getting the error above. So I delete the stored
proc publication, it went OK. Then I deleted the table publication, and this
time it let me. Then I went to each of the clients, deleted both
subscriptions, and re-created them. Ran fine then, and am able to do manual
pull replications from the subscriber boxes now.
If any one can help me understand what happened, please do. How did I get
in that mess, and what would have been a good way to get out. I was lucky
that I could get to all subscriber boxes and re-create the subscriptions.
Thanks,
Steve
"SteveInBeloit" wrote:

> Hi,
> I have a server set up for Merge replication. It is the publisher and the
> distributer. Has been working fine.
> It has two publications.
> I wanted the subscribers to get a new copy of the data next time they
> replicate, so I went to the first publication, which is stored procs and
> view, went to Status tab of the publication properties, and clicked the run
> agent now. When it was done, I right clicked on the publication and selected
> reinitialize subscriptions.
> Then I went to the publication for tables. Right clicked and selected
> Re-initialize subscritions. Then I went to the status tab and selected run
> agent now. When it came back with a timestamp, red x's appeared on the
> replication monitor on the snap shot agents.
> The error message it give is :
> Cannot drop the procedure 'dbo.sp_sel_B4AC8FE9123F47EDB952DCE5249B4F84_pal'
> because it is being used for replication.
> As a last resort, I tried to delete the publication, I was going to re do
> it. When I try to delete it
> it gives me the same error message as above, but with a different sp_sel_
> name.
> What should I do, or what did I do. I really need it back to working today.
> . .
> Any help,
> Thanks,
> Steve
>
sql

can't drop login

can't drop login

icrosoft SQL Server, Error: 15141

The server principal owns an event notification and cannot be dropped.

notification services do not show anything, where else could it be ?

Did you opened up the Service Broker node in the database node ? There might be a Queue open for that principal that you want to delete.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de
|||

Have you checked sys.server_event_notifications? Is there any notification there owned by the login?

Queues are owned by database principals, so this error is not caused by the presence of a queue.

Thanks
Laurentiu

|||

thanks a lot

sys.server_event_notifications showed a row related to user.

I droped notification and and was able to drop login

can't drop login

can't drop login

icrosoft SQL Server, Error: 15141

The server principal owns an event notification and cannot be dropped.

notification services do not show anything, where else could it be ?

Did you opened up the Service Broker node in the database node ? There might be a Queue open for that principal that you want to delete.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de|||

Have you checked sys.server_event_notifications? Is there any notification there owned by the login?

Queues are owned by database principals, so this error is not caused by the presence of a queue.

Thanks
Laurentiu

|||

thanks a lot

sys.server_event_notifications showed a row related to user.

I droped notification and and was able to drop login

CANT DROP DATABASE

ok I got a database I cant drop because it says its connected with
replication ... I have checked replication and replication monitor there is
nothing there replicated to the database I want to delete. Where else can I
find replication info so that I know why it wont let me delete the database/Edgar,
Try
sp_removedbreplication 'databasename'
It may be true that the replication is removed properly but may be the
sequence seems to be wrong.Try deleting the subscriptions first, followed by
the publications.
--
Dinesh.
SQL Server FAQ at
http://www.tkdinesh.com
"Edgar Engibarian" <edgar@.bellcpa.com> wrote in message
news:O2Xo51xSDHA.2152@.TK2MSFTNGP12.phx.gbl...
> ok I got a database I cant drop because it says its connected with
> replication ... I have checked replication and replication monitor there
is
> nothing there replicated to the database I want to delete. Where else can
I
> find replication info so that I know why it wont let me delete the
database/
>

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!

Can't drop constraint

Hello,
I am using SS7.
I have a table with a column "yn_LockOut" with a default set to 0. I tried
to delete the column and got the following:
'tblGuidelineResponseOwner' table
- Error modifying column properties for 'yn_LockOut'.
ODBC error: [Microsoft][ODBC SQL Server Driver][SQL
Server]'DF_tblGuideLineResponse_yn_LockOut' is not a constraint.
[Microsoft][ODBC SQL Server Driver][SQL Server]Could not drop constraint.
See previous errors.
When I ran exec sp_helpconstraint 'tblGuidelineResponseOwner', I got:
constraint_type constraint_name
DEFAULT on column yn_LockOut DF_tblGuideLineResponse_yn_LockOut
I ran:
alter table tblGuidelineResponseOwner DROP CONSTRAINT
DF_tblGuideLineResponse_yn_LockOut
and got the error message:
'DF_tblGuideLineResponse_yn_LockOut' is not a constraint.
Server: Msg 3727, Level 16, State 1, Line 5
Could not drop constraint. See previous errors.
Any help with this would be appreciated.
--
Thanks in advance,
StevenSteven,
Check sp_unbindefault in BOL.
-Mark
This positing is as is
>--Original Message--
>Hello,
>I am using SS7.
>I have a table with a column "yn_LockOut" with a default
set to 0. I tried
>to delete the column and got the following:
>'tblGuidelineResponseOwner' table
>- Error modifying column properties for 'yn_LockOut'.
>ODBC error: [Microsoft][ODBC SQL Server Driver][SQL
>Server]'DF_tblGuideLineResponse_yn_LockOut' is not a
constraint.
>[Microsoft][ODBC SQL Server Driver][SQL Server]Could not
drop constraint.
>See previous errors.
>
>When I ran exec
sp_helpconstraint 'tblGuidelineResponseOwner', I got:
>constraint_type
constraint_name
>DEFAULT on column yn_LockOut
DF_tblGuideLineResponse_yn_LockOut
>
>I ran:
>alter table tblGuidelineResponseOwner DROP CONSTRAINT
>DF_tblGuideLineResponse_yn_LockOut
>and got the error message:
>'DF_tblGuideLineResponse_yn_LockOut' is not a constraint.
>Server: Msg 3727, Level 16, State 1, Line 5
>Could not drop constraint. See previous errors.
>Any help with this would be appreciated.
>--
>Thanks in advance,
>Steven
>
>.
>sql

Monday, March 19, 2012

Can't Drop Column or Shrink tran log

I am having problem getting the transaction log of a db
that is being replicated to shrink even after performing
a backup. There is about 500 MB of data in the database
and the trans log is almost 4GB. Dbcc checkdb returned no
error but dbcc opentran returned the following message:
Replicated Transaction Information:
Oldest distributed LSN : (0:0:0)
Oldest non-distributed LSN : (305:22434:1)
DBCC execution completed. If DBCC printed error messages,
contact your system administrator.
Also on this particular db, I can't add/drop column using
EM on the published db but can add column using
sp_repladdcolumn. When I tried to drop a column using
sp_repldropcolumn, I get the following message: "ALTER
TABLE DROP COLUMN failed because 'FieldName' is currently
replicated."
The column that I can't drop is not a pk or part of a pk
and there are no constraints. There is a relationship
between this table and another table on another column.
Thanks
Emma
Emma,
I remember this thread from a while back!
It seems you have some transactions (1 or more) in the log which have not
been read by a log reader. Run your log reader agent for all publications in
this database, then turn them off and make sure no-one else can modify the
data. Run sp_replcmds to see if this returns anything else. If it does then
consider running sp_repldone. This will mark the log as having been read
completely, and you'll then be able to back it up and shrink it.
First, have a look in BOL for the 2 sps above to familiarize yourself with
them. Also, make sure you have a backup before attempting this fix.
HTH,
Paul Ibison
|||Paul,
According to BOL, sp_replcmds and sp_repldone are for
transactional replication. I am running a merge
replication. Does this make any difference?
Thanks
Emma

>--Original Message--
>Emma,
>I remember this thread from a while back!
>It seems you have some transactions (1 or more) in the
log which have not
>been read by a log reader. Run your log reader agent for
all publications in
>this database, then turn them off and make sure no-one
else can modify the
>data. Run sp_replcmds to see if this returns anything
else. If it does then
>consider running sp_repldone. This will mark the log as
having been read
>completely, and you'll then be able to back it up and
shrink it.
>First, have a look in BOL for the 2 sps above to
familiarize yourself with
>them. Also, make sure you have a backup before
attempting this fix.
>HTH,
>Paul Ibison
>
>.
>
|||Emma,
Yes! I assumed it was transactional, as the output of dbcc opentran looks
like that of transactional. Have you perhaps ever set up transactional
previously then disabled it? If so, please try running sp_repldone then see
if dbcc opentran reports anything different - hopefully no transactions will
be reported. Only do this if you don't have any current transactional
publications based on this database. As a last resort (backup your databases
before trying this), you could detach the database, delete the transaction
log, then reattach the database and a new empty log should be created for
you (I have had cause to do this previously and it worked).
HTH,
Paul Ibison
|||Paul,
Thanks for all your help. I have tried everything and
nothing is working. sp_repldone tells me that the
database is not published. I could not detach the
database because it is being replicated. I even stopped
the SQL services and deleted the log file, but this
generated an error when I restarted the database so I had
to restore the file. I disabled publication on the
database and tried to delete a column, and it tells me
that I can't delete because the table is being
replicated. Is my database corrupt? How can I get around
these problems? The two things I am trying to do is drop
a column from a published table and shrink my log file.
Any suggestions as to what I can do?
Thanks
Emma

>--Original Message--
>Emma,
>Yes! I assumed it was transactional, as the output of
dbcc opentran looks
>like that of transactional. Have you perhaps ever set up
transactional
>previously then disabled it? If so, please try running
sp_repldone then see
>if dbcc opentran reports anything different - hopefully
no transactions will
>be reported. Only do this if you don't have any current
transactional
>publications based on this database. As a last resort
(backup your databases
>before trying this), you could detach the database,
delete the transaction
>log, then reattach the database and a new empty log
should be created for
>you (I have had cause to do this previously and it
worked).
>HTH,
>Paul Ibison
>
>.
>
|||Emma,
try running
exec sp_dboption - to see the current settings
exec sp_dboption 'pubs','published',false
exec sp_dboption 'pubs','merge publish',false
This should allow you to detach the database and remove the log.
For the table, if it is still a problem, there is a stored procedure to do
this called sp_MSunmarkreplinfo which takes a tablename as a parameter.
Alternatively, setting replinfo to 0 in sysobjects for the particular table
should do it. Finally, running sp_removedbreplication can be used to remove
all traces of replication in the database, but obviously must only be done
if this database is not also configured as a publisher.
Regards,
Paul Ibison
|||Paul,
Thanks again for your help. I will try what you suggested
and hope for the best. The db is also configured as a
publisher and here is the result of sp_dboption.
ANSI null default
ANSI nulls
ANSI padding
ANSI warnings
arithabort
auto create statistics
auto update statistics
autoclose
autoshrink
concat null yields null
cursor close on commit
db chaining
dbo use only
default to local cursor
merge publish
numeric roundabort
offline
published
quoted identifier
read only
recursive triggers
select into/bulkcopy
single user
subscribed
torn page detection
trunc. log on chkpt.

>--Original Message--
>Emma,
>try running
>exec sp_dboption - to see the current settings
>exec sp_dboption 'pubs','published',false
>exec sp_dboption 'pubs','merge publish',false
>This should allow you to detach the database and remove
the log.
>For the table, if it is still a problem, there is a
stored procedure to do
>this called sp_MSunmarkreplinfo which takes a tablename
as a parameter.
>Alternatively, setting replinfo to 0 in sysobjects for
the particular table
>should do it. Finally, running sp_removedbreplication
can be used to remove
>all traces of replication in the database, but obviously
must only be done
>if this database is not also configured as a publisher.
>Regards,
>Paul Ibison
>
>.
>

Can't drop column

I have a couple of questions relating to a merge
replication database.
1.I was unable to add a column to a table being
replicated using EM, but succeeded using
sp_repladdcolumn. When I tried to drop another column
using sp_repldropcolumn, I get the following
message: "ALTER TABLE DROP COLUMN failed
because 'FieldName' is currently replicated.
2.If I am unable to use EM to drop/add columns,
does this mean that my db is corrupt? How can I check if
my db is corrupt and which tools can I use?
3.The transaction log for a replicated db keeps
growing. The database is about 500 MB and the transaction
log is almost 4GB. I performed a complete backup and even
tried to shrink the log manually but the size did not
change.
I will appreciate any help I can get in resolving these
problems.
Thanks
Emma
is this column a pk, or part of a pk? are there and contraints on this
column?
It is unlikely your database is corrupt. Database base corrpuption errors
normally show up when you query a page telling you a page of the table or
index is inaccessible, your database is inaccessible. To check this run dbcc
checkdb
Regarding your ever expanding database, run dbcc open tran and see if there
are any old open transactions. If so figure out what they are doing and
evaluate killing them. The consider switching to the simple recovery model
and trying to shrink the database again several times. This will cause
locking so it is best to do this off hours. After you do this run a backup,
and then switch back to the full model.
"Emma" <eeemore@.hotmail.com> wrote in message
news:175b001c418c1$10cd47e0$a501280a@.phx.gbl...
> I have a couple of questions relating to a merge
> replication database.
> 1. I was unable to add a column to a table being
> replicated using EM, but succeeded using
> sp_repladdcolumn. When I tried to drop another column
> using sp_repldropcolumn, I get the following
> message: "ALTER TABLE DROP COLUMN failed
> because 'FieldName' is currently replicated.
> 2. If I am unable to use EM to drop/add columns,
> does this mean that my db is corrupt? How can I check if
> my db is corrupt and which tools can I use?
> 3. The transaction log for a replicated db keeps
> growing. The database is about 500 MB and the transaction
> log is almost 4GB. I performed a complete backup and even
> tried to shrink the log manually but the size did not
> change.
> I will appreciate any help I can get in resolving these
> problems.
> Thanks
> Emma
>
|||Hilary,
Thanks for your response. dbcc checkdb returned no error.
dbbc opentran returned the following and I don't know
what to do with it.
Replicated Transaction Information:
Oldest distributed LSN : (0:0:0)
Oldest non-distributed LSN : (305:22434:1)
Thanks
Emma

>--Original Message--
>is this column a pk, or part of a pk? are there and
contraints on this
>column?
>It is unlikely your database is corrupt. Database base
corrpuption errors
>normally show up when you query a page telling you a
page of the table or
>index is inaccessible, your database is inaccessible. To
check this run dbcc
>checkdb
>Regarding your ever expanding database, run dbcc open
tran and see if there
>are any old open transactions. If so figure out what
they are doing and
>evaluate killing them. The consider switching to the
simple recovery model
>and trying to shrink the database again several times.
This will cause
>locking so it is best to do this off hours. After you do
this run a backup,
>and then switch back to the full model.
>"Emma" <eeemore@.hotmail.com> wrote in message
>news:175b001c418c1$10cd47e0$a501280a@.phx.gbl...
if
transaction
even
>
>.
>
|||Hilary,
In response to your first question, the column that I
can't drop is not a pk or part of a pk and there are no
constraints. There is a relationship between this table
and another table on another column.
Thanks
Emma

>--Original Message--
>is this column a pk, or part of a pk? are there and
contraints on this
>column?
>It is unlikely your database is corrupt. Database base
corrpuption errors
>normally show up when you query a page telling you a
page of the table or
>index is inaccessible, your database is inaccessible. To
check this run dbcc
>checkdb
>Regarding your ever expanding database, run dbcc open
tran and see if there
>are any old open transactions. If so figure out what
they are doing and
>evaluate killing them. The consider switching to the
simple recovery model
>and trying to shrink the database again several times.
This will cause
>locking so it is best to do this off hours. After you do
this run a backup,
>and then switch back to the full model.
>"Emma" <eeemore@.hotmail.com> wrote in message
>news:175b001c418c1$10cd47e0$a501280a@.phx.gbl...
if
transaction
even
>
>.
>