Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Resync tool
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Resync tool

 Post Reply Post Reply Page  <123>
Author
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 25 July 2007 at 4:41pm
Now I know what the problem is, the reason I asked if it was an upgrade was that there was a small bug in the SQL Server upgrade file from 7 to 8 that set one of the fields as the wrong data type.

The field in tblForum -> Last_post_author_ID was set to smallint, when it should have been set to int

Open the database table tblForum and find Last_post_author_ID and change the database type from smallint to int

This bug was actually coursed by the 7 to 8 upgrade rather than your 8 to 9, you must have gone over the allowed size for smallint recently.


Edited by -boRg- - 25 July 2007 at 4:43pm
Back to Top
javi712 View Drop Down
Senior Member
Senior Member


Joined: 22 May 2003
Location: United States
Status: Offline
Points: 488
Post Options Post Options   Thanks (0) Thanks(0)   Quote javi712 Quote  Post ReplyReply Direct Link To This Post Posted: 25 July 2007 at 6:28pm
Borg,

I just opened the database table and Last_post_author_ID is already set to int

I did however notice there were two other tables using the smalldatetime data type: Date_Started and Last_post_date

You stated that wwf doesn't use the smalldatetime data type, should these be changed to something else?

Edited by javi712 - 25 July 2007 at 6:29pm
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 26 July 2007 at 11:04am
I don't know where the smalldatetime has come from it should all be datetime. Very odd as there is nothing that I have come across that would have coursed this and I have just double checked in the old database setup files as well incase there are any errors in those.




Edited by -boRg- - 26 July 2007 at 3:13pm
Back to Top
javi712 View Drop Down
Senior Member
Senior Member


Joined: 22 May 2003
Location: United States
Status: Offline
Points: 488
Post Options Post Options   Thanks (0) Thanks(0)   Quote javi712 Quote  Post ReplyReply Direct Link To This Post Posted: 26 July 2007 at 1:13pm
I'll change those back to just datetime and repor back. Thanks for pointing me in the right direction!
Back to Top
Nick-V View Drop Down
Senior Member
Senior Member


Joined: 26 October 2002
Location: United Kingdom
Status: Offline
Points: 319
Post Options Post Options   Thanks (0) Thanks(0)   Quote Nick-V Quote  Post ReplyReply Direct Link To This Post Posted: 26 July 2007 at 2:29pm
EDIT: DO NOT MAKE THESE CHANGES - See Borg's reply below, Nick-V.
 
I first started on version 7 and went through an automated upgrade to version 8 then version 9. The "small" fields in my SQL Server database (now changed) are:
 
tblForum
Last_post_author_ID (discussed above)
 
tblAuthor
Time_offset_hours
 
tblCategory
Cat_ID - this modified other tables on edit
Cat_order
 
tblConfiguration
Topics_per_page
Hot_views
Hot_replies
No_of_priavte_msg
Threads_per_page
Spam_seconds
Spam_minutes
Vote_choices
Upload_img_size
Upload_files_size
Upload_avatar_size
PM_Flood
Upload_allocation
 
tblDateTimeFormat
Time_format
Time_offset_hours
 
tblForum
Forum_Order
Show_topics
Sub_ID
 
tblTopic
Priority
 
All of these fields were smallInt and there were no smallDateTime fields present.
 
It seems to me that none of these fields urgently requires the larger Int field so I don't think there is an immediate issue here.


Edited by Nick-V - 26 July 2007 at 3:29pm
Back to Top
javi712 View Drop Down
Senior Member
Senior Member


Joined: 22 May 2003
Location: United States
Status: Offline
Points: 488
Post Options Post Options   Thanks (0) Thanks(0)   Quote javi712 Quote  Post ReplyReply Direct Link To This Post Posted: 26 July 2007 at 2:49pm
Thanks Nick!

It may seem that none of those fields require the larger int, but they shouldn't be using the smallint either though. I'll keep poking around my db and see what else needs changing. Thanks for the info!
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 26 July 2007 at 3:15pm
Those fields listed by nick-V should actually be smallint as they contain very low numbers.

Changing these to int won't have much effect, but a smallint is used as it is the correct datatype for small numbers under 32,000 (or there abouts)

If you have a look in the msSQL_server_setup.asp file you can see all the fields listed in the code and their correct datatypes.


Edited by -boRg- - 26 July 2007 at 3:16pm
Back to Top
Nick-V View Drop Down
Senior Member
Senior Member


Joined: 26 October 2002
Location: United Kingdom
Status: Offline
Points: 319
Post Options Post Options   Thanks (0) Thanks(0)   Quote Nick-V Quote  Post ReplyReply Direct Link To This Post Posted: 26 July 2007 at 3:41pm
Borg, please clarify:
 
This post got longer than I first thought but might serve as a useful list of how an old database now differs from a new one...
 
1) In my database (upgraded from 7 to 8 then 8 to 9) the following fields are 'bit' whereas in msSQL_server_setup.asp they are defined in a new database as 'smallint'. Is the upgrade correct or the msSQL_server_setup.asp?
 
tblConfiguration
A_code
NewsPad

2) The following field is ntext whereas in msSQL_server_setup.asp it is nvarchar(255):
 
tblAuthor
Signature
 
3) The following field is nvarchar(50) whereas in msSQL_server_setup.asp it is nvarchar(100):
 
tblConfiguration
NewsPad_URL
 
4) The following field does not allow NULL whereas in msSQL_server_setup.asp it does:
 
tblConfiguration
PM_Flood
 
5) The following field is nvarchar(70) whereas in msSQL_server_setup.asp it is nvarchar(90):
 
tblPoll
Poll_question
 
6) The following field is nvarchar(70) whereas in msSQL_server_setup.asp it is nvarchar(80):
 
tblPollChoice
Choice
  
7) In msSQL_server_setup.asp, replace the comment 'Create the Thread Table' with 'Create the Session Table'.
 
8) In msSQL_server_setup.asp, shouldn't all PRIMARY indexes be created as UNIQUE (they probably are anyway). The reason I am checking indexes is that there seem to be duplicates, the Primary indexes you created on the ID and auto-named indexes probably created by SQL Server.
 
9) Are both of these indexes necessary (also CAT_ID). I'm not sure the relationships need the key defined twice:
 
strSQL = "CREATE  INDEX [Group_ID] ON [" & strDBO & "].[" & strDbTable & "Author]([Group_ID]) ON [PRIMARY]"
strSQL = "CREATE  INDEX [" & strDbTable & "Group" & strDbTable & "Author] ON [" & strDBO & "].[" & strDbTable & "Author]([Group_ID]) ON [PRIMARY]"
 
10) The following indexes were missing (not added in upgrades?):
 
strSQL = "CREATE  INDEX [Sub_ID] ON [" & strDBO & "].[" & strDbTable & "Forum]([Sub_ID]) ON [PRIMARY]"
strSQL = "CREATE  INDEX [Moved_ID] ON [" & strDBO & "].[" & strDbTable & "Topic]([Moved_ID]) ON [PRIMARY]"
 
11) Are the names of these two indexes reversed deliberately:
 
strSQL = "CREATE  INDEX [Author_ID] ON [" & strDBO & "].[" & strDbTable & "BuddyList]([Buddy_ID]) ON [PRIMARY]"
strSQL = "CREATE  INDEX [Buddy_ID] ON [" & strDBO & "].[" & strDbTable & "BuddyList]([Author_ID]) ON [PRIMARY]"

12) tblPermissions does not appear to have a primary key, neither does tblPollVote - is this OK? 
 
13) Some Primary Keys are not right. I'm not an SQL expert but should "ON [PRIMARY]" be included against all key definitions in msSQL_server_setup.asp?
 
The primary key of Configuration is website_name - should it be ID.
The primary key of DateTimeFormat is date_format - should it be ID.
 
14) The following field is indexed whereas in msSQL_server_setup.asp it is not:
 
tblForum
Forum_code
 
15) The following field has a default of (null) whereas in msSQL_server_setup.asp it does not:
 
tblAuthor
Author_email
 
16) tblConfiguration and tblDateTimeFormat have constraints (defaults) where the same tables in the V9 database have none.
 
17) In addition to 16), the following fields in the old database have constraints (defaults) where the same fields in the V9 database have none:
 
tblForum
Last_post_date
 
tblPermissions
Calendar_event
Display_post
View_Forum
 
18) In addition to 16) and 17), the following fields in the V9 database have constraints (defaults) where the same fields in the old database have none:
 
tblTopic
Poll_ID
 
19) tblPollVote has no indexes (in V9 and old database) - does this degrade performance when checking if a member has voted?
 
20) tblSmut is only indexed on ID and not keyword (in V9 and old database). Perhaps this table is held in memory so it doesn't matter.
 
21) I read a recent post that the following field should have a default of 1 instead of 0 as defined in msSQL_server_setup.asp:
 
tblAuthor
Newsletter


Edited by Nick-V - 31 July 2007 at 10:57am
Back to Top
 Post Reply Post Reply Page  <123>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.