Print Page | Close Window

SQL Server Script Issues...

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=7554
Printed Date: 06 April 2026 at 10:19am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: SQL Server Script Issues...
Posted By: Sean T
Subject: SQL Server Script Issues...
Date Posted: 24 November 2003 at 9:33am

I've been searching through the forum looking for someone who has had a problem with the 7.6 SQLServer scripts.  Can't find anyone (or they're not talking) so here goes:

First after running the script on my new blank db I could not login.  If found that none of the "seed" values were inserted into the db so the administrator/letmein login wouldn't work.  I opened the Access db and copied the seed values from 4-5 tables into the SQLServer db.

Next problem was when setting up a new forum category, I get an error on the Cat_Order column which requires a value.  I altered the SQLServer db to default that column to 1 as in the Access db.

Now I'm getting an error on No_of_Posts while attempting to create a new forum.  Which I'll do another alter of the SQLServer db to correct.

So my question is, is there a more recent version of the SQLServer script that fixes these issues and maybe the others I've not yet hit?  The version I have is the one in the zip from the US Mirror that I downloaded this morning...




Replies:
Posted By: WebWiz-Bruce
Date Posted: 24 November 2003 at 9:45am
Don't use the file Web_wiz_forums.sq. file. This is only there for reference.

Follow the documentation on how to setup the forums!!!

You will find that there is an online database creation file written in ASP that creates the database with all the tables, default values, indexes, stored procedures, etc.


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: Sean T
Date Posted: 24 November 2003 at 9:56am

And a big ol' DUH HUH goes out to me. 

Thanks for the heads up.  Works great now.



Posted By: Spartanx15
Date Posted: 24 November 2003 at 4:57pm

I have tried the online SQL DB creation system and got a message about "errors". I am using an SQL 7.0 SPK4 DB. I have deleted the DB and tried to create it using ISQL I got an error on the COLLATE statement. I modifed the .sql file and started over again. Noe I am getting another error on the "ServerProperty" section, which SQL 7.0 does not support ( see seperate post of this date on this problem ).

So..... what is one to do. If the .sql file does not create the seeds and the online ASP system sends an obtuse message on "errors" but does not describe them...what should I do ?

BTW I do love the forum, which is why I supported it. Only my 6 version is working fine and with the SQL errors I found in 7.0, 7.1 and now with my finding errors in making the SQL 7.0 DB, maybe I should stay with 6.0 ?

Jon Spartanx15 email: jonux@ixtech.net



Posted By: thekiwi
Date Posted: 24 November 2003 at 5:04pm

I have tried the online SQL DB creation system and got a message about "errors". I am using an SQL 7.0 SPK4 DB. I have deleted the DB and tried to create it using ISQL I got an error on the COLLATE statement. I modifed the .sql file and started over again. Noe I am getting another error on the "ServerProperty" section, which SQL 7.0 does not support ( see seperate post of this date on this problem ).

What "Errors" did you get running msSQL_server_setup.asp ?

In the ASP file there are no Collate statements or ServerProperty calls ... so it should work OK.

What line number etc?



Posted By: Spartanx15
Date Posted: 24 November 2003 at 5:11pm

Here is what I got back when I just re-ran the ASP Script - msSQL_server_setup.asp

"Error Creating the Stored Procedure wwfSpDBinfo (it may already exsist)

SQL Server database is set up, but with Error! "

 

This error was shown directly under the SQL Sever Usernamae and password "box"



Posted By: Spartanx15
Date Posted: 24 November 2003 at 5:20pm
I also just checked the stored procedures list under the DB and wwfSpDBinfo DOES NOT exist.


Posted By: Spartanx15
Date Posted: 24 November 2003 at 5:25pm

The code from the ASP script follows - once again the "ServerProerty" statement is used which is not support by 7.0 - SO - how do we correct this pray tell ???

 

Script portion is -

 

  strSQL = "CREATE PROCEDURE [dbo].[" & strDbProc & "DBinfo] "
  strSQL = strSQL & "As "
  strSQL = strSQL & vbCrLf & "Declare @low int"
  strSQL = strSQL & vbCrLf & "Declare @dbsize dec(10,2)"
  strSQL = strSQL & vbCrLf & "Declare @dbpath nvarchar(100)"
  strSQL = strSQL & vbCrLf & "Declare @logpath nvarchar(100)"
  strSQL = strSQL & vbCrLf & "Declare @dbfilesize dec(10,2)"
  strSQL = strSQL & vbCrLf & "Declare @logfilesize dec(10,2)"
  strSQL = strSQL & vbCrLf & "Declare @maxdbfilesize dec(10,2)"
  strSQL = strSQL & vbCrLf & "Declare @maxlogfilesize dec(10,2)"
  strSQL = strSQL & vbCrLf & " "
  strSQL = strSQL & vbCrLf & "--Minimum Database Size"
  strSQL = strSQL & vbCrLf & "select @low = low from master.dbo.spt_values"
  strSQL = strSQL & vbCrLf & "   where type = N'E' and number = 1"
  strSQL = strSQL & vbCrLf & "--Calculation of current Database Size in MB"
  strSQL = strSQL & vbCrLf & "select @dbsize = (convert(dec(15),sum(size)) *  @low  / 1048576)"
  strSQL = strSQL & vbCrLf & "from [sysfiles]"
  strSQL = strSQL & vbCrLf & "--Actual File Size of Log and Data File"
  strSQL = strSQL & vbCrLf & "Select TOP 1 @dbpath = [filename] from [sysfiles] where groupid = 1"
  strSQL = strSQL & vbCrLf & "Select TOP 1 @logpath = [filename] from [sysfiles] where groupid = 0"
  strSQL = strSQL & vbCrLf & "Select @dbfilesize =  convert(dec(10,2),sum([size]))/128 from [sysfiles] where [filename] = @dbpath     --in MB"
  strSQL = strSQL & vbCrLf & "Select @logfilesize = convert(dec(10,2),sum([size]))/128 from [sysfiles] where [filename] = @logpath   --in MB"
  strSQL = strSQL & vbCrLf & "Select TOP 1 @maxdbfilesize = convert(dec(10,2),[maxsize])/128 from [sysfiles] where [filename] = @dbpath"
  strSQL = strSQL & vbCrLf & "Select TOP 1 @maxlogfilesize = convert(dec(10,2),[maxsize])/128 from [sysfiles] where [filename] = @logpath"
  strSQL = strSQL & vbCrLf & "If @maxdbfilesize = (-.01) Set @maxdbfilesize = -1"
  strSQL = strSQL & vbCrLf & "If @maxlogfilesize = (-.01) Set @maxlogfilesize = -1"
  strSQL = strSQL & vbCrLf & " "
  strSQL = strSQL & vbCrLf & "---Creating Output Table"
  strSQL = strSQL & vbCrLf & "select  @dbsize Databasesize, @dbpath DataLocation , @logpath LogLocation, "
  strSQL = strSQL & vbCrLf & " @dbfilesize DatabaseFileSize, @logfilesize Logfilesize,"
  strSQL = strSQL & vbCrLf & " @maxdbfilesize MaxDBSize, @maxlogfilesize MazLogSize,"
  strSQL = strSQL & vbCrLf & " ServerProperty('edition') Edition, "
  strSQL = strSQL & vbCrLf & " CASE ServerProperty('IsCluster') "
  strSQL = strSQL & vbCrLf & "  WHEN 0 THEN 'No Cluster'"
  strSQL = strSQL & vbCrLf & "  WHEN 1 THEN 'Cluster'"
  strSQL = strSQL & vbCrLf & "   ELSE  'No Cluster/Unknown' "
  strSQL = strSQL & vbCrLf & " END Cluster,"
  strSQL = strSQL & vbCrLf & " CASE ServerProperty('License_Type')"
  strSQL = strSQL & vbCrLf & "  WHEN 'PER_SEAT' THEN 'Seat Licensing (' + Convert(nvarchar(5),ServerProperty('NumLicenses')) + ')'"
  strSQL = strSQL & vbCrLf & "  WHEN 'Per_Processor' THEN 'Processor Licensing (' + Convert(nvarchar(5),ServerProperty('NumLicenses')) + ')'"
  strSQL = strSQL & vbCrLf & "  ELSE 'Licensing Disabled / Unknown'"
  strSQL = strSQL & vbCrLf & " END Licensing,"
  strSQL = strSQL & vbCrLf & " ServerProperty('ProductLevel') PLevel"



Posted By: thekiwi
Date Posted: 24 November 2003 at 5:26pm

Yup ... my apologies ... there does appear to be a "ServerProperty" call in the setup script of the stored procedure wwfSPDBinfo. This would suggest it would never work under SQL7, contrary to the Requirements on this site?

Looking at the script Id say it should carry on and correctly setup the remainder of your database ....



Posted By: Spartanx15
Date Posted: 24 November 2003 at 5:33pm

Everythng is fine, EXCEPT for this one sproc. And now the question comes up as to how important this sproc is to proper operation of the Forum v 7.6 ?

Apology accepeted :) I have been working MS-SQL since 1994 and wrote much of the replication system. Thus I tend to become a bulldog on these things. My apologies also to yourself.

I just will not modify others code as I do not have a crystal ball into their thinking of the time ( well unless its my own SQL team where I can't get out of their heads, alas ). Thus I always wait for the thoughts of the script author before making my own changes, which more often than not just mess things up further.

Regards,

 

Jon Spartan ( yeah I KNOW about the movie and get commenst about it all the time - LOL )

 



Posted By: thekiwi
Date Posted: 24 November 2003 at 5:34pm

Try this in Query Analyser

 

CREATE PROCEDURE [dbo].[wwfSpDBinfo] As
Declare @low int
Declare @dbsize dec(10,2)
Declare @dbpath nvarchar(100)
Declare @logpath nvarchar(100)
Declare @dbfilesize dec(10,2)
Declare @logfilesize dec(10,2)
Declare @maxdbfilesize dec(10,2)
Declare @maxlogfilesize dec(10,2)
 
--Minimum Database Size
select @low = low from master.dbo.spt_values
   where type = N'E' and number = 1
--Calculation of current Database Size in MB
select @dbsize = (convert(dec(15),sum(size)) *  @low  / 1048576)
from [sysfiles]
--Actual File Size of Log and Data File
Select TOP 1 @dbpath = [filename] from [sysfiles] where groupid = 1
Select TOP 1 @logpath = [filename] from [sysfiles] where groupid = 0
Select @dbfilesize =  convert(dec(10,2),sum([size]))/128 from [sysfiles] where [filename] = @dbpath     --in MB
Select @logfilesize = convert(dec(10,2),sum([size]))/128 from [sysfiles] where [filename] = @logpath   --in MB
Select TOP 1 @maxdbfilesize = convert(dec(10,2),[maxsize])/128 from [sysfiles] where [filename] = @dbpath
Select TOP 1 @maxlogfilesize = convert(dec(10,2),[maxsize])/128 from [sysfiles] where [filename] = @logpath
If @maxdbfilesize = (-.01) Set @maxdbfilesize = -1
If @maxlogfilesize = (-.01) Set @maxlogfilesize = -1
 
---Creating Output Table
select  @dbsize Databasesize, @dbpath DataLocation , @logpath LogLocation,
 @dbfilesize DatabaseFileSize, @logfilesize Logfilesize,
 @maxdbfilesize MaxDBSize, @maxlogfilesize MazLogSize, "" Edition, "" Cluster, "" Licensing, "" PLevel
 --ServerProperty('edition') Edition2
 --CASE ServerProperty('IsCluster')
  --WHEN 0 THEN 'No Cluster'
  --WHEN 1 THEN 'Cluster'
   --ELSE  'No Cluster/Unknown'
 --END Cluster,
 --CASE ServerProperty('License_Type')
  --WHEN 'PER_SEAT' THEN 'Seat Licensing (' + Convert(nvarchar(5),ServerProperty('NumLicenses')) + ')'
  --WHEN 'Per_Processor' THEN 'Processor Licensing (' + Convert(nvarchar(5),ServerProperty('NumLicenses')) + ')'
  --ELSE 'Licensing Disabled / Unknown'
 --END Licensing,
 --ServerProperty('ProductLevel') PLevel
GO



Posted By: thekiwi
Date Posted: 24 November 2003 at 5:37pm

Everythng is fine, EXCEPT for this one sproc. And now the question comes up as to how important this sproc is to proper operation of the Forum v 7.6 ?

Im guessing here, but I'd imagine that it is only at :

forum/admin/sql_server_db_stats.asp ...



Posted By: Spartanx15
Date Posted: 24 November 2003 at 5:41pm

Worked fine, of course. Now we shall see if it affects/effects the Forum at all.

Many thanks. I hope the ASP script gets changed for other SQL 7.0 users.




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net