Column xyz is constrained to be unique - Ignore Warnings?

Support for DataSlave

Moderators: Tom, ian

Column xyz is constrained to be unique - Ignore Warnings?

Postby breener96 » Wed Sep 21, 2011 5:10 am

Hi,

I am reading a view from MS SQL database. I then take this view and export it directly into a CSV. The view can return multiple rows having the same PK. This is causing many warnings stating "column xyz is constrained to be unique. Value '1234' is already present.

How can I ignore the warnings?

Thanks
breener96
 
Posts: 10
Joined: Fri Oct 15, 2010 12:22 am

Re: Column xyz is constrained to be unique - Ignore Warnings

Postby ian » Sun Oct 02, 2011 9:26 pm

Would it be possible to send a small sample of data and a sample map to support@baycastle. We may ten be able to suggest an approach to handling this problem.
ian
 
Posts: 364
Joined: Sat Dec 18, 2004 8:13 am
Location: UK

Re: Column xyz is constrained to be unique - Ignore Warnings

Postby breener96 » Tue Jan 10, 2012 5:30 am

Hi Ian,

When I run this using the command line, it really fills out my logs (as I log all standard output) and effects overall performance of the speed at which it completes its export. Below is what I see.

21:21:28 > ------------------------------------------------------------
21:21:28 > DataSlave Loader
21:21:28 > Monday, 9 Jan 2012 21:21:28
21:21:28 > Full Licence
21:21:28 > C:\Automation\NFLDB\DataSlave\Maps\Weekly_SQLEXPORT.dbm
21:21:28 > ------------------------------------------------------------
21:21:28 > Loading add-ins...
21:21:30 > Loading map...
21:21:30 > Executing map...
21:21:30 > Executing MS SQL Server1 - Stats_Weekly_Player...
21:21:35 > warning: Column 'PlayerID' is constrained to be unique. Value '10053' is already present. (record 1, key 10053)
21:21:35 > warning: Column 'PlayerID' is constrained to be unique. Value '10286' is already present. (record 2, key 10286)
... continues for thousands of rows...

This is because I have a PK called PlayerID, which is unique. When I run my export, (I call a SQL view) it recognizes that PlayerID should be unique, but I actually export many of the same data rows with the same PlayerID.

As an example, QB Drew Brees is PlayerID 1000. When I do my export, Drew Brees will have statistics for each game that he has played... meaning that I export multiple instances of the same playerID.

Hopefully this helps explain it.
breener96
 
Posts: 10
Joined: Fri Oct 15, 2010 12:22 am

Re: Column xyz is constrained to be unique - Ignore Warnings

Postby ian » Wed Jan 11, 2012 8:10 pm

You can edit the schema in a Transform object and change the column so it is not a primary key. This may then help.

It would help if you could send the sql to create the tables and the view. We can then build a sample map to see how best to help you
ian
 
Posts: 364
Joined: Sat Dec 18, 2004 8:13 am
Location: UK


Return to Support

Who is online

Users browsing this forum: No registered users and 2 guests

cron