Get the spatial size of the database, the database space has been used

xiaoxiao2021-03-06  69

Execute this exec sp_spaceused test code <% set = server.createObject ("adoDb.recordset") sqlstr = "exec sp_spaceused" rs.open sqlstr, conn, 1, 1

IF = false.write = false.write RS (0) & rs (1) & rs (2) 'Returned Test25.38 MB6.34 MB'RS (0) is the database name, RS (1) is a database space, RS (2) is available space end if

rs.closeconn.close%> You can also write this

<% set = server.createObject ("adoDb.recordset") sqlstr = "exec sp_spaceused" RS.Open SQLSTR, CONN, 1, 1

Response.write RS ("Database_name") 'Database Name Response.write RS ("Database_size")' Database Space Response.write RS ("Unallocated_Space") 'Free Space%>

转载请注明原文地址:https://www.9cbs.com/read-111090.html

New Post(0)