![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I want to know following memory space related question. 1 . How can i get a Database Size by means of a SQL query? 2. How can i Get a field size (not allocated space) .. ie. i am storing some textual data to a field.. after a insertion i want to know how much space has been occupied by that particular field . ex sno product_name Description 1 sample1 dfkjsdkfj kldsjfkdjk sdkjdfskdjk vcmvxcvmcvnksdjfkdsn m Here i want know the space occupied by the field name "description" for the product id=1. Thanks in adavance Regards Visu. |
#3
| |||
| |||
|
|
On Jun 12, 12:35 pm, visu <k.vis... (AT) gmail (DOT) com> wrote: I want to know following memory space related question. 1 . How can i get a Database Size by means of a SQL query? 2. How can i Get a field size (not allocated space) .. ie. i am storing some textual data to a field.. after a insertion i want to know how much space has been occupied by that particular field . ex sno product_name Description 1 sample1 dfkjsdkfj kldsjfkdjk sdkjdfskdjk vcmvxcvmcvnksdjfkdsn m Here i want know the space occupied by the field name "description" for the product id=1. Thanks in adavance Regards Visu. 1. How can i get a Database Size by means of a SQL query sp_helpdb 'dbname' 2. Here i want know the space occupied by the field name "description" for the product id=1. SELECT SUM(DATALENGTH(description)) FROM table WHERE product_id=1.- Hide quoted text - - Show quoted text - |
#4
| |||
| |||
|
|
Use the length function SELECT LENGTH(description) FROM tablename WHERE id = 1 This will return the length of the description field for the row identified by id = 1. |
#5
| |||
| |||
|
|
2. Here i want know the space occupied by the field name "description" for the product id=1. SELECT SUM(DATALENGTH(description)) FROM table WHERE product_id=1. |
![]() |
| Thread Tools | |
| Display Modes | |
| |