Forum Replies Created

Viewing 15 posts - 6,646 through 6,660 (of 7,613 total)

  • RE: sys.dm_io_virtual_file_stats - Number of Read and Writes

    No, that's not how those counters work.

    A single SELECT statement can, and very often will, generate multiple physical reads.

    A single UPDATE or DELETE statement can, and very often will, generate...

    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: case statement in count?

    SELECT

    '20130701' AS Date, Year,

    6 AS JulyMaxhours,

    SUM(6) AS Total_Hours,

    KindOfDay, Month

    FROM Auxiliary.Calendar

    WHERE (KindOfDay =...

    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: Combining Two Very Large Tables

    It's easy enough to generate the code for 00 to 99 based on the pattern for 00, so it's not really "manual" coding.

    I figured on a (very broad) average of...

    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: case statement in count?

    Not sure I fully understand, but maybe:

    SELECT Date, Year, CASE DATEPART(mm, date) WHEN 07 THEN 6 END AS JulyMaxhours, KindOfDay, Month,

    SUM(CASE WHEN DATEPART(mm, date) = 07 THEN 6 ELSE 0...

    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 to make a stored procedure return a value when there are no available values

    CREATE PROCEDURE [dbo].[GetExtractSiteExtractFileBatchPreviousSuccessInd]

    @BatchStatusCd NVARCHAR(5)

    ,@ExtractSiteCd NVARCHAR(10)

    ,@ExtractAsOfDate DATETIME

    AS

    RETURN (

    SELECT CASE

    ...

    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: Combining Two Very Large Tables

    Maybe consider records to "match" if the SSN, first name and birth date all match. My reasoning: last name can change (marriage, etc.), and middle name may not 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: SP execution time.

    Or, depending on your specific needs, you could add your own logging/pseudotrace code to the proc itself, and trigger it with an optional parameter:

    CREATE PROCEDURE dbo.proc_name

    @...,

    ...

    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: Alter numeric(12,6) to numeric(19,4) - is it metadata only or is it recreate table?

    You don't really need SSMS to generate the statement. [And of course you don't try to make the change using SSMS, as SSMS will rebuild the entire table foe...

    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: Read Committed_Snapshot

    winmansoft, you should also be aware of the 14-byte-per-row overhead that READ_COMMITTED_SNAPSHOT requires. Anytime a row is updated, or a new row is inserted, the 14 bytes will 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: Why is "instead of delete" trigger not fired by delete inside "after update" trigger

    brettstahlman (3/18/2013)


    Lynn Pettis (3/16/2013)


    brettstahlman (3/16/2013)


    Lynn Pettis (3/16/2013)


    brettstahlman (3/16/2013)


    opc.three (3/16/2013)


    The reason why I disagree is because of the behavior of the after trigger when it is the instead trigger that 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: Alter numeric(12,6) to numeric(19,4) - is it metadata only or is it recreate table?

    Could you go to NUMERIC(19,6)? That should work fine, and I think it will be just a metadata change.

    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: Database name is visible but not available.

    This is off the wall, but did "AUTO_CLOSE" somehow get set on for that db?

    That's a longshot, since even if it did it should auto_open when you reference it, but...

    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: Setting rowcount also limits the available databases in the database drop down...

    Interesting.

    SSMS is probably internally running a query / stored proc to get the list of databases. Obviously the "SET ROWCOUNT" is affecting the code it uses as well.

    I guess...

    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: Why is CDC returning Insert/Delete when I UPDATE a row in a table?

    For certain UPDATE statements, SQL must instead actually do a DELETE and an INSERT instead of an UPDATE. So, the result is normal for SQL.

    If you need to see...

    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 to combine and convert two integer columns to datetime

    Or, another possibility (with no character conversions/manipulation):

    SELECT

    ColA, ColB,

    DATEADD(SECOND, ColB % 100, DATEADD(MINUTE, ColB % 10000 / 100, DATEADD(HOUR, ColB /...

    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 - 6,646 through 6,660 (of 7,613 total)