Forum Replies Created

Viewing 15 posts - 12,151 through 12,165 (of 15,379 total)

  • RE: Please convert cursor based query to a set based query

    Aside from the subselect this is pretty straight forward. Just change this into a single select statement. I can't quite wrap my head around the whole thing. You need to...

  • RE: MAX()

    anthony.green (5/1/2012)


    couple of ways

    SELECT TOP 1 MAX(dbo.BookedFinance.GrossProfit) AS GP,

    dbo.BookedFinance.FinanceID

    FROM dbo.BookedExtrasList INNER JOIN

    ...

  • RE: varchar desc order

    That looks like you are using that column to hold two pieces of information (rack and BinNumber). It would make things a lot easier if you could separate those.

    If...

  • RE: Using a "RunID" to push data to prod DW but not enable for reporting until later?

    You should have a "staging" environment. This is exactly what this is for. You have Dev, QA, Staging, Prod. I would advise strongly against making your production environment for anything...

  • RE: find different rows in tables

    Did the fast_forward make it better? Given the amount of data you might consider putting this in an SSIS package that can handle looping a lot better than t-sql.

  • RE: find different rows in tables

    hehe no worries. 😛

    Now if I take your ddl and sample data. Then run my code it works just fine.

    CREATE TABLE [dbo].[flightsClosed](

    [recid] [int] IDENTITY(1,1) NOT NULL,

    [FlightID] [int] NULL,

    [StatusTypeID] [int] NOT...

  • RE: find different rows in tables

    wmaa (4/30/2012)


    quotes

    That was a problem but the counts are still off.

    Msg 110, Level 15, State 1, Line 2

    There are fewer columns in the INSERT statement than values specified in the...

  • RE: find different rows in tables

    Something is not quite right with those.

    Msg 110, Level 15, State 1, Line 1

    There are fewer columns in the INSERT statement than values specified in the VALUES clause. The number...

  • RE: find different rows in tables

    wmaa (4/30/2012)


    true

    recidFlightIDStatusTypeIDAircraftIDFlightTimeBlockTimeTTEngine1TCEngine1TTEngine2TCEngine2RegistrationTTAirframeTCairframerecidFlightIDStatusTypeIDAircraftIDFlightTimeBlockTimeTTEngine1TCEngine1TTEngine2TCEngine2RegistrationTTAirframeTCairframe

    118181012520154442.302.502884.802321.002702.102040.00N106SL8849.006351.0070882512520153742.302.402884.802321.002702.102040.00N106SL8846.706350.00

    118194712530314440.600.902884.202320.002701.502039.00N106SL8849.006351.0070896212530311440.600.902884.202320.002701.502039.00N106SL8846.706350.00

    Any chance you can turn that into insert statements for me?

  • RE: find different rows in tables

    I guess that demonstrates that the cursor is working. Short of you posting ddl and sample data there is really nothing else I can do to help.

  • RE: find different rows in tables

    wmaa (4/30/2012)


    why not do if the rows exists then copy to temp table then send email for all rows in temp table and exit when done? that was my...

  • RE: find different rows in tables

    I should have also included that you need to

    close FlightClosedList

    deallocate FlightClosedList

  • RE: find different rows in tables

    OK how about the actual query then all by itself?

    SELECT a.flightId,a.FlightTime,a.BlockTime,a.TTEngine1,a.TCEngine1,a.TTEngine2,a.TCEngine2,a.TTAirframe,a.TCAirframe

    FROM flightsClosed as a

    left JOIN flightsClosed2 b

    ON a.FlightID = b.FlightID

    WHERE a.StatusTypeID != b.StatusTypeID

    AND a.StatusTypeID = 44

  • RE: copy database

    What is the error?

    This will explain the backup database command far better than I could. http://msdn.microsoft.com/en-us/library/ms186865%28v=sql.105%29.aspx

  • RE: copy database

    Try doing a backup and then a restore instead of the copy db wizard. I have never used it and didn't even realize it was an option until just now....

Viewing 15 posts - 12,151 through 12,165 (of 15,379 total)