Author |
Topic |
Lon2
Junior Member
USA
151 Posts |
Posted - 03 March 2009 : 14:10:21
|
Do you know a way to update forum counts via TSQL or SQL Server Management Studio/Express?
Our forums are large and take a long time to go through the process that is available in Admin Options. |
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
|
Lon2
Junior Member
USA
151 Posts |
Posted - 03 March 2009 : 17:34:14
|
Thanks guys, that's exactly what I was looking for! I have a question and I hope you don't mind if I ask it here. All my tables have a prefix on them, like clientX_dbname.TABLE_NAME, because of being with a host. Will I need to modify all of the table names in the T-script? |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 03 March 2009 : 17:41:46
|
no you shouldn't need to if your database is set up correctly and you are logged in as that user it should be fine. |
|
|
Lon2
Junior Member
USA
151 Posts |
Posted - 03 March 2009 : 18:08:05
|
Does the forum need to be stopped before I run the T-SQL? |
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
|
Lon2
Junior Member
USA
151 Posts |
Posted - 03 March 2009 : 18:53:31
|
HELLP! I may have just lost everything!
Msg 911, Level 16, State 1, Line 1 Could not locate entry in sysdatabases for database 'mydb'. No entry found with that name. Make sure that the name is entered correctly.
(43 row(s) affected) Msg 208, Level 16, State 0, Line 4 Invalid object name '#F_T_COUNT'. Msg 3701, Level 11, State 5, Line 2 Cannot drop the table '#F_T_COUNT', because it does not exist or you do not have permission. |
Edited by - Lon2 on 03 March 2009 19:32:41 |
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
Posted - 03 March 2009 : 19:02:11
|
You can't have lost everything. Something is wrong with your server. That script ran in several PCs and is even part of the .net version, so it was tested and passed those tests.
The output also shows a lot of ops being completed... what is the current status? |
Snitz 3.4 Readme | Like the support? Support Snitz too |
|
|
Lon2
Junior Member
USA
151 Posts |
Posted - 03 March 2009 : 19:04:51
|
Every single individual forum (~60) now shows zero topics! |
Edited by - Lon2 on 03 March 2009 19:06:31 |
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
|
Lon2
Junior Member
USA
151 Posts |
Posted - 03 March 2009 : 19:10:04
|
It still shows replies but every indiv forum shows zero topics. Would it be better to run the Update Forum Counts from Admin Options at this point? |
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
|
Lon2
Junior Member
USA
151 Posts |
Posted - 03 March 2009 : 19:11:32
|
No. I'm afraid to... |
|
|
Lon2
Junior Member
USA
151 Posts |
Posted - 03 March 2009 : 19:15:24
|
I have never been able to run an UPDATE command without CONVERT(nvarchar(max). Could this be the problem with running the T-SQL? |
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
Posted - 03 March 2009 : 19:16:09
|
Run the script again. There was an error when you ran it the first time.
I assure you the script just deals with the counts and the error message shows it failed when counting topics per forum (I can tell that from the name of the temporary table in the error message). The info is all there.
Run it again and let me know. If it fails, email me through the forum and I will email you a stored proc to do that and you can run it. You may have commited some error while copying the script code.
This code works. Even about a week ago I sent the code to SiSL and he used it on his own SQL Server based forum. |
Snitz 3.4 Readme | Like the support? Support Snitz too |
|
|
Topic |
|