Forum Replies Created

Viewing 15 posts - 361 through 375 (of 2,894 total)

  • RE: using row_number() over partition by to get datediff by row

    Lynn Pettis (5/30/2013)


    Okay, rereading everything. The first record that is counted starts the 60 minute window, subsequent records that are overlapping do not extend the window.

    This correct?

    100128138100251211752013-05-16 16:43:51.000

    100128138100251332812013-05-23 17:53:46.000

    100128138100251332812013-05-23...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: NOLOCK hint.

    Luis Cazares (5/30/2013)


    GilaMonster (5/28/2013)


    WangcChiKaBastar (5/28/2013)


    our database is not financial, our use of NOLOCK hint was to increase concurrency and limit contention (deadlock).

    Use one of the snapshot isolation levels. Financial or...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: using row_number() over partition by to get datediff by row

    Cursor/loop based solution given by Mister.Magoo is fine, but will suffer performance issues if you need to process large dataset at once.

    As I have said before "quirky update" would do...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Delete take too much time

    Is it one off task?

    There are few ways to speed up deletes. You can choose one depending on your exact circumstances.

    1. Copy records you want to leave into new...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Triiger -> call batch -> Batch call java

    It's a very bad idea to call a batch from a trigger synchronously.

    I would recommend using SQL Server Service Broker instead.

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Suggestions / comments required on a query

    For a start you better to do following two things:

    1. Format your query into more readable form - use indent, otherwise code looks like noodles.

    2. Remove NOLOCK hints (http://sqlblogcasts.com/blogs/tonyrogerson/archive/2006/11/16/1345.aspx)

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: using row_number() over partition by to get datediff by row

    It's easy to do in SQL2012, harder in 2008.

    You didn't specify what determines a patient type, so I took that it is a "endcallcd", as you did partioned by this.

    The...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Making a copy of a table.

    ...

    Took a quick look at it, don't like it as it uses the INFORMATION_SCHEMA views. The MS SQL system views provide much more information that is valuable to fully...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Parsing a variable for a where clause

    Mark Harley (5/29/2013)


    Any other combination?

    These are the possible combinations:

    [1-6][A-Z]

    [1-6][A-Z][A-Z][A-Z]

    [1-6] + [1-6][A-Z][1-6][A-Z]

    I'm beginning to wonder if this is something that should be handled in the application, and then passed through to...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: calcualte Days between 2 dates but exclude weekend - Code not working need help please urgent

    I prefer to use calendar tables for these sort of thing (as it may be required to count in bank holidays and other off-days):

    Example of small dedicated calendar table dedicated...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Parsing a variable for a where clause

    Mark Harley (5/29/2013)


    I have a variable that gets set by a user on a web form, and the user can set that value to something along the lines of '2K...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Making a copy of a table.

    ...

    Any nice ways to make a empty copy of a table including indexes ?

    ...

    There is one I know.

    Develop your own utility to do so.

    Here is the link where you...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: query xml

    Process large xml in chunks.

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: NOLOCK hint.

    Nolock is a way of telling SQL Server that you don't mind if your data is slightly incorrect

    ...

    Yeah, it can for example double count records:

    Slightly incorrect in this case would...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: NOLOCK hint.

    WangcChiKaBastar (5/28/2013)


    we have a high activity transactional database and we have put NOLOCK hints on all SELECT statements...

    for sometime now we are experiencing timeouts inspite of NOLOCK hint

    I thought with...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

Viewing 15 posts - 361 through 375 (of 2,894 total)