Forum Replies Created

Viewing 15 posts - 2,956 through 2,970 (of 7,619 total)

  • RE: Sort already comma separated list

    patrickmcginnis59 10839 - Monday, February 18, 2019 7:16 AM

    I'd just like to thank Joe for fighting the good fight. I'm seeing HORRIFIC...

    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: Invalid use of a side-effecting operator 'rand' within a function

    Pass the RAND value in.  And, for efficiency, get rid of the local variables in the function.

    SET ANSI_NULLS ON;
    SET QUOTED_IDENTIFIER ON;
    GO

    CREATE function...

    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: Sort already comma separated list

    jcelko212 32090 - Friday, February 15, 2019 2:56 PM

    ScottPletcher - Friday, February 8, 2019 2:44 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: Capitalising the contents of a field

    You might want to test for lower case chars before doing the UPDATE, using any case-sensitive collation:


    UPDATE CONTACT
    SET COUNTRY = UPPER(COUNTRY)
    WHERE COUNTRY...

    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 many exec plans SQL Server keeps for the same stored proc?

    You can also get that if you don't include the schema name when referencing tables.  For example:

    SELECT ...
    FROM table1

    SQL will often generate a separate plan...

    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: Find and replace third occurrence of the string

    ben.brugman - Thursday, February 14, 2019 2:32 AM

    ScottPletcher - Monday, February 11, 2019 1:03 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: Tuning Query In Stored Procedure

    jkramprakash - Tuesday, February 12, 2019 9:31 AM

    The Product_Name column in the table  contains lots of special characters like '®' ,'©',so i have...

    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: Dynamic SQL to iterate through consecutively named columns?

    You can use a list of CROSS APPLYs to evaluate columns and concatenate values as you need to.  The great thing is that new aliases ("columns") created in a CA...

    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 real doozie!

    Check for INSERT triggers on the table being INSERTed into, just to be sure.  The error could be occurring in a trigger rather than for the main INSERT.

    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: Finding which database who has a specifik string in one field

    Sounds like you are looking only for a single match.  If so,you should skip the dbs after a match if found:


    IF OBJECT_ID('tempdb.dbo.#stop_flag') IS NOT NULL

    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: Multiple Filegroups vs. Multiple Databases for better Performance

    What do you mean by 'three-part-naming issues'?

    If the table resides in a separate db, then you reference the table you will need to include the db name, either...

    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: Basic Question for Updates

    No.  It's random which you get if there are multiple matches.  If you want a specific match, write your own code to do that.  For example:

    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: Find and replace third occurrence of the string

    Michael L John - Monday, February 11, 2019 12:53 PM

    saravanatn - Thursday, October 18, 2018 8:42 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: Multiple Filegroups vs. Multiple Databases for better Performance

    Separate new filegroup(s) are fine, you don't really need a separate db, and you don't want to deal with the three-part-naming issues that a separate db would require.

    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: Sort already comma separated list

    Jeff Moden - Friday, February 8, 2019 3:27 PM

    Alan.B - Friday, February 8, 2019 2:49 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".

Viewing 15 posts - 2,956 through 2,970 (of 7,619 total)