Błąd przy importowania danych do SQL Server

0

Witam!

Posiadam plik Excel z danymi do bazy. Chcę dodać dane do bazy za pomocą "import data" lecz po wybraniu odpowiedniego źródła, danych itd. mam błędy

"
Error 0xc0202009: Data Flow Task 1: 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 11.0" Hresult: 0x80004005 Description: "The statement has been terminated.".
An OLE DB record is available. Source: "Microsoft SQL Server Native Client 11.0" Hresult: 0x80004005 Description: "The INSERT statement conflicted with the FOREIGN KEY constraint "FK_device_system". The conflict occurred in database "elsapem_2013", table "dbo.system", column 'id'.".
(SQL Server Import and Export Wizard)

Error 0xc0209029: Data Flow Task 1: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "Destination - device.Inputs[Destination Input]" failed because error code 0xC020907B occurred, and the error row disposition on "Destination - device.Inputs[Destination Input]" 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.
(SQL Server Import and Export Wizard)

Error 0xc0047022: Data Flow Task 1: SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on component "Destination - device" (32) failed with error code 0xC0209029 while processing input "Destination Input" (45). 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.
(SQL Server Import and Export Wizard)
"
Poza tym mam jeszcze pytanie . W oknie wyboru table do importu, każda tabela jest powielone np.

'system'
'system$'
"imie"
'imie$'
itd.

Dlaczego tak się dzieje ?

pozdrawiam

0
  1. Komunikat wyraźnie ci napisał, że masz naruszenia klucza obcego w tabeli elsapem_2013.dbo.system pole id
  2. Tabele masz powielone, bo część z nich to tabele ukryte (te z $), a część z nich jest poprawnie zdefiniowana w Excelu jako "nazwany obszar". Generalnie zazwyczaj jest to to samo, choć nie zawsze...
0

To, że mam problem z kluczem to wiem ale jak sobie z tym poradzić... wiesz może ?

0

Zdjąć klucz?

0
ALTER TABLE [NAZWA_TABELI] NOCHECK CONSTRAINT ALL
GO

..............


ALTER TABLE [NAZWA_TABELI] CHECK CONSTRAINT ALL
GO

1 użytkowników online, w tym zalogowanych: 0, gości: 1