Forum Replies Created

Viewing 15 posts - 19,816 through 19,830 (of 49,552 total)

  • RE: Comparison in Where or Having Clauses NOT working

    No, nvarchar and nchar don't require conversions. Now if one had been varchar or char you should make the change, but both being unicode is 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
  • RE: how to shrink temp db

    Second the restart recommendation. It is documented that shrinking TempDB while in use can cause corruptions that will force a restart.

    Also you need to investigate what caused the growth,...

    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: Log backup failure

    Post command used and exact error message please.

    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: Comparison in Where or Having Clauses NOT working

    Then that's a likely cause. Old-format stats can affect just about all queries.

    Look up UPDATE STATISTICS. Suggest all tables WITH FULLSCAN.

    Also make sure that he's done the recommended consistency checks...

    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: Comparison in Where or Having Clauses NOT working

    Did you update all statistics after the upgrade.

    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 the usage of Temporary table

    gugan_ta (3/12/2012)


    You can try this..but I'm afraid this can be standard soln...go for ##table

    There is no need for a global temp table here.

    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 the usage of Temporary table

    chandrika.r 91171 (3/12/2012)


    Thank you Gila..It worked for me.but just want to know Is there any disadvantage in using local temporary table?

    No, it's almost the same as a table variable, may...

    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: Restoring a database.

    No, restoring a database over an existing one will always replace it entirely. You can't merge two databases with restore.

    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 the usage of Temporary table

    If you absolutely need the dynamic SQL, this will work.

    CREATE TABLE #tbl_temp (ApplicationId int,ACPId int)

    Declare @SqlQuery varchar(max)

    insert into #tbl_temp values(444,12215)

    insert into #tbl_temp values(444,13801)

    set @SqlQuery='select * from Invoice I inner join...

    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 the usage of Temporary table

    MysteryJimbo (3/12/2012)


    The only way you can make a temporary table globally visible (not table varible that you declared) is to use create table ##tablename(column int)

    Errr, no need for global temp...

    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 the usage of Temporary table

    Use a temp table instead of a table variable, that way it will be visible within the scope of the dynamic SQL (which I still see no reason 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: Regarding the usage of Temporary table

    The table variable has no visibility within the dynamic SQL, it's only visible in the scope that it's declared in.

    That said, there is absolutely no need for dynamic SQL 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: Re indexing database.

    What was the exact command that you used? How big are the tables in question (how many pages)?

    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 2012 - Column Store Index

    Star Trek (3/12/2012)


    When we say it is read only what happens if I insert fresh rows into the table having columnstore index?

    The insert will fail. Any table with a columnstore...

    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: Cursor row-by-row updates

    You could likely do it in a single update with ntile.

    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 - 19,816 through 19,830 (of 49,552 total)