Forum Replies Created

Viewing 15 posts - 151 through 165 (of 1,228 total)

  • RE: Query Causing Blocking, Locks Table for 1000 Seconds, Help Needed!

    Velveeta22 (2/13/2015)


    There are 92k rows in the OutBoxData table. Is this query processing 92k rows x each OutBoxAN by using the CROSS JOIN?

    I took the SELECT query that creates...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: Query Causing Blocking, Locks Table for 1000 Seconds, Help Needed!

    You're absolutely right Steve, it's an OUTER APPLY coded using CROSS APPLY! I'd love to see some ddl and dml for the tables referenced within it. If the rest of...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: Query Causing Blocking, Locks Table for 1000 Seconds, Help Needed!

    sgmunson (2/12/2015)


    ChrisM@Work,

    Just curious, but I've never seen anyone use an ON clause together with CROSS APPLY. Given that it's an ON 1=1, it would seem to be completely...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: Want to create random alphanumeric characters for primary key values

    carrieathomer (2/11/2015)


    let us assume i am going to store documents.

    for every document i am going to set a primary key that will be an alphanumeric value (may be 4 digits)

    n...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: Want to create random alphanumeric characters for primary key values

    carrieathomer (2/11/2015)


    i need to create random alphanumeric characters as primary key values when inserting a record.

    eg: cmSbXsFE3l8

    it can start from 4 digit characters and can grow to 6, 7 as...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: query tuning help - cross apply

    Nevyn (2/5/2015)


    What is the OR for anyway?

    Doesn't the WHERE clause within your apply guarantee that the both of those values are the same, meaning that the conditions are always both...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: Query fast one day, slow the next day - can indexes go bad

    Tom John-342103 (2/5/2015)


    The problem was solved by running some index rebuilds. So frustrating when people aren't careful about performing routine maintenance.

    Index rebuilds = plan recompiles. There are a few...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: How to compare a list of numbers, kind of like lottery results

    robert.wiglesworth (2/5/2015)


    This isn't for a project I am currently working on, but I have been curious about how you could make this comparison:

    Say you have a table that has records...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: incrementing alpha string using SQL

    Jeff Moden (2/2/2015)


    My last response on this was nearly a decade ago. I no longer believe that recursion of a scalar function would be the right way to go...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: CASE vs ISNULL? Which is faster?

    shadabkhan87 (2/1/2015)


    Hello everybody,

    I have a task to be accomplished at work and would like to ask you a question about it.

    To give you a little background, there is a...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: Need to increase query performance

    prasadau2006 (1/28/2015)


    Hello Friends,

    I need help with the following query, this query is taking more than 20mins to complete. I'm using a left join to

    pull the data.

    Query:

    Insert into dbo.SecondTable

    Select b.*...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: need help with Sql statement using case and join together

    Lookup OR in Books Online, the help system for SQL Server. Also, look at the difference between IF, which conditionally runs statements, and CASE, which operates within a statement.


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: How to optimize the below query?

    toraghubiz (1/28/2015)


    ...

    Could you optimize the query so that we calculate only the departments with more than 1000 employees?

    That's illogical, captain.

    What you could do is precalculate, using insert/delete triggers on the...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: select statement from history table

    Saujib (1/26/2015)


    Project has 2 tables process(parent) and processchild(child).

    Project workflow recorddsany changes to these tables as a history.

    I want to find out all the process that are in status =...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: ID or Id

    Koen Verbeeck (1/20/2015)


    GilaMonster (1/20/2015)


    I use ID, everyone else in my company uses Id.

    So, you switch places with Phil and everything is settled then. 🙂

    Phail & Gil 😀


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

Viewing 15 posts - 151 through 165 (of 1,228 total)