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
 new topic insertion error
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

wonderbison
Starting Member

2 Posts

Posted - 03 September 2004 :  14:49:52  Show Profile
Hi

Just moved ISP's. Copied all files and database successfully from one server to another. I can view and edit, but when I try to add a new topic I get :-
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot insert the value NULL into column 'TOPIC_ID', table 'bedfordjb.bedfordjb.JUNIORS_TOPICS'; column does not allow nulls. INSERT fails.

/post_info.asp, line 843



Any ideas why?

Thanks

-gary
Development Team Member

406 Posts

Posted - 03 September 2004 :  15:28:01  Show Profile
Your tables were not created correctly. You either need to delete them, run setup.asp and reimport your data, or generate a SQL script from the old server that includes indexes and identities.

KawiForums.com


Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 03 September 2004 :  17:10:15  Show Profile
Actually that error looks like the INSERT didn't work, but the database is ok ... the error is only occurring when a new topic is being created.


Can you post replies ?
Were you using MSSQL previously ?

Maybe try to do a Response.Write of your SQL command just before line 843 and see if you can spot what's wrong.
Go to Top of Page

-gary
Development Team Member

406 Posts

Posted - 03 September 2004 :  19:17:34  Show Profile
The insert is failing because topic_id should be an identity field and it is set to not allow nulls. If it's not set to seed with 1, there is no way for the db to create the topic_id since Snitz does not generate the unique ids, but leaves it up to the db.

Try it for yourself. The equivalent in Access would be an autonumber field.

You can't just create a dump from SQL without creating a SQL script and explicitly selecting to script indexes unless you're using the copy database function and I seriously doubt he used that since it was between hosts.

Again, the easiest way to fix it is to let setup.asp recreate the tables with the appropriate indexes and identities.

KawiForums.com


Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 03 September 2004 :  19:20:01  Show Profile  Send ruirib a Yahoo! Message
Gary is right, the tables were not created correctly, surely because the database transfer was done using DTS, allowing DTS to create the tables as well. The fix, is, as Gary posted, to delete the tables from the DB, run setup.asp (or run setup.asp?RC=5, which will delete existing tables and recreate them), and only them transfer the data using DTS. When doing this transfer, make sure you set each transformation column in DTS so that existing values are deleted and enable identity insert is checked.


Snitz 3.4 Readme | Like the support? Support Snitz too

Edited by - ruirib on 03 September 2004 19:22:25
Go to Top of Page

wonderbison
Starting Member

2 Posts

Posted - 04 September 2004 :  07:16:25  Show Profile
Ahha! Yes, DTS was the culprit. Thanks!
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.18 seconds. Powered By: Snitz Forums 2000 Version 3.4.07