How Calculate Space That Occupied?

Jun 12, 2007

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.

View 4 Replies


ADVERTISEMENT

Space Occupied By SISS Raw File Is More

Oct 23, 2007


The system I had developed is having a data flow as following:

Source received as file, .dat file
For better performance I€™m doing little transformation between .dat file to SSIS Raw file then from Raw files doing Type2 and Type3 mappings to adhere the business rules and loading the data to destination tables.

The .dat file I receive (there are many file some where around 25 file) is dumped in a folder as €œsource€? and the Raw file are in other folder as €œSSIS files€?.

My concern is the source folder size is 6GB and the same files converted in SSIS raw files format present in SSIS FILE folder and the size of this folder is 10GB.

Why is that so? Where as there€™s no extra data and the transformations between source and SISS files are like substring for the different date format and data type conversion.

Any ideas, your help in this would be appreciated.


Thank you

View 5 Replies View Related

Unable To Release Space Occupied By A Dense Populated Table

Aug 22, 2007



Hi ,
I have a table let say TableA , which have a size of 22 GB.Due to its size i down size this table by deleting 40% rows.So ideally it should size to 15 GB but space is not released by TableA. How i can do it ? I tried shrink database, shrink data file wizards and DBCC command , Reorganize the index but all is in vain.

Any suggestion /solution?

View 4 Replies View Related

Calculate The Disk Storage Space

Sep 19, 2007

HI All

how to calculate the disk storage space of the database from the front using asp.net

Can anyone give suggestion

Thanks

View 6 Replies View Related

How Can I Calculate The Disk Space Which Some Records Used In SQL 2005 Database?

Oct 16, 2006

I execute the following SQL, and return 3 records, I want to know how many disk space the 3 records use, how can I do? thanks! select * from myTable where username='Paul' 

View 6 Replies View Related

How To Calculate The Space (size In Bytes) Used By A BLOB Column In A Row

Dec 3, 2007

What is the easiest way to calculate the space (size in bytes) used by a BLOB column that is already stored in a particular row?

Thanks.

View 3 Replies View Related

Size Occupied Of The Table In Database.

May 13, 2008



Hi all

How to find out size occupied of the table in Database in SQL Server2000

Help me reg.

View 5 Replies View Related

How To Free The Memory Occupied By Blob In MS Sql Server

Apr 18, 2006

i'm working in microsoft sql server and i got following problem:

I have a text files Asia.txt in E: folder with some data in it as shown below

Asia.txt

1, Mizuho, Fukushima, Tokyo
2, Minika, Pang, Taipei
3, Jen, Ambelang, India
4, Jiang, Hong, Shangai
5, Ada, Koo, HongKong

And I have a table Region, in the database Companies, as shown below.

1>CREATE TABLE REGION (ID INT,REGION VARCHAR(25),DATA varbinary(MAX))
2>GO

I queried all the data from Asia.txt, using the OPENROWSET function.

1>INSERT INTO REGION (ID, REGION, DATA)
2>SELECT 1 AS ID, 'ASIA' AS REGION,
3> * FROM OPENROWSET( BULK 'E:Asia.txt',SINGLE_BLOB)
4>AS MYTABLE
5>GO

it occupied some memory then i deleted this record using follwoing query

1>DELETE REGION
2>GO

then it deletes the record successfully but memory is not getting freed

can anyone help me out on this problem

View 4 Replies View Related

How To Replace Empty Space Or White Space In A String In A Stored Procedure

Nov 14, 2007

Hi,
 I am trying to do this:
UPDATE Users SET  uniqueurl = replaceAllEmptySpacesInUniqueURL('uniqueurl')
What would be the syntax.
Any help appreciated.
Thanks
 

View 1 Replies View Related

Mutilple Space Gets Converted To Single Space In Report Viewer Control

Feb 23, 2007

I am generating a Report from Sql Data Source in Sql Server 2005 and viewing the Report in Report viewer control of Visual Studio 2005.
The data in the Data Source contains string with multiple spaces (for example €œ Test String €œ) but when they get rendered in Report viewer control, multiple spaces gets converted to single space €? Test String €œ.

I tried following solutions
1) Replacing spaces with €œ €?
2) Inserting <pre> tag before the string and </pre> tag after the string (Also tried &lt;Pre&gt; instead of <pre>)

But in all the cases result is same. The Report Viewer control is showing €œ&nbsp€? instead of space and €œ<Pre>€? tag instead of preserving spaces.

Please provide me a solution so that spaces can be preserved in Report Viewer.

View 1 Replies View Related

Transact SQL :: How To Find Space Available Or Send Space Alerts In Percentage

Nov 26, 2015

I am using the below script to get space alerts  and now i am interested in sending alerts  if for any drive space available is Less than 10% or 15%.. how to convert beelow code to find in % 

Declare @Drives Varchar(20)
DECLARE @Spaces Varchar(50)
DECLARE @availableSpace FLOAT
DECLARE @alertMessage Varchar(4000)
DECLARE @RecipientsList  VARCHAR(4000);
CREATE TABLE #tbldiskSpace

[Code] ....

View 3 Replies View Related

Trans Log-&>space Allocated 27GB, Space Used 100MB

Mar 2, 2005

Hi.. I was doing a good maintenance on my DB and my trans log LDF keep growing until 30GB but my DB data file MDF is only 2GB. I found the two following method to reduce my log size.

Method 1: I used veritas to backup log file with truncate
Method 2: I used the shrink database option in Enterprises manager to shrink it (file chosen=log , use default option)

After doing that, I found my LDF log file is still about the same size=27GB but when I see clearly, from the shrink database windows, the log spaced used reduced to only 100MB, the allocation log space is still 27GB. Why? How to make the LDF smaller to be the around the same size as the space used 100MB?

View 1 Replies View Related

Double Space Replaced With Single Space By Dbms ??!

Jul 20, 2005

This is driving me bananas. Can't find any info on this anywhere....SQL 2000 seems to replace double space with a single space when I seta varchar field to " " (2spaces), it only stores " " (1space). Whyon earth would microsoft do this? If I save 2 spaces - I WANT TO SEE2 SPACES!!!!Can anyone help? Is this a database setting? Is this due to usingvarchar?Any help appreciated.Colin Hale

View 2 Replies View Related

Problem With Space Allocated For Transaction Log Space

Dec 5, 2001

Hello,

Somebody know how to reduce the space allocated for the transaction log space for my SQL_DB ?

3700 MB allocated but only 100 MB used and 3600 MB are free !

Transaction log properties :
Automatically grow file are filled
file growth by percent = 5%
maximum file size - restrict filegrowth = 3700 MB (we can't reduce it !)

Thank you for your precious help !
Khaix from Brussel.

View 1 Replies View Related

Suppress Multiple Space To Single Space..

Nov 14, 2006

How do we suppress multiple spaces to a single space in T-SQL

E.G.

Field: FullName

e.g.

WOMENS HEALTH RIVER VALLEY
JOHN FAMILY MED GROUP
HERSH STWEART P.
PARK HEIGHTS MEDICAL CENTER
KOPP WHITEFIELD E

The o/p wanted is

HERSH STWEART P.



Thank you.


View 3 Replies View Related

Space Error But I Have Enough Space

Nov 24, 2000

I made some copy of table and I have this error but on my hard disk i have 4 gig of empty space.

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC SQL Server Driver][SQL Server]Could not allocate space for object 'Backup_Date_11_24_00_Time_9_08_34_AM' in database 'LogActiviteIntramedia' because the 'PRIMARY' filegroup is full.

/Intranet_API/Forms/videTableLog.asp, line 16

My question is how can I increase the space of primary filegroup?

Thanks and have a good friday

View 2 Replies View Related

Calculate % Qry

Feb 13, 2007

Hi,
 I am trying to execute a query which calculate % on group by. here is the query
SELECT     C.USR_HIGHEST_DEGREE,COUNT(DISTINCT C.MASTER_CUSTOMER_ID) AS [# MEM],(convert(numeric(5,2),COUNT(DISTINCT C.MASTER_CUSTOMER_ID))
/    (
 
SELECT convert(numeric(5,2),COUNT(CC.MASTER_CUSTOMER_ID))    FROM         MBR_PRODUCT AS MPP WITH (NOLOCK) INNER JOIN                      PRODUCT AS PP WITH (NOLOCK) ON MPP.PRODUCT_ID = PP.PRODUCT_ID INNER JOIN                      ORDER_MASTER AS AA WITH (NOLOCK) INNER JOIN                      CUSTOMER AS CC WITH (NOLOCK) ON AA.SHIP_MASTER_CUSTOMER_ID = CC.MASTER_CUSTOMER_ID INNER JOIN                      ORDER_DETAIL AS BB WITH (NOLOCK) ON AA.ORDER_NO = BB.ORDER_NO ON MPP.PRODUCT_ID = BB.PRODUCT_ID              WHERE (CC.CUSTOMER_STATUS_CODE = 'ACTIVE') AND (BB.CYCLE_END_DATE >= GETDATE()) AND (AA.ORDER_STATUS_CODE = 'A') AND                       (BB.LINE_STATUS_CODE = 'A') AND (BB.FULFILL_STATUS_CODE IN ('A', 'G')) AND (MPP.LEVEL1 IN ('NATIONAL'))
 
 
)*100 AS [%]
 
FROM         MBR_PRODUCT AS MP WITH (NOLOCK) INNER JOIN                      PRODUCT AS P WITH (NOLOCK) ON MP.PRODUCT_ID = P.PRODUCT_ID INNER JOIN                      ORDER_MASTER AS A WITH (NOLOCK) INNER JOIN                      CUSTOMER AS C WITH (NOLOCK) ON A.SHIP_MASTER_CUSTOMER_ID = C.MASTER_CUSTOMER_ID INNER JOIN                      ORDER_DETAIL AS B WITH (NOLOCK) ON A.ORDER_NO = B.ORDER_NO ON MP.PRODUCT_ID = B.PRODUCT_IDWHERE     (C.CUSTOMER_STATUS_CODE = 'ACTIVE') AND (B.CYCLE_END_DATE >= GETDATE()) AND (A.ORDER_STATUS_CODE = 'A') AND                       (B.LINE_STATUS_CODE = 'A') AND (B.FULFILL_STATUS_CODE IN ('A', 'G')) AND (MP.LEVEL1 IN ('NATIONAL')) GROUP BY C.USR_HIGHEST_DEGREE
My problem here it , query gives error. I would appreciate if someone can give me any idea how to go about this. I tried calculating % outside sql but still doesn't work.
Any help would be appreciate.

View 3 Replies View Related

Calculate Sum Of SQL Top 10

Mar 30, 2007

I have an SQL statement which returns the Top 10 states with the number of visitorsSELECT TOP 10 Customer.State States, COUNT(Customer.state) Visitors    FROM [Customer] WHERE Customer.year = '2006'    GROUP BY Customer.state    ORDER BY COUNT(Customer.state) DESCSo far this is what I havestate| visitorsMD341527.2PA215417.2NJ127510.2NY10258.2VA8136.5MA2922.3FL2562DE2431.9OH2411.9CA2381.9But what i need is to calculate the total for the Visitors column in my SQL so that is like soMD341527.2PA215417.2NJ127510.2NY10258.2VA8136.5MA2922.3FL2562DE2431.9OH2411.9CA2381.9Total Top 10995279.3Total for All Years12555100I tried using the sum but I was only getting one value and not the rest...So how can i accomplish this?Thank you  

View 8 Replies View Related

How To Calculate?

Feb 13, 2008

 
Hi all,
 
  I'm having the table in the following structure,
  UId  - int
  Pct - int
  Amt - money
  Example
  UId      Pct     Amt
   12      25       1500
   12      30       2500
   12      45       2000
 
  i want to calculate to calculate the sum of amount for the UId 12 in the following manner,
  sum of ( Amt * (Pct/100)) for UId = 12
   how to write query in sql server 2000?
   when i calculate if the value (Pct/100) < 0 that is 0.25 then it will take it as 0 so i'm getting all the values as 0.
Thanks!         
 

View 2 Replies View Related

Calculate Mtd And Ytd.

Mar 7, 2001

I have a table that has a providername and totals field.
I want to be able to calculate the MTD and YTD totals for each provider.

EX. Provider MTD YTD

Bob 100.00 300.00

But I am not sure how. I can get both totals seperately, but not n the same line....
Thanks
Ron

View 3 Replies View Related

How To Calculate Age

Nov 10, 2006

Can anyone help me with how to calculate the exact age.

Thanks in advance.

View 1 Replies View Related

Calculate Age?

Jan 25, 2004

I have a DOB field in my sql table, does anyone know how to display that field as an actual age in a view or a SP?

View 8 Replies View Related

Calculate %

Apr 15, 2008

I want to calculate rate as percentage using code below:

SELECT OrderBy, NumShiped/Total AS Rate FROM Order

I always got Rate = 0 even thought NumShiped = 80 and Total = 100

What is problem?

View 3 Replies View Related

Calculate Age From DOB

May 30, 2008

Hello,

I have a date of birth column in my table and I want to calculate age based on this date. Here is the code I am trying to use in my select statement.

DateDiff ("yyyy",(a.date_of_birth),CurrentDate)

Apparently CurrentDate is not recognized by SQL. What is the best way to do this?

View 9 Replies View Related

How To Calculate Age Using The ID NO

Jan 4, 2008

I have the table with list of 1500 employees with the following headings.
Surname, Ini,title,gender,Race,IdNo,FirstName

Then I need to calculate the age of each employee but I am stuk.
Please assist me.

View 8 Replies View Related

SQL Calculate Percentage

May 6, 2008

Hello every one, I am trying to get the total percentage of a column









Regions
Workbooks Required
Workbooks Sent 
Workbooks Returned
Workbooks Complete

A
20
21
20
18

B
33
33
33
30

C
19
29
18
16

D
9
18
8
8

Totals




Thanks in advance for any tips/solutions.

View 5 Replies View Related

Need To Calculate Grade Age

Mar 7, 2004

Need to calculate the Grade age based on the birthdate and Nov month and 30th Day of the current year.
I have a working datediff statement but I need to always but in the current year. I would like to have the statement get the current year. Then if the age is greater than xx and less than xx your age level is "xyz"

This works DateDiff("d" [Birthdate], 11/30/2004) /365.25 will return the age.

I want to replace the 2004 with a getdate yyyy so I do not need to maintain this statement.

Thanks in advance of a reply
Gary

View 2 Replies View Related

Calculate Date

Nov 12, 1999

Hi All!
I need a query to find all dates from today to one-year back.
If I start from today day I need find all dates until 11/12/98.
Thanks a lot.
Greg.

View 3 Replies View Related

Calculate Age Based On Dob

Aug 26, 2004

hi all;

I have seen posts on numerous websites to get the age from a dob column I am faced with the same problem but get this error:

Server: Msg 403, Level 16, State 1, Line 1
Invalid operator for data type. Operator equals divide, type equals datetime.

when I run the following query:

SELECT ROUND((currentdate - DOB)/365.24,0) FROM FL1_A_Backup

All I need is a simple statement that calcualtes the age from the dob column(smalldatetime) then creates a new row which it puts the data into.
I have already created a CurrentDate column which has a (getdate()) value attached to it.

This is nothing fancy or complicated and I just need to figure out from the year I'm not really concerned about if the person has a bday tomorrow or so on.

I know I am probably doing something wrong with this query and am not shy to say that I have only been using ms sql for a couple of months (basic select statements).

View 14 Replies View Related

Calculate Difference?

Dec 30, 2003

I am having trouble creating a sp for the following situation:

The database contains a record of the mileage of trucks in the fleet. At the end of every month, a snapshot is collected of the odometer. The data looks like this:


Truck Period Reading
1 1/31/03 55102
2 1/31/03 22852
1 2/28/03 62148
2 2/28/03 32108
1 3/31/03 69806
2 3/31/03 52763

How can I calculate the actually miles traveled during the month in a query?

TIA,

Rob

View 7 Replies View Related

How To Calculate Percentage

Apr 28, 2004

b/w two colums?

i have two numberic columns
i want percentage of column2/column1
They are on separate table.. l am intended to creat view with my results.
thanks

View 8 Replies View Related

Calculate Percentage Value

Aug 29, 2013

I have requirement in which i need to calculate percentage value based on billamount and concession amount..to calculate the percentage part and show the o/p.

SELECT PP.KID_ID_NO_V,(PP.FIRSTNAME_V + SPACE(1) + PP.LASTNAME_V)AS [PATIENT_NAME],BM.TOTAL_AMOUNT_M AS [BILL_AMOUNT],BM.CONCESSION_AMOUNT_M AS [CONCESSION_AMOUNT],BM.BILL_AMOUNT_M AS [TOTAL_AMOUNT],
FROM BILL_MASTER BM
INNER JOIN PATIENT_PROFILE PP ON BM.PATIENT_ID_N=PP.PATIENT_ID_N
WHERE BM.BILL_SETTLED_C='Y'

[code]....

View 5 Replies View Related

Calculate Age When DOB Is Null?

Apr 20, 2015

What is the best way, or a good way, or even a way to calculate age using a DOB field when the DOB field is sometimes NULL so that the result does not return NULL? Would prefer to just return an empty string.

I have this, which works, but returns NULL when DOB field is NULL.

floor(datediff(day, DOB, CURRENT_TIMESTAMP) / 365.25) as Age

And this obviously returns an error

isnull(floor(datediff(day, c.DOB, CURRENT_TIMESTAMP) / 365.25),'') as Age.

I prefer not to write a function.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved