Forum Replies Created

Viewing 15 posts - 3,691 through 3,705 (of 7,619 total)

  • RE: Statistics for crud operation

    While it's still available in the cache, just at it would be for index_usage_stats, you can likely use:
    sys.dm_db_index_operational_stats

    If the table is active, that data is very...

    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: Add New Column Based on Criteria

    As a very slight simplification, you could also do this (I prefer CAST when possible since it's ANSI-standard, whereas CONVERT is not):

    CAST((CP + 9) / 10 AS int)

    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: Date

    adisql - Friday, November 17, 2017 10:08 AM

    Hi,

    I would like to add new variable(Current Complete Week -1) to the SP for below...

    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: A different end table by parameter

    davidvarga086 - Monday, November 20, 2017 1:55 AM

    ...someone thought that we should add a weekly version to it, but if I add...

    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: Index Key Re-Ordering

    The key thing to remember is this:
    Data does not have to stored in physical sequence in order to be able to read in key sequence.

    That is, the...

    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 convert a int @variable to a varchar @variable with leading zero.

    drew.allen - Thursday, November 16, 2017 11:30 AM

    ScottPletcher - Thursday, November 16, 2017 10:47 AM

    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 convert a int @variable to a varchar @variable with leading zero.

    I certainly agree that the overhead of a variable isn't needed.

    But tThe RIGHT function is going to implicitly convert the value to varchar anyway, so I would stick...

    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: Trigger after update not working when updating 2 or more rows


    ALTER TRIGGER [dbo].[xxatr_slauf_AufartChangeU]
    ON [dbo].[XXASLAuf]
    AFTER UPDATE
    AS
    SET NOCOUNT ON;
    IF UPDATE(aufart)
    BEGIN
      DECLARE @aufintnr VARCHAR(8000)
      SET @aufintnr = ''
      SELECT @aufintnr...

    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: Quck TSQL question with regards to sys.master_files

    Best practice is to explicitly specify the table name/alias for every column in a query.  Otherwise, if one of the tables adds a column with the same name, the same...

    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: Move user database

    Other issues:
    1) if there's an error in a db file (such as would show up in a DBCC CHECKDB), it won't reattach
    2) during a reattach, the file gets...

    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: Date format check


    SELECT *
    FROM #Date
    WHERE ISDATE(DateString) = 0 OR
      DateString NOT LIKE '__[/.-]__[/.-]____' OR
      SUBSTRING(DateString, 3, 1) <> SUBSTRING(DateString, 6, 1)

    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: Rounding to the nearest 15 seconds

    Jeff Moden - Monday, November 13, 2017 8:15 AM

    If both simplicity and performance are important AND the datetimes will always be >...

    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: Move user database

    It's no longer needed for moving files around on the same instance.  Instead you can update the master catalog with the file locations, take the db offline, move the files,...

    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: Table Structure of Monthly Data

    Phil Parkin - Thursday, November 9, 2017 11:08 AM

    ScottPletcher - Thursday, November 9, 2017 10:30 AM

    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: Table Structure of Monthly Data

    You don't need an ID in this table at all (at least on what's known so far); in fact, as so often is the case, it corrupts what would be...

    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,691 through 3,705 (of 7,619 total)