Forum Replies Created

Viewing 15 posts - 46,771 through 46,785 (of 49,552 total)

  • RE: Index Implementation Question

    matt stockham (4/24/2008)


    I agree with the above, however the non-leaf pages still need to be read - if the less selective column is first it can potentially mean more reads...

    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: NULL & Count()

    karthikeyan (4/24/2008)


    it means select @Null = count(*) from #t1 where Age is null. do u agree till this point ?

    No!

    It means

    select @Null = count(*) from #t1 where 'Age'...

    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: Index Implementation Question

    No. You can generalise my 2 column example to as many columns as you have in the index.

    For example, a 3 column index (A, B, C) is most optimal for...

    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: NULL & Count()

    Scalar = single value

    Hence, the where clause you had (@Nm IS NULL) is a scalar (single value) evaluation, because it's a single value (the contents of the variable) been compared...

    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: NULL & Count()

    Yes, and I did. See the last post on page 1.

    If there's anything you're still not sure of, ask specifically.

    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: Index Implementation Question

    I've seen a case where a person took the most-selectivel advice literally, and made the leading column of every index the primary key (an identity)

    He was very curious as 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: SQLSERVERAGENT EventId 203 error

    Please don't cross post. Many of us read all the frums.

    No replies to this thread please. Direct all replies to-

    http://www.sqlservercentral.com/Forums/Topic489793-7-1.aspx

    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: Index Implementation Question

    And some testing...

    SET STATISTICS IO ON

    GO

    SET STATISTICS TIME ON

    GO

    CREATE TABLE TestingIndexOrder (

    ID INT IDENTITY,

    DayOfWeek smallint,

    CustomerKey int

    )

    GO

    insert INTO TestingIndexOrder (DayOfWeek, CustomerKey)

    SELECT DATEPART(dw,DATEADD(dd,number, '1900/01/01')), FLOOR(RAND(number*5452)*1000)

    FROM (

    SELECT TOP 4000000 v1.number,...

    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: Dynamic SQL

    If the values aren't in quotes, SQL interprets then as columns.

    Try something like this (partial query only)

    INSERT INTO ....

    SELECT ''' + @EmployeeCode + ''', ....

    Easiest way to find and...

    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: downgrade data from sql server express edition 2005 to sql server 2000

    In management studio, right click the database Tasks ->Generate scripts

    Script everything out. Then run that script on your sQL 2000 server. Taht will create the shell of the DB. All...

    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: Restore Data only without Backup

    If the database has never had a full backup, even in full recovery it won't keep the logs. There has to be a full backup taken before SQL starts retaining...

    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: Index Implementation Question

    Oh, and with the selectivity you're talking about (1000 unique values in 10 million rows), if that index is not covering, SQL is not going to use that index. Too...

    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: Index Implementation Question

    The index is implemented much like a telephone directory. If you have a composite index (colour, age as a very contrived example) then the index pages look something like this

    Black...

    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: downgrade data from sql server express edition 2005 to sql server 2000

    You'll have to script the database structure, bcp the data out and then recreate the DB on SQL 2000 and import the data. There's no downgrade option for 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: problem with database restoring itself?

    Check the database's status in the sys.databases view. Is it restoring or recovering?

    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 - 46,771 through 46,785 (of 49,552 total)