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
 Cannot insert the value NULL
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Swn-Y-Mor
New Member

90 Posts

Posted - 25 April 2007 :  08:04:39  Show Profile
I am having trouble creating new Topics. I get the following error :-

ADDING NEW TOPIC MESSAGE IN FORUM :-

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

Cannot insert the value NULL into column `TOPIC_ID`, table `myDatabase.myUsername.FORUM_TOPICS`; column does not allow nulls. INSERT fails.

/forum/post_info.asp, line 1005


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

If I Go to enterprise manager, and change TOPIC_ID to Allow NULLS, then the new topic is created, but i can't see it because it is entered into database as TOPIC_ID = NULL

Can anyone help me please

Swn-Y-Mor
New Member

90 Posts

Posted - 25 April 2007 :  08:18:12  Show Profile
searched this website, and someone else had same problem

http://forum.snitz.com/forum/topic.asp?TOPIC_ID=60946&SearchTerms=allow,nulls

My web host has just moved my database to another server, and probably didn't use the methos suggested by Ruirib here
http://forum.snitz.com/forum/topic.asp?ARCHIVE=true&TOPIC_ID=31144

Is there a way around this by using Enterprise Manager to recover the situation?
Go to Top of Page

pdrg
Support Moderator

United Kingdom
2897 Posts

Posted - 25 April 2007 :  09:10:09  Show Profile  Send pdrg a Yahoo! Message
Rui's suggestion is the best one, as it makes sure all the constraints and relationships are applied in the right order and that the constraints are set right.

If you're very familiar with MSSQL you could dig through the code in setup.asp and try retro-applying the constriants and relationships etc, but if you were that familiar it's unlikely you'd be asking here how to do it, so I'd suggest following Rui's suggestion.

swn-y-mor, sound of the sea...where are you based?
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 25 April 2007 :  09:59:35  Show Profile  Send ruirib a Yahoo! Message
You'd expect a host to know how to move a SQL Server database... I would definitely ask them to do it again. Probably the easiest way would be to generated a script from the existing DB, run in the new server and then using DTS to transfer the data, ensuring existing identity values are preserved.

It's hard to advise how to fix their blunders. It really depends on what's missing in the existing DB, which can range from identity fields to a proper indexing structure. Better do as recommended in my first post or in this one.


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

pdrg
Support Moderator

United Kingdom
2897 Posts

Posted - 25 April 2007 :  11:13:23  Show Profile  Send pdrg a Yahoo! Message
The smartest way to move it would be to detach the db, copy it across to the new server, then reattach it to the server, but you can't always count on 'SQL Experts' as being experts at all...
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 25 April 2007 :  11:14:53  Show Profile  Send ruirib a Yahoo! Message
You could also use DTS to transfer objects instead of just copying the data and letting DTS create the table structure...


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

Swn-Y-Mor
New Member

90 Posts

Posted - 25 April 2007 :  13:50:12  Show Profile
Thanks for your replies.
So, if the webhost created a new database for me, I then run setup.asp?RC=5 again, run my MODS upgrades, so I have an empty database.
I then use DTS wizard and copy tables, data and objects, yes/no?

Or get them to create a new database, forget the setup.asp?RC=5 bit, and just run DTS wizard and copy tables, data and objects? yes/no

As you can tell, I'm no SQL server expert

Cheers so far
Go to Top of Page

Swn-Y-Mor
New Member

90 Posts

Posted - 29 April 2007 :  13:30:38  Show Profile
quote:

swn-y-mor, sound of the sea...where are you based?



Sorry, I missed this bit.
Anglesey, North Wales

Are you Welsh?
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.14 seconds. Powered By: Snitz Forums 2000 Version 3.4.07