Forum Replies Created

Viewing 15 posts - 3,076 through 3,090 (of 7,619 total)

  • RE: How can I get a set Date and Time Range between Yesterday and Today?

    drew.allen - Tuesday, September 18, 2018 3:08 PM

    ScottPletcher - Tuesday, September 18, 2018 12:10 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: Orphaned tables in sys.tables?

    You're welcome.  Glad it helped, because that would be a confusing error indeed.

    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 the MIN or a group of values not used in a previous group

    This may not be the most efficient, but I believe it works, and shouldn't be too much overhead anyway unless you have lots of unqiue Ids:


    ;WITH...

    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: Validate multiple fields and return string with erroronous fields

    Try some type of concatenation, like this:


    SELECT
    Message = NULLIF(STUFF(
          CASE WHEN Name  IS NULL OR Name  = '' THEN ', Name'  ELSE ''...

    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: Orphaned tables in sys.tables?

    Make sure you're also looking at the schema name along with the table name.  Maybe the schema is not "dbo" and so it looks like the table's not there when...

    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: T SQL Question sd.name ?

    andycadley - Wednesday, October 31, 2018 2:10 PM

    Yes, by "small" scope I meant it's only guaranteed to be in effect for 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".

  • RE: T SQL Question sd.name ?

    FROM sys.databases sd LEFTJOIN sys.database_mirroring dbm

    As noted, a name, "sd", that follows immediately after a table name, "sys.databases", becomes an alias for that table.  In fact, it becomes the only name for that...

    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: Changing 1 or + in a telephone number to the correct format

    I suggest generating a pattern to identity what the phone string contains.  Then all you need to do is decide which patterns are acceptable and which aren't.

    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: Deleting data from a table ... quickly

    julian.fletcher - Thursday, October 25, 2018 2:18 AM

    Jeff Moden - Monday, October 22, 2018 11:52 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: TRIGGER for INSERT/ UPDATE from table source for table destination

    antoniop.silv - Friday, October 26, 2018 11:49 AM

    Guru Thank you for feedback,
    Thank you for your feedback. I liked. But an observation...

    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 to table conversion

    Brandie Tarvin - Friday, October 26, 2018 5:16 AM

    I'll look into decision tables. Thank you for the suggestion, Joe.

    Scott, I appreciate your...

    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: Blocking problem

    For only 1 to 5 rows, then it should'n take long at all. 

    I don't see why SERIALIZABLE would be needed at all for this UPDATE.  SQL 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 comma delimited field?

    Jeff Moden - Thursday, October 25, 2018 3:06 PM

    ScottPletcher - Thursday, October 25, 2018 9:49 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: Blocking problem

    Yes, SERIALIZABLE is the most restrictive level there is, so it could lead to blocking.

    Is the main table indexed in some way on col3?

    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 for INSERT/ UPDATE from table source for table destination


    SET ANSI_NULLS ON
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TRIGGER [dbo].[TriggerUpdateInsert]
    ON [dbo].[TABLE_SOURCE]
    AFTER INSERT, UPDATE
    AS
    SET NOCOUNT ON;

    UPDATE TD
    SET FIELD_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".

Viewing 15 posts - 3,076 through 3,090 (of 7,619 total)