Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2005
    Location
    San Francisco, CA
    Posts
    506

    Unanswered: Dropping User created Tables from Master Db

    Hi,
    I have created a bunch of tables in the Master db by mistake.I want to drop those tables.Please tell me away to drop those.

    Thanks!!
    Success is the ability to go from one failure to another with no loss of enthusiasm.
    - Sir Winston Churchill
    Joydeep

  2. #2
    Join Date
    Dec 2002
    Posts
    1,245
    Quote Originally Posted by rudra
    Hi,
    I have created a bunch of tables in the Master db by mistake.I want to drop those tables.Please tell me away to drop those.

    Thanks!!
    try...
    Code:
    SELECT 'DROP TABLE [' + user_name(uid) + '].[' + name + ']'
    FROM sysobjects
    WHERE xtype = 'u' 
    AND OBJECTPROPERTY(id, 'IsMSShipped') = 0
    Copy and paste the results into QA, verify it's what you want and execute.

    Regards,

    hmscott

    Edit to add: It's never a good idea to query the system tables directly...but sometimes you gotta do what ya gotta do.
    Have you hugged your backup today?

  3. #3
    Join Date
    Nov 2005
    Location
    San Francisco, CA
    Posts
    506

    Edit to add: It's never a good idea to query the system tables directly...but sometimes you gotta do what ya gotta do.
    That was just perfect.Thanks a ton hmscott.
    Success is the ability to go from one failure to another with no loss of enthusiasm.
    - Sir Winston Churchill
    Joydeep

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •