Forum Replies Created

Viewing 15 posts - 3,466 through 3,480 (of 7,613 total)

  • RE: Get all index definitions from all databases and all tables

    Why do you need to save it in a string format?  Could you just grab the meta-data instead, and leave it a table format until/unless you actually needed to convert it...

    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: Deriving a column from another derived column - conversion issues.

    I can't see any reason to test a COUNT(*) for "ISNUMERIC", since by definition a COUNT will be an int value.

    Given that, I think this query does what...

    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: Trying to reduce RID Lookups

    1) Verify that table "DonAlias" is (1A) clustered by Donor_No or (1B) a nonclus index is keyed by Donor_No and contains Alias (as key or not, with or without other...

    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: Update Trigger

    Ken at work - Tuesday, April 10, 2018 12:22 PM

    Thank you, I think I'm going to give this a try.
    I was curious,...

    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: Shrinking log file

    How old is the oldest transaction?  Sounds like you might have a long-ago task that couldn't complete for some reason.  Remember, with replication, SQL can't reuse any part of the log until...

    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: Best way to perform calculation stored as varchar

    I suppose you could create a computed column(s) in a dummy table, with a base dummy column, assuming you could live with the overhead of creating a separate computed column...

    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: Update Trigger


    SET ANSI_NULLS ON;
    SET QUOTED_IDENTIFIER ON;
    GO
    CREATE TRIGGER udLaborTracking__TRG_UPD_Set_LastJob
    ON dbo.udLaborTracking
    AFTER UPDATE
    AS
    SET NOCOUNT ON;
    IF UPDATE(Job)
    BEGIN
      UPDATE ult  /*this is critical:...

    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: Coalesce and simple pivot (or group by?)

    Since the values are purely numeric -- int in this case -- you can handle up to 3 values without having to use XML.  Because of the overhead of invoking...

    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: Db name inside the stored proc

    Sergiy - Wednesday, April 4, 2018 8:58 PM

    patrickmcginnis59 10839 - Wednesday, April 4, 2018 1:45 PM

    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: Db name inside the stored proc

    If you're on an installed version of SQL, rather than SQL Azure, just create the proc in the master db, mark it as special, and then it will run in...

    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 2016 REF 70-761 question

    Ethically, I don't like commenting at all on test dumps.

    But G isn't right either, no matter what MS says.  The valid datetime comparison for the year of 2014...

    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 Agent Job question

    Try using the 
    FOR XML
    option in the SQL query (SELECT).\

    I'm not sure if that will work as you want it to (I think it probably should), and...

    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: Updating null fields wehn changing field to not null.


    ;WITH cte_assign_Item_ID_values AS (
      SELECT *, ROW_NUMBER() OVER(PARTITION BY Ref ORDER BY Traveller) AS row_num
      FROM dbo.table_name
    )
    UPDATE cte_assign_Item_ID_values
    SET Item_ID = row_num

    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 Agent Job question

    Don't use a temp table (I didn't).  Just use a "real" table name.  Not a bad idea to keep a copy of what was exported until the next run anyway. ...

    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 Agent Job question

    bcp exports the results of a table, view or query, not the results of a procedure execution.

    You'll need to capture the results of the proc into a table,...

    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 - 3,466 through 3,480 (of 7,613 total)