Forum Replies Created

Viewing 15 posts - 6,376 through 6,390 (of 49,552 total)

  • RE: help left join

    ichayan2003 (3/19/2015)


    it is my understanding that we could do the same with left/right join. if not please advice what other option we have, if any

    Did you read the articles?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Stairway to T-SQL Part 2: Beyond T-SQL Basics: Level 3: Building a Correlated Subquery

    Dennis Wagner-347763 (3/6/2014)


    The correlated subquery may be executed many times. It will be run once for each candidate row selected in the outer query.

    I believe that Jeff Moden refers to...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Inline vs. Multi-Statement Table-Valued function, Temp Tables vs. CTEs?

    Katerine459 (3/19/2015)


    GilaMonster (3/19/2015)


    Katerine459 (3/18/2015)


    Unless the CTE is also a correlated subquery, wouldn't it just run once

    And who said that a correlated subquery doesn't run just once?

    I read that here:...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: help left join

    http://sqlinthewild.co.za/index.php/2010/03/23/left-outer-join-vs-not-exists/

    http://sqlinthewild.co.za/index.php/2010/02/18/not-exists-vs-not-in/

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: help left join

    If the NOT IN works, why do you want to use a LEFT OUTER JOIN?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Read Committed Snapshot.

    There's massive differences between the two. Start with the sections on isolation levels in the SQL Books Online, there's a lot of information there.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Need help in simple query

    Zohaib Anwar (3/19/2015)


    I have same products with same CompanyID's so I cant update CompanyID or product and I need to show them as a single row.

    You've got duplicate rows that...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Need help in simple query

    Zohaib Anwar (3/19/2015)


    Ok, Thanks for the explanation.

    select * from A INNER JOIN B ON A.ID=B.ID

    Please let me know how can we modify above query so that it will gives...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Need help in simple query

    Zohaib Anwar (3/19/2015)


    and I Need to do inner join on both tables in order to get matching rows from both tables based on Company_ID .

    And I have same CompanyID's...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Need help in simple query

    No, SQL is not doing a cross join. It's doing an inner join.

    When you have duplicate rows then you will see more rows coming back from a join than you...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Need help in simple query

    No, SQL's giving you an inner join, it's just that your data has every row in one table matching every row of the other table because they're all the same...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Help with tsql querry

    You have to use CREATE TABLE or preferably deal specifically with inserted and/or deleted directly.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Help with tsql querry

    raza.qadri (3/19/2015)


    job_order is primary key so always single value:

    Set @job_order = Rtrim(Ltrim((SELECT job_order FROM #trig)))

    No.

    If the operation that fired that trigger affected multiple rows, there will be multiple rows in...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Urgently need help with encryption

    Jeffery Williams (3/19/2015)


    This time I am using the EXACT code posted on MS.

    Not quite.

    Your example: The column you're encrypting you said was varchar(10)

    MS's example (using Adventureworks), the column that's being...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Help with tsql querry

    You're creating the temp table twice within the batch. The parser doesn't execute conditionals, it just sees two creations of the same temp table. CREATE TABLE and then insert into.

    That's...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 15 posts - 6,376 through 6,390 (of 49,552 total)