Forum Replies Created

Viewing 15 posts - 39,931 through 39,945 (of 49,552 total)

  • RE: Challenging SQL interview questions

    Paul White (4/6/2009)


    My entirely personal view is that if someone is able to talk a little about things like the 'halloween problem' in an interview, it shows they have an...

    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: Query using Index Scan instead of Index Seek

    Your index seek (when you get it) is only on sourceID. FirstName and LastName cannot be part of the index seek operation because they're contained within functions.

    Try this and see...

    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: Just Walk Away - Blacklisting - and Twits without Twitter

    Bob Hovious (4/6/2009)


    Something amiss here. I see only threads in which this person has participated, not originated. If my tired old eyes just can't find it,...

    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: Eliminate rows

    What's the logic for which row remains? For the first set of dupes, you had 021427 for Column1, for the second you had 021470.

    This is trivial to do 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: How to display number of rows in each table in database

    sturner (4/6/2009)


    I always use this:

    select rowcnt from sys.sysobjects O JOIN sys.sysindexes I on O.id = I.id and indid = 1 where type = 'U' and name = 'TABLENAME'

    That works, but...

    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: Just Walk Away - Blacklisting - and Twits without Twitter

    Bob Hovious (4/6/2009)


    I've looked at the thread participation link before, but it's kind of buried away. What's needed is a more quickly accessible option that focused on threads...

    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: How to display number of rows in each table in database

    xgcmcbain (4/6/2009)


    select max(s.name), count(c.columns) from sysobjects s inner join syscolumns c on s.name = c.name where type='table'

    That'll get the number of columns, not of rows.

    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: How to display number of rows in each table in database

    If you just want a quick and dirty, query sys.partitions

    select object_name(object_id) AS TableName, sum(rows) AS TotalRows from sys.partitions

    where index_id in (0,1)

    group by object_id

    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: Resolving Deadlocking problems

    Dean Jones (4/6/2009)


    Also, I have read that one can use TRY/CATCH to do retries in order to solve deadlocking problems.

    It won't solve the deadlock. It will just allow your code...

    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: Huge not performant tabled valued Function

    GilaMonster (4/6/2009)


    J-F Bergeron (4/6/2009)


    Now, they are asking me to insert that "Price calcullation" within a query that will be used in the products screen. So when they will query a...

    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: Just Walk Away - Blacklisting - and Twits without Twitter

    Bob Hovious (4/6/2009)


    I know I'm in the minority, but I think the practice of compiling and referring people to previous questions by the OP should be extended to new threads....

    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: Huge not performant tabled valued Function

    J-F Bergeron (4/6/2009)


    Now, they are asking me to insert that "Price calcullation" within a query that will be used in the products screen. So when they will query a vendor...

    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: Query tuning

    Please note that the fixing portion of this article is solely looking at indexes. Nothing whatsoever on badly-written queries. That's another article and one that Tony will likely be nagging...

    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: Query Doubts

    Vijaya Kadiyala (4/6/2009)


    Simple tip about WHERE Condition, If you have "n" tables in FROM Clause then you need to have minimum n-1 where conditions to avoid any cross joins.

    Better suggestion,...

    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: Query tuning

    prvreddy (4/6/2009)


    Hi,

    1) Assume i have a stored procedure. It is taking more time, then what are key steps we look into about that query. I mean how do we do...

    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 - 39,931 through 39,945 (of 49,552 total)