Forum Replies Created

Viewing 15 posts - 4,756 through 4,770 (of 7,619 total)

  • RE: Parsing unstructured CSV file

    Sounds like you need a really fast splitter. Check out DelimitedSplit8K.

    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: Deadlocks

    Might a job have run and hit that db but using a different user?

    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: Deadlocks

    Lynn Pettis (10/1/2015)


    ScottPletcher (10/1/2015)


    You should get rid of the INSULL() in the WHERE clause, as always. Just NEVER use ISNULL() in a WHERE or JOIN. But it's esp....

    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: Deadlocks

    You should get rid of the INSULL() in the WHERE clause, as always. Just NEVER use ISNULL() in a WHERE or JOIN. But it's esp. important if 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: Left join vs Exists

    No, you can't use EXISTS to return data.

    As to performance, the non-clustered index on the vcv (InformationOverride) table would have to INCLUDE the vote column to be useful.

    Better would very...

    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: ANY EASY WAY TO REDUCE THE CODE??

    You could put values into a table and do a lookup.

    You could also use a CROSS APPLY to assign an alias name to the result of the first CASE statement,...

    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: Free form text parsing suggestions

    I wondered about that too, but I noticed there's an odd character before "wrap" that looks like a blank, but really isn't. When you copy it in the SSMS...

    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: Create Weeks Calendar from Date in SQL 2012

    Here's the code if a month's weeks start in the prior month:

    SELECT

    WeekStartDate,

    WeekEndDate,

    LEFT(DATENAME(MONTH, WeekEndDate), 3) + '_Week' +...

    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: Create Weeks Calendar from Date in SQL 2012

    The WeekName logic contradicts itself. If:

    8/30/2015 9/5/2015 = Sep_Week1

    then shouldn't:

    9/27/2015 10/3/2015 = Oct_Week1 rather than "Sep_Week5"

    It's impossible for that week to be both Sep_Week5 and Oct_Week1 ... or...

    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 trim sql query

    From a performance standpoint, do this, get rid of the functions against the column in the WHERE clause to allow max possible use of all indexes. Always avoid functions...

    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: Free form text parsing suggestions

    drew.allen (9/30/2015)


    ScottPletcher (9/30/2015)


    Yikes. Here's an alternative that should perform better for you:

    Part of the reason that XML string splitters are inefficient is converting character separated strings to a format...

    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: Free form text parsing suggestions

    jguffey (9/30/2015)


    Thank you both for the replies.

    Scott, can you explain dbo.tally and t.tally. I'm not sure I understand what they are or what I need to do to create 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: Free form text parsing suggestions

    Yikes. Here's an alternative that should perform better for you:

    select STUFF(

    cast((select ' ' + SUBSTRING(spt.notes, t.tally + 3, CHARINDEX('</p', spt.notes, t.tally + 3) - (t.tally...

    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: Help with syntax

    You need to CAST another column to varchar, since it's an int, as was done with billpay:

    select '"'+cast([ssn] as varchar(11))+'","'+ [username]+'","'++'","'+cast([estatement] as varchar(100))+'","'+ CAST([billpay] AS varchar(12))+'",'from @people

    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 in creating an index

    Carefully review what the best clustered index for this table would be. It's extremely like that all, or some, of the keys in your planned new index should actually...

    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 - 4,756 through 4,770 (of 7,619 total)