Forum Replies Created

Viewing 15 posts - 40,066 through 40,080 (of 49,552 total)

  • RE: How to handle apostrophes

    You escape quotes by doubling them.

    Set strwhere = 'C.IT_Code IN (''A'',''E'',''C'',''P'',''R'',''O'') AND SP.Status=''S'' and SP.PayDT <> ''********'' AND (NOT (C.ContractStatus IN (''D'', ''X'')))'

    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: Table Design issue

    Is that table properly normalised? Do all of those columns belong in 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: TempDB

    pedro.ribeiro (4/1/2009)


    Hi masters,

    I'm thinking in putting some staging tables on tempdb.

    This are empty tables that receive some data from a bulk insert and then i...

    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: Order By Clause Different in SQL2000 vs. SQL2005

    Mark Douglass (4/1/2009)


    Can you say sheepish quiet?

    Yup. Seen it enough times with devs that I used to work with. Usually after they had told me that a query was running...

    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: Select count(*) from....

    Vijaya Kadiyala (4/1/2009)


    You can even use Column Name in palce of * but it depends on the requirement.

    You can, but it'll very likely be slower than count(*). Also COUNT(Column)...

    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: Select count(*) from....

    pandeharsh (4/1/2009)


    SELECT rows FROM sysindexes WHERE id = OBJECT_ID('table_name') AND indid < 2

    That's not guaranteed accurate. Also, sysindexes is a deprecated system view and will be removed in future versions....

    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?

    Lynn Pettis (3/31/2009)


    Does this mean that the posts may be gettng better, or are we just showing greater tolerance for the moment??

    Better? I think not. So far today:

    What's a production...

    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: Store Procedure Codes

    Lynn Pettis (4/1/2009)


    Also, to be sure, are you still using SQL Server 2000?

    Nope, that's 2005 or 2008. There's a CTE and a pivot in there. I'm requesting a move 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: Order By Clause Different in SQL2000 vs. SQL2005

    Mark Douglass (4/1/2009)


    Since we JUST upgraded this server from 2000->2005 the week before, he claimed that this behavior was a problem with the new install of 2005.

    Why do developers...

    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: Consistency Errors in Tables

    gregorybrunner (4/1/2009)


    In our testdatabase we run DBCC CHECKTABLE REPAIR_ALLOW_DATA_LOSS and the

    table becomes clean. Unfortunately we lost 12 records. Is there a way to get this table

    clean without the loss...

    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?

    Jeff Moden (3/31/2009)


    does anyone know what "sleep" means? :hehe:

    Sorry, not a clue.

    I think it's that thing you're supposed to do late at night, you know when we're still working.

    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: Order By Clause Different in SQL2000 vs. SQL2005

    Mark Douglass (4/1/2009)


    My question is why does it ignore the table designation on the ORDER BY statement.

    I just want to understand why the behavior works the way 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: MSSQL Query Optimizer does not include BIT fields in its optimizations

    Peso (4/1/2009)


    Not necessarily. With SQL 2008 comes the ability of Filtered Indexes.

    You can create an index on Bit1 = 1 only.

    Sure you can, but that doesn't change the selectivity rules....

    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: MSSQL Query Optimizer does not include BIT fields in its optimizations

    ABurton (3/31/2009)


    A vendor has requested that I change all BIT fields to TINYINT because, as they say, the MSSQL Query Optimizer does not include BIT fields in its optimizations.

    They're...

    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: Order By Clause Different in SQL2000 vs. SQL2005

    Mark Douglass (3/31/2009)


    On the original query, the ss.[Start_Date] identifier sorts by the converted value on both SQL2000 and SQL2005. We've verified that on 2 different servers with the same database....

    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 - 40,066 through 40,080 (of 49,552 total)