Forum Replies Created

Viewing 15 posts - 5,836 through 5,850 (of 7,613 total)

  • RE: primary key discussion

    Eirikur Eiriksson (8/29/2014)


    ScottPletcher (8/29/2014)


    patrickmcginnis59 10839 (8/29/2014)


    CELKO (8/22/2014)


    What do you use for the PK on lookup tables?

    I use the encoding that is being used. The IDENTITY property (not a 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: primary key discussion

    patrickmcginnis59 10839 (8/29/2014)


    CELKO (8/22/2014)


    What do you use for the PK on lookup tables?

    I use the encoding that is being used. The IDENTITY property (not a column!) is the count...

    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: Which perform better comparing only date part of datetime?

    amns (8/29/2014)

    Instead of a datetime, if I cast a string with format 'yyyy-MM-dd',

    will this cast always result in the correct date regardless the collation or other server parameters? (considering this...

    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: get counts from two columns in two different tables

    j_depp_99 (8/29/2014)


    thanks much for your response. Testing it now but not sure about the variable. What does this represent? ?

    Msg 207, Level 16, State 1, Line 8

    Invalid column 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: get counts from two columns in two different tables

    Something like below. I don't have test data, so haven't tested it yet.

    Edit: The WHERE conditions on your original query caused the LEFT JOIN to become a de factor...

    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: Query works static, but does not dynamically

    Sorry, I have no idea; that's not my area of expertise.

    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: Query works static, but does not dynamically

    I'm guessing what is happening is that Latin1 has only ascii 0 to 255, not extended characters. So, the double-bytes are being interpreted as single bytes, one of which...

    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: name convention for archived or historical database

    I use "__Archive" (double underscore) for those tables.

    I also maintain its structure to match the original table. That is, if the main table changes, I make the same changes...

    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: Select records with different values in the same column

    I guess "UnitNumber" is the "Patient".

    SELECT UnitNumber,

    MAX(CASE WHEN DiagnosisSeqID = 1 THEN Diagnosis ELSE '' END) AS Primary_Diagnosis,

    '427.31' AS Seconday_Diagnosis_Match

    FROM test t

    GROUP...

    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 Use Substring(charindex) to remove start of a string

    Not sure if you want to get the exact proc name being executed or see it and its parameters. Something like this should help you get started, although 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: Char , Varchar, NVarchar

    er.mayankshukla (8/26/2014)


    er.mayankshukla (8/26/2014)Hello Experts,

    I have defined a Nvarchar column of 30 bytes

    Lets say

    create table demo (name nvarchar(30))

    But when I see the length of this column by selecting table and pressing...

    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: Perfomance tuning and design<!-- 864 -->

    See if it's possible to summarize data and get rid of some of the details. Yes, they always say then need "everything", but then frequently they roll things up...

    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: Scalar UDF versus Inline UDF<!-- 864 -->

    Tracing scalar UDFs adds enormous time to its execution. That is, just trying to compute the time vastly increases the time. Thus, scalar UDFs generally are performing much...

    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: Difference between INFORMATION_SCHEMA.COLUMNS and sys.columns<!-- 864 -->

    This is an easy one:

    ALWAYS use sys.; NEVER use INFORMATION_SCHEMA.

    Not only might I_S be inaccurate, I've found it's also much slower and much more prone to locking/deadlocking. The I_S...

    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: Mass removal ofF permissions

    MickyD (8/19/2014)


    Scott

    Thanks for this . Could you confirm if I need to add the select statement part ?

    Ideal situation would be to read this from a table that exists 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".

Viewing 15 posts - 5,836 through 5,850 (of 7,613 total)