Forum Replies Created

Viewing 15 posts - 28,561 through 28,575 (of 49,552 total)

  • RE: SQL Server 2008 doesn't recognize table ??

    So given the table schema that you posted, which columns are used to determine if a row already exists?

    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: SQL Server 2008 doesn't recognize table ??

    h.v.neerven (1/9/2011)


    Hello GilaMonster,

    Youre script is indeed correct, but this does affect 0 rows:

    INSERT INTO Table2 (C1,C2,C3)

    SELECT C1, C2, C3

    FROM Table1

    WHERE NOT EXISTS (SELECT 1 FROM Table2 WHERE Table1.C2 = Table2.C2...

    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 GUID -> numeric value out of range

    Please post new questions in a new thread. Thanks.

    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: SQL Server 2008 doesn't recognize table ??

    The script that I gave you will do exactly what you asked. If that's not what you want, then you need to refine the requirements. The exists checks the combination...

    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: SQL Server 2008 doesn't recognize table ??

    SELECT C1, C2, C3

    FROM Table1

    WHERE NOT EXISTS (SELECT 1 FROM Table2 WHERE Table1.C2 = Table2.C2 AND Table1.C3 = Table2.C3)

    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?

    Tom.Thomson (1/9/2011)


    It irritated me by its very "USA is the centre of the world" orientation, it's giving greater priority to American pop culture than to the battles in Europe (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: SQL Server 2008 doesn't recognize table ??

    What do you define as 'exists'? All columns matching?

    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: SQL Server 2008 doesn't recognize table ??

    h.v.neerven (1/9/2011)


    I now understand indeed select 1, it is the same as select *, read it on the internet.

    No it's not.

    SELECT 1 returns the constant value 1 for all rows.

    SELECT...

    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: SQL Server 2008 doesn't recognize table ??

    That's not the same as your previous query. The previous one compared on multiple columns.

    Question is, does the select (ignore the insert for now) return the rows that you want...

    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: SQL Server 2008 doesn't recognize table ??

    That might work, but it's very bad form. Have a look at the NOT EXISTS construct, which is specifically for finding matching (or non-matching) rows

    SELECT <Whatever>

    FROM <SomeTable>

    WHERE NOT EXISTS...

    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: SQL Server 2008 doesn't recognize table ??

    It may be in the database, but it's not referenced in the select statement.

    The select must be a valid statement on it's own. You can't reference a column in 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: Performance tuning tips for beginners

    To expand on that, less logic and processing goes into the missing index DMV entries than into the suggestions from DTA (database tuning adivsor) and even that's often questionable.

    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: Introduction to Indexes

    tfifield (1/7/2011)


    Thanks. I'm looking forward to the next articles..

    No need to look forward. The links at the bottom of this article will take you straight to them. These were...

    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: sys.dm_db_index_physical_stats

    TalkToLee (1/7/2011)


    The higher levels of the index are generally not large enough for fragmentation to matter, and they're far more likely to be in memory where fragmentation doesn't matter.

    Make sense...

    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: Point in Time restore versus Full Restore

    Donalith (1/7/2011)


    I was told that both types of restore require the same space requirements. Is this true? If I have a 400 gig database do I need another 400 gigs...

    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 - 28,561 through 28,575 (of 49,552 total)