Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - DB errors, smallint to Int (or Bigint), not workin
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

DB errors, smallint to Int (or Bigint), not workin

 Post Reply Post Reply Page  12>
Author
MaximeRoy77 View Drop Down
Groupie
Groupie
Avatar

Joined: 21 November 2010
Location: Québec, Canada
Status: Offline
Points: 54
Post Options Post Options   Thanks (0) Thanks(0)   Quote MaximeRoy77 Quote  Post ReplyReply Direct Link To This Post Topic: DB errors, smallint to Int (or Bigint), not workin
    Posted: 29 January 2011 at 2:37pm
Hi,

I get theses errors now:

  • Posts count does not work anymore.

  • I get this error when I run the ADMIN / RE-Sync posts count
    Arithmetic overflow error for data type smallint, value = 32919.

From my research.... this lead to:

My forum DB is getting bigger and now I have to change the datatype of this field of
tblForum.Last_post_author_ID (smallint) to a INT or BIGINT.

But when I try to change the datatype of the tblForum.Last_post_author_ID to INT or BIGINT I get the error message on the screenshot I attached.



 How to do it ?

Thanks





Edited by MaximeRoy77 - 29 January 2011 at 3:06pm
Back to Top
MaximeRoy77 View Drop Down
Groupie
Groupie
Avatar

Joined: 21 November 2010
Location: Québec, Canada
Status: Offline
Points: 54
Post Options Post Options   Thanks (0) Thanks(0)   Quote MaximeRoy77 Quote  Post ReplyReply Direct Link To This Post Posted: 29 January 2011 at 2:41pm
Tried to do it manually 

ALTER TABLE tblForum
ALTER COLUMN Last_post_author_ID int


But, get this... this explains the errors above (screenshot)


Msg 5074, Level 16, State 1, Line 1
The object 'DF__tblForum__Last_p__18F6A22A' is dependent on column 'Last_post_author_ID'.
Msg 5074, Level 16, State 1, Line 1
The index 'Last_post_author_ID' is dependent on column 'Last_post_author_ID'.
Msg 4922, Level 16, State 9, Line 1
ALTER TABLE ALTER COLUMN Last_post_author_ID failed because one or more objects access this column.



????
Back to Top
MaximeRoy77 View Drop Down
Groupie
Groupie
Avatar

Joined: 21 November 2010
Location: Québec, Canada
Status: Offline
Points: 54
Post Options Post Options   Thanks (0) Thanks(0)   Quote MaximeRoy77 Quote  Post ReplyReply Direct Link To This Post Posted: 29 January 2011 at 2:48pm
Does dropping and re-creating the constraint and index would work ?

I mean dropping them, making the datatype change and then re-creating them ?


Edited by MaximeRoy77 - 29 January 2011 at 3:22pm
Back to Top
MaximeRoy77 View Drop Down
Groupie
Groupie
Avatar

Joined: 21 November 2010
Location: Québec, Canada
Status: Offline
Points: 54
Post Options Post Options   Thanks (0) Thanks(0)   Quote MaximeRoy77 Quote  Post ReplyReply Direct Link To This Post Posted: 29 January 2011 at 8:23pm
Option above worked. The ADMIN Force Re-Sync Post count, etc give no errors but the number of posts of members have not re-calculated. How to ?
Back to Top
MaximeRoy77 View Drop Down
Groupie
Groupie
Avatar

Joined: 21 November 2010
Location: Québec, Canada
Status: Offline
Points: 54
Post Options Post Options   Thanks (0) Thanks(0)   Quote MaximeRoy77 Quote  Post ReplyReply Direct Link To This Post Posted: 30 January 2011 at 1:41pm
I managed to fix it by changing to INT the 

tblForum.Last_post_author_ID (smallint) to a (int) datatype

This need to be fixed in the upcoming version or my forum won't work in the future release.

Thanks
Back to Top
MaximeRoy77 View Drop Down
Groupie
Groupie
Avatar

Joined: 21 November 2010
Location: Québec, Canada
Status: Offline
Points: 54
Post Options Post Options   Thanks (0) Thanks(0)   Quote MaximeRoy77 Quote  Post ReplyReply Direct Link To This Post Posted: 30 January 2011 at 9:03pm
I had to update the posts count manually for member ID 32919 and above...
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: 01 February 2011 at 1:47pm
The tblTopic.Last_post_author_ID should be set to the INT data type. I have checked the database setup files and it is indeed set to the INT Data Type. 

It sounds like either the database was not setup correctly or was modified to change it to a SMALLINT Data Type.

As to your error when trying to change the value in SQL Server Studio Manager this is caused by the default settings in SQL Server Studio Manager. So that you can make these types of changes to tables in SQL Server Studio Manager go to:-

Tools -> Options -> Designers 

Where you can uncheck the option to 'Prevent saving changes that require table re-creation'
Back to Top
MaximeRoy77 View Drop Down
Groupie
Groupie
Avatar

Joined: 21 November 2010
Location: Québec, Canada
Status: Offline
Points: 54
Post Options Post Options   Thanks (0) Thanks(0)   Quote MaximeRoy77 Quote  Post ReplyReply Direct Link To This Post Posted: 01 February 2011 at 2:08pm
No reason I would have change the datatype to SMALLINT Ermm

Here's my theory:
I run the forums since 2004 version 7? And maybe it's the upgrade script that did not made the change on my DB because of that setting "Prevent saving changes that require table re-creation" .

Just a tough ...


Back to Top
 Post Reply Post Reply Page  12>

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.