Author |
Topic  |
|
wonderbison
Starting Member
2 Posts |
Posted - 03 September 2004 : 14:49:52
|
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
|
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
 |
 |
|
laser
Advanced Member
    
Australia
3859 Posts |
Posted - 03 September 2004 : 17:10:15
|
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. |
 |
|
-gary
Development Team Member
 
406 Posts |
Posted - 03 September 2004 : 19:17:34
|
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
 |
 |
|
ruirib
Snitz Forums Admin
    
Portugal
26364 Posts |
Posted - 03 September 2004 : 19:20:01
|
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 |
 |
|
wonderbison
Starting Member
2 Posts |
Posted - 04 September 2004 : 07:16:25
|
Ahha! Yes, DTS was the culprit. Thanks! |
 |
|
|
Topic  |
|