Finding tables containing JID, UserJID, or CharID (For cleanup purposes)

Results 1 to 2 of 2
  1. #1
    Don't touch my Nutella! Witchy Moo is offline
    MemberRank
    Aug 2013 Join Date
    SingaporeLocation
    208Posts

    note Finding tables containing JID, UserJID, or CharID (For cleanup purposes)

    Hello, here I'll share simple query to find tables containing "JID", "UserJID", or "CharID", for cleanup purposes. Well actually, it'll be easier to cleanup the whole thing if you wanna start fresh, and this prolly old and useless to you, but I'll share it anyway.

    Now the boring part:
    Code:
    USE [SRO_VT_SHARD]
    GO
    -- Find tables containing field "JID" or "UserJID" or "CharID"
    SELECT c.name AS ColName, t.name AS TableName FROM sys.columns c JOIN sys.tables t ON c.object_id = t.object_id
    WHERE c.name LIKE 'JID' OR c.name LIKE 'UserJID' OR c.name LIKE 'CharID' ORDER BY c.name, TableName ASC
    Note: that's only for SRO_VT_SHARD. do the same in ACCOUNT and LOG database.

    Result:
    find-tables.jpg


  2. #2
    Retired blapanda is offline
    MemberRank
    Oct 2013 Join Date
    LocalhostLocation
    536Posts

    Re: Finding tables containing JID, UserJID, or CharID (For cleanup purposes)

    Oh, sure it might be "old", as other (aka jerks) may or going to comment here, but haven't had the idea doing the same as data related.
    Having a similar script for Database related stuff.

    Thanks, might become handy scripting more procedure related items. :)
    Last edited by blapanda; 12-07-15 at 05:06 AM. Reason: Just a typo fix



Advertisement