Forum Replies Created

Viewing 15 posts - 1,861 through 1,875 (of 7,619 total)

  • Reply To: Preventing concurrent inserts

    I'd avoid a guid if at all possible.

    Make sure you have an index keyed first on c1, so that determining the max(c1) is a single, quick seek.  An INSERT of...

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

  • Reply To: Validate phone numbers in SQL

     

    SELECT 
    phone_string,
    phone,
    --LEN(phone) AS phone_len,
    CASE WHEN
    CASE 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".

  • Reply To: Query Optimizer Suggests Wrong Index and Query Plan -- Why?

    I wouldn't make the Status a key column, since it's likely to change so often, at least in the earlier life stage of the row.  The rows are small anyway,...

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

  • Reply To: Please help to get duration between two 4 or 3 character string

    Jeff Moden wrote:

    Johan Bijnens wrote:

    I do not consider "2359 to 2359" a valid case, as that might imply it may also span multiple days

    Ordinarily, I'd agree but to consider the span of...

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

  • Reply To: Multilevel BOM with Inventory

    But does the Adjacency model actual satisfy BOM requirements?

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

  • Reply To: trigger email alerts in case file is delivered or failed for the job

    Are you using SQL mail (sp_send_dbmail)?  If so, you can use the mail status table in msdb to check on the status of any email.  Look at the "sysmail_%" views.

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

  • Reply To: trigger email alerts in case file is delivered or failed for the job

    Phil Parkin wrote:

    What sort of help do you want?

    christi1711 wrote:

    Hi all,

    I have two SQL jobs. These jobs execute SSIS packages and then send files to e-mail.

    I need to create one more...

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

  • Reply To: SQL Server maximum Server Memory

    Get the Developer Edition, that would allow you to use more RAM and give you many other added capabilities as well.

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

  • Reply To: increase the tempdb size bigger before job run

    > Is it a better approach before running the job I can make the initial size bigger? <<

    Yes, for sure.  For one thing, it means you can make sure 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".

  • Reply To: T-log Alert

    SQL Server Agent provides Alerts that can be configured to do that.  However, they are per server and, indeed, per db for log file counters.

    The default trace also contains entries...

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

  • Reply To: Lots of CTE and dynamic query

    Removing NOLOCK / UNCOMMITTED could only slow down the code, it could never speed it up.  Since OP is looking for a performance gain, removing NOLOCK is not the top...

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

  • Reply To: Lots of CTE and dynamic query

    As stated, we really need a query plan.  But this is always true: instead of "(select count(...) ...) > 0" you can just do an EXISTS check.  You don't really...

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

  • Reply To: Array into table.

    If you can count on the values being the same length and/or there are only a very limited number of length variations, you could just SUBSTRING the data from the...

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

  • Reply To: Can anyone explain the design decision here?

    Jeff Moden wrote:

    Most people won't know the trick of of embedding a SELECT N=0 UNION ALL to make the "-1" calculation unnecessary. 

    I do know that trick, and have used it myself,...

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

  • Reply To: Please help to get duration between two 4 or 3 character string

    Here's an alternative method, just for the heck of it:

    SELECT 
    begin_time, end_time,
    LEFT(end_time, ISNULL(NULLIF(LEN(end_time) - 2, -1), 0)) * 60...

    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 - 1,861 through 1,875 (of 7,619 total)