SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Fact Table
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

bvanyangu
Starting Member

USA
17 Posts

Posted - 06/10/2014 :  02:42:29  Show Profile  Reply with Quote
I created a Fact Table with 3 Keys from dimension tables, like Customer Key, property key and territory key. Since I can ONLY have one Identity key on a table, what do I need to do to avoid populating NULLs on these columns..


Thanks

ahmeds08
Aged Yak Warrior

India
645 Posts

Posted - 06/10/2014 :  03:12:24  Show Profile  Send ahmeds08 a Yahoo! Message  Reply with Quote
If iam getting it right,you dont want to allow Null values in those columns?
If that is the case then add a NOTNULL constraint on those columns.

Javeed Ahmed
Go to Top of Page

bvanyangu
Starting Member

USA
17 Posts

Posted - 06/10/2014 :  09:05:48  Show Profile  Reply with Quote

That's right,however I still get the error below if I change to Not to Allow Nulls.Is there something I am missing.




[OLE DB Destination [163]] Error: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Errorcode:
0x80004005.
An OLE DB record is available. Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80004005
Description: "The statement has been terminated.".
An OLE DB record is available. Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80004005
Description: "Cannot insert the value NULL into column 'Borrower_Key', table 'OLAP.dbo.Fact_Financials';
column does not allow nulls. INSERT fails.".
Go to Top of Page

DonAtWork
Flowing Fount of Yak Knowledge

2161 Posts

Posted - 06/10/2014 :  10:27:15  Show Profile  Reply with Quote
Yes. Your insert statement is trying to insert a NULL value, and SQL SERVER told you that is not allowed. Your front end (or middle tier) needs to screen the data before you try to ram it into the database.








How to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.09 seconds. Powered By: Snitz Forums 2000