This UDF and its equivalent stored procedure will return the size of a stored procedure, view, rule or user defined function in bytes .
2001-08-22
714 reads
Joseph Gama,
2002-12-07
This UDF and its equivalent stored procedure will return the size of a stored procedure, view, rule or user defined function in bytes .
SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS OFF GO CREATE function ObSize(@s VARCHAR(255) ) returns int as BEGIN declare @i int set @i=( SELECT SUM(DATALENGTH(dbo.syscomments.text)) AS Expr1 FROM dbo.syscomments INNER JOIN dbo.sysobjects ON dbo.syscomments.id = dbo.sysobjects.id WHERE (dbo.sysobjects.name =@s) ) return @i END GO SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS OFF GO CREATE PROCEDURE sp_ObSize (@s VARCHAR(255), @size int OUT ) AS declare @i int set @i=( SELECT SUM(DATALENGTH(dbo.syscomments.text)) AS Expr1 FROM dbo.syscomments INNER JOIN dbo.sysobjects ON dbo.syscomments.id = dbo.sysobjects.id WHERE (dbo.sysobjects.name =@s) ) set @size= @i GO SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS ON GO
You rated this post out of 5. Change rating
2001-08-22
714 reads
2001-08-22
366 reads
Very simple, how much space is free on the hard drives of the SQL Server you are connected to.
2001-08-22
652 reads
Get OLE Providers info I have found this useful in tracking down application driver/connection issues. I only had to use it 2 times. But it did help
2001-08-22
399 reads
2001-08-22
699 reads