Forum Replies Created

Viewing 15 posts - 3,391 through 3,405 (of 49,552 total)

  • RE: Using Subqueries as Calculated Fields

    drew.allen (3/29/2016)


    Secondly, it will probably be more efficient to group the orders before performing the join, especially if there is an index on the orders table that starts with custid.

    If...

    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: Joining Multiple Tables

    Fixed query

    SELECT prod_name,

    vend_name,

    prod_price,

    quanity

    FROM orderitems

    ...

    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: Error in dynamic sql

    and what's the error message?

    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: Combining two qureies to one

    Try

    SELECT Systems.SiteNumber AS 'SiteNumber',

    PolicyAudit.PolicyID AS 'PolicyID',

    CASE WHEN Coverstartdate IS NULL THEN ''

    ...

    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: user defined function causing error

    No idea, because the error thrown doesn't match the code.

    Could be missing begin/end, could be some of those 'other minor changes' you made. Without seeing the code that throws the...

    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: Varchar usage

    yb751 (3/29/2016)


    I could have sworn I remember reading that declaring larger column sizes than required could cause some inefficiencies. i.e. incorrect estimates, over allocating memory...

    I wouldn't be surprised if...

    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: Varchar usage

    Key columns only. If an insert/update would make an index key over 900 bytes, the insert update will throw an error and fail.

    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: Varchar usage

    An index key is limited to 900 bytes. If I'm indexing, then I know that it's safe to put a varchar(10) into an index key, but if that's varchar(8000), then...

    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: Varchar usage

    Space used + 2 bytes.

    As for make everything varchar(8000), why? Is a person's first name going to be thousands of characters long? A city name? A company name? An address...

    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: Regarding extra space being used by Index after re-indexing

    There's no problems with free space in the DB.

    The extra space is there because a reindex creates the new index and then drops the old one. Hence you need free...

    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: Who is using a specific table

    You'll need something like extended events or SQLAudit for 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: Does it make a sense to use parallelism for single HD drive ?

    SQL Guy 1 (3/28/2016)


    I always thought that parallelism is about I/O, with dedicating a CPU to each I/O stream.

    Not at all. Mostly because the query processor doesn't know what...

    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: Are the posted questions getting worse?

    SQLRNNR (3/24/2016)


    Anxiety on the other hand is a different story. Anxiety is fear driven and is harder to overcome.

    I can vouch for that.

    Being anxious requires putting on 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: Looking for the best way to create a comma-delimited values string for each record sin resultset without a cursor.

    I like to use the FOR XML PATH method. It's detailed here: https://www.simple-talk.com/sql/t-sql-programming/concatenating-row-values-in-transact-sql/

    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: Instead Of Trigger to pseudo-update computed column

    bartedgerton (3/24/2016)


    it's just that the query optimizer isn't smart enough to realize that the INSTEAD OF trigger is properly handling the status ID, so that the insert/update would work fine,...

    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 - 3,391 through 3,405 (of 49,552 total)