Viewing 15 posts - 12,151 through 12,165 (of 15,379 total)
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...
May 1, 2012 at 8:58 am
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...
May 1, 2012 at 8:23 am
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...
May 1, 2012 at 7:43 am
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.
May 1, 2012 at 6:58 am
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...
April 30, 2012 at 2:42 pm
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...
April 30, 2012 at 2:34 pm
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...
April 30, 2012 at 2:24 pm
wmaa (4/30/2012)
truerecidFlightIDStatusTypeIDAircraftIDFlightTimeBlockTimeTTEngine1TCEngine1TTEngine2TCEngine2RegistrationTTAirframeTCairframerecidFlightIDStatusTypeIDAircraftIDFlightTimeBlockTimeTTEngine1TCEngine1TTEngine2TCEngine2RegistrationTTAirframeTCairframe
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?
April 30, 2012 at 1:57 pm
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.
April 30, 2012 at 1:53 pm
wmaa (4/30/2012)
April 30, 2012 at 1:43 pm
I should have also included that you need to
close FlightClosedList
deallocate FlightClosedList
April 30, 2012 at 1:38 pm
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
April 30, 2012 at 1:36 pm
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
April 30, 2012 at 1:35 pm
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....
April 30, 2012 at 1:30 pm
Viewing 15 posts - 12,151 through 12,165 (of 15,379 total)