Forum Replies Created

Viewing 15 posts - 6,271 through 6,285 (of 7,613 total)

  • RE: Unable to convert character to datetime

    Rando (1/2/2014)


    Still searching for a solution. Scott's solution yield's syntax errors and Chris' solution yields the entire date field...

    Again, I'm just looking for the results to be the following;

    Date: 12/30/2013

    Time:...

    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: Unable to convert character to datetime

    SELECT

    CONVERT(varchar(10), CAST(CounterDateTime AS datetime), 101) AS Date,

    RIGHT(CONVERT(varchar(20), CAST(CounterDateTime AS datetime), 100), 7) AS Time

    FROM 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".

  • RE: Split a variable length string without using a WHILE loop

    Jeff Moden (12/24/2013)


    ScottPletcher (12/24/2013)


    If you don't have any data longer than 24 bytes (or so), it might be easier just to "brute STUFF" it:

    Awesome! I don't believe anything will...

    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: Split a variable length string without using a WHILE loop

    If you don't have any data longer than 24 bytes (or so), it might be easier just to "brute STUFF" it:

    WITH SampleData (MyStr) AS

    (

    SELECT '12345678'

    ...

    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: SYNTAX Help please...

    Jeff Moden (12/20/2013)


    ScottPletcher (12/20/2013)


    Evil Kraig F (12/20/2013)


    ScottPletcher (12/20/2013)


    Admittedly the gain is much clearer when the clustering key is the ISNULLed column. So, let's just flip the clustering keys on...

    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: SYNTAX Help please...

    Evil Kraig F (12/20/2013)


    ScottPletcher (12/20/2013)


    Admittedly the gain is much clearer when the clustering key is the ISNULLed column. So, let's just flip the clustering keys on your original 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".

  • RE: SYNTAX Help please...

    Evil Kraig F (12/20/2013)


    ScottPletcher (12/20/2013)


    Admittedly the gain is much clearer when the clustering key is the ISNULLed column. So, let's just flip the clustering keys on your original 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".

  • RE: SYNTAX Help please...

    Evil Kraig F (12/20/2013)But, I'd like to bring us back to the origination of this minor alteration in the direction of this topic, and that's SARGability and effeciency and if...

    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: SYNTAX Help please...

    Evil Kraig F (12/20/2013)

    ScottPletcher (12/20/2013)


    There could be great harm in it if either (1) SQL could have done seeks on both terms and produced the final output more efficiently than...

    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: SYNTAX Help please...

    Jeff Moden (12/20/2013)


    ScottPletcher (12/20/2013)


    Jeff Moden (12/20/2013)


    ScottPletcher (12/19/2013)


    I don't object to ISNULL() in the SELECT list, just in WHERE conditions. Since it shouldn't be used in WHERE, it's only consistent...

    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: SYNTAX Help please...

    Jeff Moden (12/20/2013)


    ScottPletcher (12/19/2013)


    I don't object to ISNULL() in the SELECT list, just in WHERE conditions. Since it shouldn't be used in WHERE, it's only consistent not to use...

    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 avoid KeyLookpu in Execution Plan of a Query ?

    Snargables (12/19/2013)


    I had to create an index that added all the columns in the include of the index. This was because i created a function that has to return all...

    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 avoid KeyLookpu in Execution Plan of a Query ?

    wolfkillj (12/19/2013)


    ScottPletcher (12/19/2013)


    Jeff Moden (12/18/2013)


    ScottPletcher (12/18/2013)


    If your lookups will most often be by column2, you need to cluster the table on column2, or an encoded version of it, rather than...

    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: need help on design of database for student registration system

    Sigerson (12/19/2013)


    Grant Fritchey (12/18/2013)


    I could, but won't, argue that identities are a crutch. Natural keys can work fine. I try not to worry too much about the key structure while...

    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 avoid KeyLookpu in Execution Plan of a Query ?

    Jeff Moden (12/18/2013)


    ScottPletcher (12/18/2013)


    If your lookups will most often be by column2, you need to cluster the table on column2, or an encoded version of it, rather than having 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".

Viewing 15 posts - 6,271 through 6,285 (of 7,613 total)