Forum Replies Created

Viewing 15 posts - 47,386 through 47,400 (of 49,552 total)

  • RE: Newbie Question - Patience Required - restoring .bak

    This is assuming that's a full database backup you have there.

    Open object explorer (F8), connect to your server.

    Expand out the server until you see the folder Databases.

    Right click -> 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: How often should I run an index defrag?

    Depends how fast your indexes get fragmented.

    I've got a job that does a contig check on each table each week and records the results. It then will go and rebuild...

    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_exec_cached_plans

    A proc has to be executed to appear in the procedure cache. Some of the things that can cause plans to be removed:

    service restart (obviously)

    sp_configure (some options when changed)

    Alter 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
  • RE: smalldatetime data type usage.

    I'm guessing the sysdate has a time with it? Datetimes always have a time portion that must be taken into account when comparing

    You've got 2 options.

    You can use a function...

    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: Application Hang / SQL Issue?

    Anything sharing a server with SQL is not recommended.

    Start with the RPC_Completed and Batch Completed events (under Stored procs and T-SQL respectivly)

    Column - Text, cpu, reads, duration, start time,...

    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: smalldatetime data type usage.

    Look up CONVERT in Books Online. There should be an appropriate style 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: Monthly SQL Crashes

    The checkDBs that SQL runs on startup are not complete consistency checks of the entire database. I suspect it's just a check of the system objects.

    DBID 2 is tempDB, but...

    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: Application Hang / SQL Issue?

    Is the application in question running on the SQL Server, or on another machine?

    I would suggest profiler. Start a trace on the SQL Server and watch what the app's doing...

    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: Join Types & Execution Plans

    Hash matches happen in memory, unless the tash table gets too big. In that case, it spils to disk. It's called a hash bailout. There's an event in profiler 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: query to fetch n'th row of a table

    OOps. Sorry about that. That's what I get for answeringh over lunch without checking my syntax....

    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: query to fetch n'th row of a table

    It works rather badly. There's a triangular join in there, with a correlated subquery. The combination will be hell for large rowcounts

    Jeff wrote a nice article on the dangers of...

    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: Deleted data still in database

    *sigh* Users... 😉

    Suggest to him that he scripts the data structure out and then uses BCP to export non-sensitive data. He can then send you the scripts and the exported...

    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 do coalesce with in

    Not without using dynamic SQL.

    The other option is that you can use one of the split functions that are in the script library here to split the string apart into...

    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: EXISTS Subqueries: SELECT 1 vs. SELECT * (Database Weekly 11.02.2008)

    GermanDBA (2/12/2008)


    So the performance winner with select 1 is that the server doesn't take the hit for column checks.

    That's what I understood from Conor's post. It's probably a very, very...

    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 do coalesce with in

    In a where clause, yes. As part of an IN, no. What are you trying to acheive?

    Coalesce is used as follows:

    WHERE SomeColumn = Coalesce(@Param1, @Param2, @Param3,0)

    If @Param1 is not null,...

    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 - 47,386 through 47,400 (of 49,552 total)