Jump to content

Recommended Posts

Posted

[quote author=pandugadu999 link=topic=199811.msg2436638#msg2436638 date=1307157229]
CREATE PROC sp_track_db_growth
(
@dbnameParam sysname = NULL
)
as
begin
DECLARE @dbname sysname

SET @dbname = COALESCE(@dbnameParam, DB_NAME())

SELECT CONVERT(char, backup_start_date, 111) AS [Date], --yyyy/mm/dd format
CONVERT(char, backup_start_date, 108) AS [Time],
@dbname AS [Database Name], [filegroup_name] AS [Filegroup Name], logical_name AS [Logical Filename],
physical_name AS [Physical Filename], CONVERT(numeric(9,2),file_size/1048576) AS [File Size (MB)],
Growth AS [Growth Percentage (%)]
FROM
(
SELECT b.backup_start_date, a.backup_set_id, a.file_size, a.logical_name, a.[filegroup_name], a.physical_name,
(
SELECT CONVERT(numeric(5,2),((a.file_size * 100.00)/i1.file_size)-100)
FROM msdb.dbo.backupfile i1
WHERE i1.backup_set_id =
(
SELECT MAX(i2.backup_set_id)
FROM msdb.dbo.backupfile i2 JOIN msdb.dbo.backupset i3
ON i2.backup_set_id = i3.backup_set_id
WHERE i2.backup_set_id < a.backup_set_id AND
i2.file_type='D' AND
i3.database_name = @dbname AND
i2.logical_name = a.logical_name AND
i2.logical_name = i1.logical_name AND
i3.type = 'D'
) AND
i1.file_type = 'D'
) AS Growth
FROM msdb.dbo.backupfile a JOIN msdb.dbo.backupset b
ON a.backup_set_id = b.backup_set_id
WHERE b.database_name = @dbname AND
a.file_type = 'D' AND
b.type = 'D'

) as Derived
WHERE (Growth <> 0.0) OR (Growth IS NULL)
ORDER BY logical_name, [Date]

END

EXEC sp_track_db_growth  'database_name'
[/quote]
[img]http://www.gifsoup.com/view1/1351924/benzbabuposts-o.gif[/img]
cry@fl cry@fl cry@fl cry@fl cry@fl cry@fl cry@fl


  • Replies 96
  • Created
  • Last Reply

Top Posters In This Topic

  • ammulu

    20

  • YashKing

    14

  • gerrard

    12

  • Jack Sparrow

    11

Popular Days

Top Posters In This Topic

Posted

Sombu idhi chuusthey paaripothaaadu.............. @3$% @3$% @3$% @3$% @3$%

Posted

[quote author=Dalapati link=topic=199829.msg2436776#msg2436776 date=1307161242]
Sombu idhi chuusthey paaripothaaadu.............. @3$% @3$% @3$% @3$% @3$%
[/quote]

paripoyadu appude  cry@fl cry@fl cry@fl cry@fl cry@fl

Posted

adhi query aaah  F@!n F@!n F@!n

anthee nenu appudappudu rastunaayi entii  cry@fl cry@fl cry@fl cry@fl cry@fl

Posted

CITI_c$y CITI_c$y CITI_c$y CITI_c$y CITI_c$y CITI_c$y CITI_c$y

Posted

[quote author=gerrard link=topic=199829.msg2436781#msg2436781 date=1307161394]
adhi query aaah  F@!n F@!n F@!n

anthee nenu appudappudu rastunaayi entii  cry@fl cry@fl cry@fl cry@fl cry@fl
[/quote] @3$% @3$%

Posted

[quote author=gerrard link=topic=199829.msg2436781#msg2436781 date=1307161394]
adhi query aaah  F@!n F@!n F@!n

anthee nenu appudappudu rastunaayi entii  cry@fl cry@fl cry@fl cry@fl cry@fl
[/quote]

same feeling ya  cry@fl cry@fl cry@fl cry@fl cry@fl

Posted

deeeni kuda query analaa vammo..

oka Pedda PROC create antunnaru..


Posted

[quote author=PMREDDY19 link=topic=199829.msg2436788#msg2436788 date=1307161672]
deeeni kuda query analaa vammo..

oka Pedda PROC create antunnaru..
[/quote]

proc aa nuvvinka naku asalu ardham avvani basha matladuthunav  cry@fl cry@fl cry@fl

Posted

[quote author=ammulu link=topic=199829.msg2436790#msg2436790 date=1307161749]
proc aa nuvvinka naku asalu ardham avvani basha matladuthunav  cry@fl cry@fl cry@fl
[/quote]Stored procedure  &D_@@ &D_@@

Posted

aha db lo chaduvkuntunnaru ga ..chadukondi chaduvkondi  *u( *u(

Posted

[quote author=ammulu link=topic=199829.msg2436787#msg2436787 date=1307161645]
same feeling ya  cry@fl cry@fl cry@fl cry@fl cry@fl
[/quote]

nuvveee teesukochi vesavuuu  cry@fl cry@fl cry@fl cry@fl

Posted

[quote author=ammulu link=topic=199829.msg2436790#msg2436790 date=1307161749]
proc aa nuvvinka naku asalu ardham avvani basha matladuthunav  cry@fl cry@fl cry@fl
[/quote]

[quote author=Jack Sparrow link=topic=199829.msg2436796#msg2436796 date=1307161998]
Stored procedure  &D_@@ &D_@@
[/quote]


jack you rock

Posted

[quote author=Jack Sparrow link=topic=199829.msg2436796#msg2436796 date=1307161998]
Stored procedure  &D_@@ &D_@@
[/quote]
[img]http://lh5.ggpht.com/_5bAHDVWi43g/S75F2btpcbI/AAAAAAAAAHM/QVYtcR_K-Bg/1.gif[/img]

Posted

Using Stored Procedures

A stored procedure is a group of SQL statements that form a logical unit and perform a particular task, and they are used to encapsulate a set of operations or queries to execute on a database server. For example, operations on an employee database (hire, fire, promote, lookup) could be coded as stored procedures executed by application code. Stored procedures can be compiled and executed with different parameters and results, and they can have any combination of input, output, and input/output parameters.

Note that stored procedures are supported by most DBMSs, but there is a fair amount of variation in their syntax and capabilities. Consequently, the tutorial contains two classes, StoredProcedureJavaDBSample and StoredProcedureMySQLSample to demonstrate how to create stored procedures in Java DB and MySQL, respectively.



Source :::

[url=http://download.oracle.com/javase/tutorial/jdbc/basics/storedprocedures.html]http://download.oracle.com/javase/tutorial/jdbc/basics/storedprocedures.html[/url]


×
×
  • Create New...