|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
User TypeI have a need to remove all objects from a database where the type is User.
Is there a fast way to do this? Is there a way to get a list of these objects so I could use a cursor to remove them? Thanks, Mark You can do this through Enterprise Manager 2000 or Management Studio 2005.
Show quote "mrprice" <mrpr***@discussions.microsoft.com> wrote in message news:F486AC15-C720-43A7-A0B0-EC6E24FFDDC7@microsoft.com... >I have a need to remove all objects from a database where the type is User. > Is there a fast way to do this? Is there a way to get a list of these > objects so I could use a cursor to remove them? > > Thanks, > Mark You would be left with system tables. Have you thought about DROP DATABASE?
You can query the system tables to obtain the object name (and type). You would have to issue the appropriate DROP statement within your cursor... SELECT Type, Name FROM sysobjects WHERE type <> 's' ORDER BY Type, Name -- Show quoteKeith Kratochvil "mrprice" <mrpr***@discussions.microsoft.com> wrote in message news:F486AC15-C720-43A7-A0B0-EC6E24FFDDC7@microsoft.com... >I have a need to remove all objects from a database where the type is User. > Is there a fast way to do this? Is there a way to get a list of these > objects so I could use a cursor to remove them? > > Thanks, > Mark |
|||||||||||||||||||||||