Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - SQL Server Script Issues...
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

SQL Server Script Issues...

 Post Reply Post Reply Page  <12
Author
thekiwi View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 23 November 2003
Location: New Zealand
Status: Offline
Points: 392
Post Options Post Options   Thanks (0) Thanks(0)   Quote thekiwi Quote  Post ReplyReply Direct Link To This Post 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 ....

Back to Top
Spartanx15 View Drop Down
Newbie
Newbie


Joined: 23 November 2003
Location: United States
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote Spartanx15 Quote  Post ReplyReply Direct Link To This Post 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 )

 

Back to Top
thekiwi View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 23 November 2003
Location: New Zealand
Status: Offline
Points: 392
Post Options Post Options   Thanks (0) Thanks(0)   Quote thekiwi Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
thekiwi View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 23 November 2003
Location: New Zealand
Status: Offline
Points: 392
Post Options Post Options   Thanks (0) Thanks(0)   Quote thekiwi Quote  Post ReplyReply Direct Link To This Post 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 ...

Back to Top
Spartanx15 View Drop Down
Newbie
Newbie


Joined: 23 November 2003
Location: United States
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote Spartanx15 Quote  Post ReplyReply Direct Link To This Post 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.

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.