Forum Replies Created

Viewing 15 posts - 46 through 60 (of 428 total)

  • RE: Count patterns of behaviour in a certain order

    Why is my suggestion ignored? It may not be as fast, but it gives a more reliable result than Hugo's plus it is suitable also if the number of distinct...



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

  • RE: Is Date the Last Day of the Month

    Luis Cazares (4/14/2016)


    A different option.

    SELECT YourDate,

    CASE WHEN MONTH(YourDate) <> MONTH(DATEADD(day, 1, YourDate)) THEN 'True' ELSE 'False' END,

    CASE WHEN YourDate = DATEADD( MM,...



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

  • RE: How can I force a deferred update to create two rows in change data capture?

    jaincs (3/23/2016)


    I am having a similar issue. However, not sure about the fix. I am getting an error message which looks like this:

    Cannot insert duplicate key row in...



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

  • RE: Need help with SQl syntax

    Hugo Kornelis (4/5/2016)Yes, trying to work around all possible collations can be very intersting/challenging/annoying.

    So true!



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

  • RE: Parse XML with multiple namespaces

    But if you want to do it exact, for example because the same element name exist in multiple schemas. Here's the query to get those values:

    with xmlnamespaces (

    ...



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

  • RE: Count patterns of behaviour in a certain order

    J Livingston SQL (4/4/2016)


    as a starter.....given the following what results would you expect?

    if this isnt a basic interpretation of your table, then please post a representative script that does explain...



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

  • RE: Need help with SQl syntax

    Hugo Kornelis (4/2/2016)


    Lowell (3/31/2016)


    --RxClaims.prescriberId LIKE '[a-zA-Z][a-zA-Z]%' --case sensitive collation

    I think that would be for a binary collation. For case-sensitive collations, it would be either LIKE '[a-Z][a-Z]%', or LIKE '[A-z][A-z]%' -...



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

  • RE: Sudden performance hit

    C.K.Shaiju (4/4/2016)


    Jeff Moden (3/17/2016)


    PretendDBA (3/17/2016)


    Wow, in a modern SAN that is a significant performance hit from 1 failed disk.

    Worse than that, there was a bad disk that slowed the system...



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

  • RE: Automate stored procedure creation

    sys.sql_modules should be helpful in getting the current definitions from the database. Using this system table you can extract the procedure's current definitions to compare them to wherever you keep...



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

  • RE: Merge replication - conflicts with primary keys

    As long as your application allows users to specify the primary key you'll get these primary key violation conflicts. In a non-replicated environment the users would not be allowed to...



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

  • RE: replications

    Yes, in real life you do use separate accounts not having sysadmin privileges. If you don't, you're at risk when your security is breached in any way. It's not even...



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

  • RE: Runing a script after on alwayson failover SQL Server 2012

    I haven't tried it, so it's just an idea. Have you tried scheduling a SQL Server Agent job at 'SQL Server Agent Startup'?



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

  • RE: Strange CDC error on fn_cdc_get_net_changes

    I know the OP probably doesn't need an answer any more, but for anyone who has a similar issue and ends up finding this question:

    The message text 'An insufficient number...



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

  • RE: Service Broker Queue

    These are queues generated for Query Notifications. They are dynamically created for each query notification requested by a client. There is no need to transfer these into your new database.

    More...



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

  • RE: Syntax help on updating a column by default based on a rule..

    Use getutcdate() not getdate() or you'll run into problems due to daylight savings time. Like last weekend, when the clock was reset back from 03:00 to 02:00.



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?

Viewing 15 posts - 46 through 60 (of 428 total)