Forum Replies Created

Viewing 15 posts - 136 through 150 (of 151 total)

  • RE: Deleting thousands of rows in a table

    mipo, Could you do the deletes in several, smaller batches?

    
    
    WHERE DateDiff(mm,transactiondatestamp,GetDate()) = 4
    .
    .
    WHERE DateDiff(mm,transactiondatestamp,GetDate()) = 3

    Or, if it's particularly large, maybe do DateDiff(dd,transactiondatestamp,GetDate()) = 90,...

  • RE: EXEC xp_cmdshell

    Can you successfully type the commands manually?

  • RE: EXEC xp_cmdshell

    We do this all the time at this company. The only diff I can see between what you're doing and what we do is:

    ftp -s:D:\filepath\scriptfilename.txt http://ftp.site.com

    No quotes around...

  • RE: How to set Proc Arg to default to today?

    Robby,

    Yeah... looks like T-SQL doesn't like function calls in proc declarations. I didn't know that. You could set the date to GetDate() after the parameter declarations:

     
  • RE: whats the name of the sproc?

    R, can you reference the @@PROCID global variable in the INSERT statement within the trigger?

     
    
    INSERT INTO <logtable>
    ...
  • RE: AVG # of cases created per DAY

    Nickel, David's got the goods on this one! The only thing I'd add is consider an index on your startTime column. Also, if you're concerned with fractional results, maybe use...

  • RE: AVG # of cases created per DAY

    Nickel, to answer your second question, I cut and pasted the code for the second query from an existing proc on one of our databases. We use the WITH (NOLOCK)...

  • RE: AVG # of cases created per DAY

    Ah, yes. To get average you were looking for...

     
    
    SELECTYear(startTime),
    Month(startTime),
    Day(startTime),
    Count(*)
    FROMDQCaseStartTime WITH (NOLOCK)
    GROUP BYYear(startTime),
    Month(startTime),
    Day(startTime)
    COMPUTEAvg(Count(*))

    SJTerrill

  • RE: AVG # of cases created per DAY

    Do you need to show days with 0 cases? If not...

     
    
    SELECT Year(startTime),
    ...
  • RE: Help me beat Excel - PLEASE!

    Hans, I didn't make it clear what I was responding to.

    Billy's post indicated a dilemma over sparsity of data. Though the temp table approach is definitely more intensive I/O-wise, it...

  • RE: Help me beat Excel - PLEASE!

    Apologies in advance if I'm over-simplifying this (I'm not much on finance).

     
    
    CREATE TABLE#Performance
    (
    Entityvarchar(40),
    ThisDaysmalldatetime,
    PreviousDaysmalldatetime,
    Performancefloat
    )
    
    
    INSERT INTO#Performance
    (
    Entity,
    ThisDay,
    PreviousDay
    )
    SELECTPER1.Entity,
    PER1.ThisDay,
    Max(PER2.ThisDay) 'PreviousDay'
    FROMtblPerformance PER1
    LEFT OUTER JOIN
    tblPerformance PER2
    ON...
  • RE: SET vs SELECT

    Yikes. You're right. I stand corrected.

  • RE: SET vs SELECT

    One more hand up to agree with click-fund's take on the aesthetics of SET and SELECT

    quote:


    The reason I don't encourage this is...

  • RE: Suggestions on a Query

    Could you create a proc that gets kicked off as part of a daily job that inserts a 0 quantity record for yesterday if there's no record for yesterday? If...

  • RE: Concat with conditional if's

    Is there any way you can increase the width of the resulting number from 5 to, say, 10? And the underlying column, of course.

    
    
    SET @PalNumLen...

Viewing 15 posts - 136 through 150 (of 151 total)