Błąd przy importowania danych do SQL Server

Błąd przy importowania danych do SQL Server
AC
  • Rejestracja:ponad 12 lat
  • Ostatnio:ponad 8 lat
  • Postów:162
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

edytowany 2x, ostatnio: adam_c
Marcin.Miga
  • Rejestracja:prawie 17 lat
  • Ostatnio:2 dni
  • Postów:2792
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...
AC
  • Rejestracja:ponad 12 lat
  • Ostatnio:ponad 8 lat
  • Postów:162
0

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

Marcin.Miga
  • Rejestracja:prawie 17 lat
  • Ostatnio:2 dni
  • Postów:2792
0

Zdjąć klucz?

crowa
  • Rejestracja:ponad 18 lat
  • Ostatnio:około 8 lat
  • Lokalizacja:Poznań
  • Postów:295
0
Kopiuj
ALTER TABLE [NAZWA_TABELI] NOCHECK CONSTRAINT ALL
GO

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


ALTER TABLE [NAZWA_TABELI] CHECK CONSTRAINT ALL
GO

Tomasz Andrzejewski
Delphi (XE3-XE7) framework engineer @ InterLan
MCP: Microsoft SQL Server 2008, Implementation and Maintenance

Zarejestruj się i dołącz do największej społeczności programistów w Polsce.

Otrzymaj wsparcie, dziel się wiedzą i rozwijaj swoje umiejętności z najlepszymi.