Forum Replies Created

Viewing 15 posts - 7,501 through 7,515 (of 7,613 total)

  • RE: Orphaned users with \ in username

    FROM master.sys.syslogins a

    INNER JOIN SPUTIL.sys.sysusers b

    Why do you keep referring back to the "ancient" SQL 2000 views?

    MS itself tells you they're not reliable for SQL 2005 and SQL 2008.

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Orphaned users with \ in username

    Exactly: the orphaned ones will not show up in the GUI, so you can't delete them there, but you can DROP them using the T-SQL commands.

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Orphaned users with \ in username

    Please include the exact sp_dropuser command you used and the results of SELECT * FROM sys.database_principals as well.

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Orphaned users with \ in username

    The user account can't be used to access data.

    But you should be able to drop the user account from the db.

    What error message do you get when you try to...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: finding lookup table text strings inside much larger text string fields

    Hmm, that's a difficult issue. With what you're doing that won't be easy.

    I thought earlier about creating a full-text index across the "notes" column. In theory that could...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Orphaned users with \ in username

    You can't drop the user account(s)? [not the actual login]

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: bad CTE usage?

    You can refer to previously defined CTEs in a later CTE, but you must reference it like a table, i.e. JOIN to it, since that is effectively what it is.

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: SQL Server Won't Truncate Tables Until Restarted

    Did the TRUNCATE TABLE actually work? There are, of course, certain restrictions to using TRUNCATE.

    Did something else in the batch fail and cause a rollback? Unlike Oracle, a...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: shrink taking long - suggestions

    Yep, you need to verify that the log will actually shrink as much as want before issuing the SHRINK command. That means putting the db in simple mode first.

    You...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: SQL Baselines

    Get the free SQLIO tool and gather stats from that too. That will give you a best-case baseline for disk io (and, if the numbers aren't good/right, allow you...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Orphaned users with \ in username

    You should be able to use DROP USER or sp_dropuser to get rid of users in the db, whether they are linked to a login or not.

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: finding lookup table text strings inside much larger text string fields

    INSERT INTO foundTable ( note_#, product_code )

    SELECT n.note_#, p.product_code

    FROM notesTable n

    INNER JOIN productsTable p ON

    n.notes LIKE '%' + p.product_code + '%'

    ...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Exception Handling in SqlServer Trigger to allow base table transaction to commit but handle the error

    Any constraints will be verified before your trigger ever gets control. Thus, you cannot handle those types of errors in a trigger.

    In general, you use BEGIN TRY ... END...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Formating numbers

    Please post the valid formatting chars the existing function accepts and the expected output from sample formats.

    #0.00, ### ##0.00

    What specifically does that mean? I'm guessing the # is zero-suppressed...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: How do I search a string for a single space and not return double spaces e.g. find 'A B' not 'A B'

    You don't actually need PATINDEX for that, LIKE will work just as well:

    WHERE string LIKE ' [^ ]%' OR string LIKE '%[^ ] [^ ]%'

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

Viewing 15 posts - 7,501 through 7,515 (of 7,613 total)