SunQuest
           MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMS SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old February 3rd, 2004, 12:48 PM
Haekel Haekel is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 40 Haekel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Yet another Access / SQL-Server question

Hello,

as you can see, I am not good at this, and I cannot get my hands on any resources to solve the problem myself, so I appreciate another answer:

I migrated an Access DB to SQL Server (or rather somebody did for me). Now I have the problem that when I do INSERT commands from my ASP-pages:

[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot insert the value NULL into column 'Table_Type_ID', table 'DB_Name.dbo.Table_Type'; column does not allow nulls. INSERT fails.

The column in question is a primary key in Access, and it is not imported correctly in SQL Server.

Can you help me out? Thank you!

Reply With Quote
  #2  
Old February 3rd, 2004, 02:05 PM
r937's Avatar
r937 r937 is offline
SQL Consultant
Dev Shed God 25th Plane (17000 - 17499 posts)
 
Join Date: Feb 2003
Location: Toronto Canada
Posts: 17,343 r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 3 Weeks 5 Days 8 h 5 m 22 sec
Reputation Power: 891
if the column in question was a primary key in access, it most likely is a primary key in sql server too

for a table called dbo.Table_Type, a column called Table_Type_ID does indeed sound like a typical primary key

primary keys do not allow nulls

from the error message, i would say it's your asp script that has the problem, not your database

try posting in the asp forum
__________________
r937.com | rudy.ca

Reply With Quote
  #3  
Old February 3rd, 2004, 02:27 PM
Haekel Haekel is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 40 Haekel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Thank you.
Before I try the ASp forum, I will give you another clarification:
The value for the primary key is entered automatically by Access, but apparently SQL Server does nos do it. Of course, the SQL INSERT statement that I use does not contain anything concerning the primary key because it is entered by Access. Do I need to change that, and if how? Thank you for your help.

Reply With Quote
  #4  
Old February 3rd, 2004, 02:39 PM
r937's Avatar
r937 r937 is offline
SQL Consultant
Dev Shed God 25th Plane (17000 - 17499 posts)
 
Join Date: Feb 2003
Location: Toronto Canada
Posts: 17,343 r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level)r937 User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 3 Weeks 5 Days 8 h 5 m 22 sec
Reputation Power: 891
aha!

yes, the primary key must have been an autonumber in access, and should be an identity column in sql server

sorry, you were right, it was a database question

show the sql server table layout, and i'll see if i can whip you up some sql to change it

also, how many rows are in it at the moment?

Reply With Quote
  #5  
Old February 4th, 2004, 05:23 AM
Haekel Haekel is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 40 Haekel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Hi,

I will talk to the person that did the conversion and get back to you.
Thanks for your help already.

Helge

Reply With Quote
  #6  
Old February 5th, 2004, 09:09 AM
Haekel Haekel is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 40 Haekel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Rudy,

in a joined effort we figured it out! Thanks a lot for your help.

Helge.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > Yet another Access / SQL-Server question


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 3 hosted by Hostway