Forum Replies Created

Viewing 15 posts - 10,636 through 10,650 (of 18,923 total)

  • RE: Help with row_number()

    That makes more sens... too bad I don't have sql 2k5 to test it.

  • RE: Updating a table using a Stored Procedure as source

    This might work better :

     

    update MT set

     MT.one = MS.uno

    ,MT.two  = MS.due

    ,MT.three  = MS.tre

    from dbo.mytable MT INNER JOIN #MySource MS ON MT.dte = MS.dte

    where source.type = 'BUY'

  • RE: Help on a Query on sysjobshistory

    I'm normally a performance freak... but since this is a daily report, I guess it won't kill the server to have a suboptimal query

  • RE: Help on a Query on sysjobshistory

    And that's why we usually ask for sample data.  Now let me go buy some new eyes and I'll be right back.  Thanx for letting us know

  • RE: User Count By the Half Hour

    Change COUNT(*) TO SUM(WorkCounts) depending on your needs, this will give you something to start with :

     

    CREATE TABLE #Demo (UserID INT NOT NULL, ViewDate DATETIME NOT NULL)

    INSERT INTO #Demo (UserID,...

  • RE: Help with row_number()

    I don't wanna be a pain in the *** but that update statement ain't cutting it for me (sql 2000). I don't think this feature was changed in 2k5...

  • RE: User Count By the Half Hour

    What is the datatype of the time column?

    And do you want the count of rows, or the sum of workStartCount?

  • RE: Help with row_number()

    Or another much less costly solution :

    CREATE TABLE #WorkTable (ClientID, RegionID)

    CREATE UNIQUE CLUSTERED INDEX IX_WorkTable ON #WorkTable (ClientID, RegionID)

    Insert into #WorkTable (ClientID, RegionID)

    Select CliendID, RegionID FROM dbo.ClientsRegions GROUP BY...

  • RE: Help with row_number()

    I don't see how the update can solve the problem.  The update needs to know which row to update (unique id of sort some).  And since there are duplicates in...

  • RE: "Parent" SQL statement that causes the TRIGGER?

    Yes it can be done with dbcc inputbuffer () from within the trigger.  However I don't have a code sample.

  • RE: Running Delete on a Very Large table

    Thanx, that's all I needed to know!

  • RE: Lawyer Time

    Seriously guys, can we get the answers to these?

    1 -

    What do you call 500 lawyers at the bootom of the sea ?

    2 -

    what do you call a...

  • RE: Best Practices needed on Massive Deletion in 24/7 production environment

    Just throwing this out there... don't have any kind of revelant experiance with such a massive amount of data.

     

    Is there any way you could buy an entirely new server, transfer...

  • RE: Single Quote Usage in Query

    I would suggestyou don't focus on that point at the moment.  The best solution is to use a double single quote.  And an even greater solution would be to use...

  • RE: sql query

    You're right on track.  Here's the missing step you need :

    Select * FROM mwcas INNER JOIN

    (Select chartnumber, max(lastvisitdate) AS mLastVisiteDate from mwcas group by chartnumber) dtMax ON mwcas.ChartNumber = dtMax.ChartNumber AND...

Viewing 15 posts - 10,636 through 10,650 (of 18,923 total)