Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: Database: MS SQL Server
 Insert Error
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Swn-Y-Mor
New Member

90 Posts

Posted - 12 August 2006 :  05:32:36  Show Profile
I have just converted my database from Access to SQL Server 2000 but I get the following error creating a new topic.

Microsoft OLE DB Provider for SQL Server error '80040e2f'

Cannot insert the value NULL into column 'TOPIC_ID', table 'MyDatabase.myUserId.FORUM_TOPICS'; column does not allow nulls. INSERT fails.

/forum/post_info.asp, line 1005

Line 1005 :-
my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords

Any suggestions?

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 12 August 2006 :  05:38:11  Show Profile  Send ruirib a Yahoo! Message
You should have followed the suggestions we have made, so many times, in this forum, regarding Access to SQL Server conversion.
I suggest that you do so, now.

http://forum.snitz.com/forum/topic.asp?TOPIC_ID=31144


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

Swn-Y-Mor
New Member

90 Posts

Posted - 12 August 2006 :  13:30:33  Show Profile
I did follow your suggestions to the letter. I printed the link you provided before starting my conversion, and found it very helpful.

Thanks for the polite, encouraging, helpful response.
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 12 August 2006 :  14:48:16  Show Profile  Send ruirib a Yahoo! Message
I am sorry, but even if you think you did, you did not. The error occurs because that column is not set as an identity column. If you had created the tables using setup.asp, as recommended in the link, I can assure you that the column would be an identity column. Even if you used setup.asp, then when using DTS to import the access data, it's very important that you make sure that the destination tables are already created, by choosing the proper table name from the drop down, at the adequate step in the import process.

When checking identity insert for each table, make sure that you have an option to delete existing data. If you don't, then you're not choosing the proper destination table and, again, DTS will recreate the table, with a "bad" structure, resulting in your current situation.


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

Swn-Y-Mor
New Member

90 Posts

Posted - 13 August 2006 :  05:30:02  Show Profile
Thank You for your reply. I am still struggling.

I double checked my settings during Import of data using DTS wizard, and my Column Mappings 'Delete Rows in Destination Table' is checked and 'Enable Identity Insert' is checked (see below)



What should my Transformations 'Copy the Source Columns directly to Destination Columns' be set to?



Should 'TOPIC_ID', table 'MyDatabase.myUserId.FORUM_TOPICS' Allow Nulls? Why would my insert be trying to insert a Null?




Edited by - Swn-Y-Mor on 13 August 2006 05:33:03
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 13 August 2006 :  05:36:59  Show Profile  Send ruirib a Yahoo! Message
I am thinking that the forum and DTS are using different tables... Are those screens from the real import data process? And is the error message really

Cannot insert the value NULL into column 'TOPIC_ID', table 'MyDatabase.myUserId.FORUM_TOPICS'; column does not allow nulls. INSERT fails.

If it is, you're dealing with two different users (MyAdmin and myUserID) and thus different tables...


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

Swn-Y-Mor
New Member

90 Posts

Posted - 13 August 2006 :  05:53:21  Show Profile
Sorry, I photoshoped my real Admin and Database names - they are both the same, and yes, real import Data process
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 13 August 2006 :  06:03:05  Show Profile  Send ruirib a Yahoo! Message
Better run setup.asp again, this time running setup.asp like this: setup.asp?RC=5

Then do the import as shown in the screens you just posted. Don't forget you need to do that for every single table in the database.


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

Swn-Y-Mor
New Member

90 Posts

Posted - 13 August 2006 :  06:06:51  Show Profile
OK Thank You.
I will run Setup.asp?RC=5 again

I did do it for every single table.
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20595 Posts

Posted - 13 August 2006 :  06:32:28  Show Profile  Visit HuwR's Homepage
your images show the import for the table forum_A_reply which does not ave an identity field anyway. Your problem is with the table creation not with the data transfer.
Go to Top of Page

Swn-Y-Mor
New Member

90 Posts

Posted - 14 August 2006 :  05:57:13  Show Profile
My Forum has now been converted to SQL Server - I have learnt a lot in the process.
I re-created the basic database using setup.asp?RC=5 and rerun the MOD bits

Thank you for all your help, and I apologise for being sarcastic in one of my replies ruirib - frustration got the better of me.
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 14 August 2006 :  06:08:08  Show Profile  Send ruirib a Yahoo! Message
Ok, no problems, I'm glad all is working now.


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.15 seconds. Powered By: Snitz Forums 2000 Version 3.4.07