Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old August 28th, 2003, 08:26 AM
parasol parasol is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: pakistan
Posts: 1 parasol User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy inserting dimension id's

want to insert dimension id's from my SQL DB into facttables of the same SQL DB..for this purpose i am first using a transform data task to transfer data from an oracle DB to the SQL DB....
i am using Execute SQL task to alter table...
if i use
alter table test add company_name varchar(8) ( select company_name from junk)

it does not give any problem but inserts a column with the name company_name with all null values...it does not insert company names from junk
this is one way i tried to add diemsion id's into fact tables..
the other method i am using is that
i use a Execute SQL task to first add a column then i use another Execute SQL task to insert values from the dimension table..
the insert statement i am using is..
insert into test(member_name) select member_name from members
or
insert into test(member_name) select member_name from members where member_code=2 but in both cases it says ..
column does not allow nulls insert fails
altough the source col does not hve null values..
what should i do about this..
besides this is it possible tht in one Execute SQL task..i can
apply alter table to add a column and in the same time insert values into that column..if so how is this possible..

Reply With Quote
  #2  
Old August 29th, 2003, 12:35 PM
rdoekes rdoekes is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Strasbourg, France
Posts: 181 rdoekes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 20 sec
Reputation Power: 7
Send a message via AIM to rdoekes Send a message via Yahoo to rdoekes
since you are adding a column, shouldn't you be using an update statement iso insert statement?

If you are creating new records in this table, the nullable values are probably in other fields in this table, which cannot except null values.

Hope this helps
__________________
- Rogier Doekes

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft SQL Server > inserting dimension id's


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT