Forum Replies Created

Viewing 15 posts - 32,356 through 32,370 (of 49,552 total)

  • RE: Sub-query with Case..When..Else (SQL Server 2000)

    You're missing the END from the CASE

    CASE

    WHEN ...

    ELSE ...

    END

    CREATE PROCEDURE StoredProcedure1

    AS

    SELECT

    Id, EntryDate, Product, ProdPrice, Qty, Rtn,

    (SELECT

    CASE [X].Rtn

    WHEN 0 THEN SUM([X].[Qty] * [X].[ProdPrice])

    ELSE SUM([X].[Qty] *...

    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: resore db

    Type the name of the DB you want it restored as at the top of the restore dialog.

    You're probably right-clicking the database 'abc' and selecting restore. Don't. Right click 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: Are the posted questions getting worse?

    CirquedeSQLeil (6/18/2010)


    And just about anything I plug into a wall down here in LV. Dirty dirty electricity. When you have to pay in gold bullion, you would expect...

    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: Where CreatedOn = dateadd(day, -1, getdate()) {exclude weekend}

    No. Threads can't be deleted.

    If you post in the wrong place, you can either report the post and request that it be moved, or post a new thread and update...

    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: Where CreatedOn = dateadd(day, -1, getdate()) {exclude weekend}

    Please don't cross post. It just wastes peoples time and fragments replies.

    No replies to this thread please. Direct replies to: http://www.sqlservercentral.com/Forums/Topic939716-149-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: TSQL query Performance Issue

    VinicioAizpurua (6/18/2010)


    Did you move your query from 2000 to 2008? I am experiencing the same performance issue. I have a SP that run in about1/2 sec in 2000 and 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: with only read access, How can you view the stored proc?

    If you just want to view the proc, you can grant view definition rights on 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: 2 consistency errors in database 'msdb'

    It is safe to restore an old backup, you'll lose backup and job history and any new jobs. It's generally not recommended to repair msdb anyway.

    Fix the disks first though...

    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: Recover corrupted mdf file - SS 2000

    sparky-407434 (6/18/2010)


    DBCC CHECKDB REPAIR_ALLOW_DATA_LOSS

    No point. If checkDB can't complete a check (in this case because the system tables are damaged) there's no way it's going to be able to repair...

    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 with Included Columns and Index Fragmentation

    Are you increasing the size of the varchar? (null to non-null)? That will fragment the index because you're increasing the size of the index row.

    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: Recover corrupted mdf file - SS 2000

    Not repairable. Sorry, DB's a loss.

    You may be able to extract some data with it in emergency mode. Some objects will likely fail to script, some will fail to export....

    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: Recover corrupted mdf file - SS 2000

    Before you try a repair, let's see how bad it is.

    DBCC CHECKDB (<Database Name>) WITH NO_INFOMSGS, ALL_ERRORMSGS

    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: WTF?? concatenating Date and time varchar fields messes up the milliseconds!!

    Eugene Elutin (6/18/2010)


    Also, INT is implicitly convertable to datetime!

    DECLARE @NotADate INT, @ADate DATETIME

    SET @NotADate = 20100618

    SET @ADate = @NotADate

    When an int is cast to a datetime, SQL takes...

    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: WTF?? concatenating Date and time varchar fields messes up the milliseconds!!

    Please, no. Storing dates as integers in that format makes any form of manipulation far harder than it needs to be. If the date can't be stored as a date...

    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 use CURRENT DATE correctly?

    That doesn't look like SQL Server syntax. CurrentDate isn't a SQL function and that 'integer 5' is also not t-SQL.

    The SQL Server way of doing that would be

    SELECT dateStartTime FROM...

    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 - 32,356 through 32,370 (of 49,552 total)