I'm struggling to find a suitable solution to this. I have a fairly large SQL Server 2005 database containing 250+ tables (many with key constraints) and a whole bunch of data.
I need to essentially copy all of these tables and the data and the constraints exactly from one database to another. I'm basically duplicating database A (SQL Server 2005) to produce an exact copy database B (SQL Server 2008) on a different domain so we end up with two completely identical databases running in parallel, each with their own identical data to begin with.
I just need to get the tables and the data intact from A to B. To use the log-in credentials for database B and it should work.
All the operations on SQL Server 2008 (currently in use)
Having two cases
I've also tried right clicking database A in Management Studio and going to Tasks > Generate scripts. But when I do this and run the SQL scripts on database B I get a whole load of errors to do with foreign keys etc. As it imports the content. It seems like it's doing the right thing, but can't handle the different keys/relationships.
If I copied the content without this then it will copied successfully have no 'IDENTITY' and no 'Constriants', but I need whole things Identity as well as constraints.
Case (1):
Error 0xc0202009: Data Flow Task 30: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005. An OLE DB record is available. Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80004005 Description: "
Violation of PRIMARY KEY constraint 'PK_TFL'. Cannot insert duplicate key in object 'dbo.TFEATURE_LOC'.".
Error 0xc0209029: Data Flow Task 30: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "input "Destination Input" (343)" failed because error code 0xC020907B occurred, and the error row disposition on "input "Destination Input" (343)" specifies failure on error. An error occurred on the specified object of the specified component. There may be error messages posted before this with more information about the failure.
Error 0xc0047022: Data Flow Task 30: SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on component "Destination 148 - TFEATURE_LOC" (330) failed with error code 0xC0209029 while processing input "Destination Input" (343). The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running. There may be error messages posted before this with more information about the failure.
Error 0xc02020c4: Data Flow Task 30: The attempt to add a row to the Data Flow task buffer failed with error code 0xC0047020.
Error 0xc0047038: Data Flow Task 30: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on component "Source 146 - TEXT_US_CA_MX_CITY" (109) returned error code 0xC02020C4. The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing. There may be error messages posted before this with more information about the failure.
Error 0xc02020c4: Data Flow Task 30: The attempt to add a row to the Data Flow task buffer failed with error code 0xC0047020.
Error 0xc0047038: Data Flow Task 30: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on component "Source 147 - TEXT_US_CA_ZIP_CODE" (172) returned error code 0xC02020C4. The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing. There may be error messages posted before this with more information about the failure.
Error 0xc02020c4: Data Flow Task 30: The attempt to add a row to the Data Flow task buffer failed with error code 0xC0047020.
Error 0xc0047038: Data Flow Task 30: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on component "Source 148 - TFEATURE_LOC" (240) returned error code 0xC02020C4. The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing. There may be error messages posted before this with more information about the failure.

