Is It Possible For A Table To Increase Size When Deleting Records?

May 24, 2007

No transaction log involved, only the table itself.



Use sp_spaceused "table_name" to check the space used.



It seems the table size actually increased from the beginning to the middle of deletion, at the end of deletion, its size decreased.



Recovery mode set to be simple, autoshrink turned on.



The tables tested are about 50MB ~ several GB in size, all have the same behavior. The size increased about 5%~10%.



Since the deletion is called from another software, I want to know if it is possible for SQL Server to have this behavior or it is absolutely the 3rd party software's issue



Thanks!

View 2 Replies


ADVERTISEMENT

Database Space Size Increased On Deleting Records

Feb 20, 2008

Hi,

I was running out of space and thus deleted some rows from a table. To my surprise the db size increased. I then shrunk it to bring it back to what it was earlier.

When i deleted some 5000 rows, some space must have been released. Where did the space go and why did the db size increase after deleting the records?

I thght it might be log files..but db is set to Simple Recovery which does not utilize a Log File.

Any reasons?

View 6 Replies View Related

SQL Server 2014 :: Sudden Increase In Table Size?

May 5, 2015

I save Table size and recs. no every day. and check it some days.

...
insert into @t
exec sp_msforeachtable 'exec sp_spaceused ''?'''
...

But Today I saw sudden increase size in a table. about 128 MB in a day. (Average Growth fro this table was 4 or 5 MB in a day)This growth was for Only 4222 Records. While for more number of records (about 7000) in yesterday we had only 2 MB GRowth!

This Table information (Now):

sp_spaceused 'Table1'

Result:

name ---Rows --reserved --data

Table1--1021319--460328 KB --283104 KBI Try to gess The reason. I copy These new records to another table.But The result was more strange : on new table the size of these record was : < 1 MB I copied All records to another table . The size was : 148 MB (while this is 283 MB in my real database)

View 4 Replies View Related

Reporting Services :: Increase Range Bar Chart Size Dynamically Inside A Table In SSRS

Oct 21, 2015

 I have a range bar chart Inside a table of row group and the chart is repeatedly generate according to category ,i want to increase chart height dynamically based on category.

suppose for if category =A THEN CHART HEIGHT=10CM
category =B THEN CHART HEIGHT=7CM

View 5 Replies View Related

Deleting Old Records Is Blocking Updating Latest Records On Highly Transactional Table

Mar 18, 2014

I have a situation where deleting old records is blocking updating latest records on highly transactional table and getting timeout errors from application.

In details, I have one table called Tran_table1 in OLTP database. This Tran_table1 is highly transactional table, it will receive data for insert/update continuously

While archiving 2 years old records from Tran_table1 into Tran_table1_archive in batches(using DELETE OUTPUT INTO clause), if there is any UPDATEs on Tran_table1,these updates are getting blocked and result is timeout errors in application.

Is there any SQL Server hints to avoid blocking ..

View 3 Replies View Related

Reduce Table Size Without Deleting Data

Jul 20, 2006

We are using SQL Server 2000 Standard ed, sp4 on Server 2000 Advanced.We have one table that is three times as large as the rest of the database.Most of the data is static after approximately 3-6 months, but we arerequired to keep it for 8 years. I would like to archive this table (A), butthere are complications.1. the only way to access the data is through the application (they areimages produced by the application-built on Power-Builder)2. there are multiple tables refrencing this table and vise-versa3. we restore the entire db to two other servers for testing and trainingregularly4. there might be more complications that have not been thought ofCurrently, our only plan is to setup a seperate server with a copy of this dbon it and the application. Leave only the tables necessary to access the data,and if this 'archive' works, remove from production the data from the table Aand all references to the table A from rows on the other tables.I mentioned #3 because someone mentioned a third party tool that may be ableto pull the data from the table, archive it elsewhere, and at the same time,place a 'pointer' in the table to the new storage location. The tool theymentioned only works on Oracle and we have not explored beyond that yet.I am ready to explore ideas and suggestions; I am still new to the DBA world,I am out of ideas.Thank you!--Message posted via SQLMonster.comhttp://www.sqlmonster.com/Uwe/Forum...eneral/200607/1

View 1 Replies View Related

SQL 2012 :: Data Size Of Table Is Not Reduced Even After Deleting Millions Of Rows

Sep 21, 2015

I have deleted nearly 30 million rows from a table. But however when I used the sp_spaceused command to calculate the data occupied by the table I don't see any difference in the data size of the table. In fact the data has increased to few MBs after the deletion, but not much.

View 8 Replies View Related

Deleting Records In Associated Foeign Key Table

Dec 2, 2007

Hi, i need the suggestion here in very familiar db situation ..i have a main table and a primary key of that table is used in many other table as foreign key.If i am deleting a record in a main table,how do i make sure that all the corresponding record in the associated tables,where that foreign key is used, gets deleted too?What are my options?Thanks

View 5 Replies View Related

Deleting Duplicate Records From A Table.....

Jul 6, 2006

I loaded one table via SSIS and found that it contained many duplicate records (from the input source). I can create a SQL task to delete them, but I wonder if SSIS offers and task "out of the box" to delete dups?



TAI,



barkingdog

View 6 Replies View Related

Deleting Records From A Table In Server Database

Aug 24, 2015

I'm trying to delete some records from some tables in a SQL Server 2008 R2 database. There's a foreign key relationship between the two tables. To make things easier here's the definition of both tables:

-- Parent table
CREATE TABLE [dbo].[PharmInvInItemPackages](
[InventoryInDetailID] [int] IDENTITY(1,1) NOT NULL,
[InventoryInID] [int] NOT NULL,
[ItemPackageID] [int] NOT NULL,

[code]....

View 5 Replies View Related

SQL 2012 :: Deleting Repeated Records In Table

Sep 24, 2015

I have one table having three columns.This table contains lot of repeated records. I want to delete this records .

In this below example i want to delete all the records which columns id and no columns contains same values.

id no sequence
------------------------------------
35 35432 1
35 35432 2
35 35432 3
36 35432 1
35 45623 1

First three records the columns id and no contains same value. I want to delete this three records.

But in last record for id =35 and no column =45623.it is not repeated so it should not be deleted.

View 8 Replies View Related

Deleting All Records From Table W/stored Proc

Jan 27, 2006

Is there a way to delete records from table passing parameter as tablename? I won't to delete all records from a table dependent on table selected. i'm trying to do this with stored procedure...Table to delete depends on the checkbox selected.

Current code(works)
Public Function DelAll()
MZKDB = MZKHRFin
If sloption = "L" Then
sqlConn.ConnectionString = "Server=" & MZKSrv & ";Initial Catalog=" & MZKDB & ";Integrated Security=SSPI;"
ElseIf sloption = "S" Then
sqlConn.ConnectionString = "Server=" & MZKSrv & ";User id=sa;Password=" & MZKPswd & "; Initial Catalog=" & MZKDB & ";"
End If
sqlConn.Open()
sqlTrans = sqlConn.BeginTransaction()
sqlCmd.Connection = sqlConn
sqlCmd.Transaction = sqlTrans
Try
sqlCmd.CommandText = sqlStr
sqlCmd.ExecuteNonQuery()
sqlTrans.Commit()
frm2.txtResult.Text = frm2.txtResult.Text & " " & TableName & " Prior records have been deleted from the database." & vbCrLf
SetCursor()
Catch e As Exception
Try
sqlTrans.Rollback()
Catch ex As SqlException
If Not sqlTrans.Connection Is Nothing Then
frm2.txtResult.Text = frm2.txtResult.Text & " " & TableName & " An exception of type " & ex.GetType().ToString() & " was encountered while attempting to roll back the transaction." & vbCrLf
SetCursor()
End If
End Try
frm2.txtResult.Text = frm2.txtResult.Text & " " & TableName & " Records were NOT deleted from the database." & vbCrLf
SetCursor()
Finally
sqlConn.Close()
End Try
ResetID()
End Function
If cbGenFY.Checked Then
sqlStr = "DELETE FROM FIN_FiscalYear"
TableName = "dbo.FIN_FiscalYear"
DelAll()
ClearCounts()
timeStepStart = Date.Now
GenFY()
timeStepStop = Date.Now

DispOneCounts()
End If
If cbGenFund.Checked Then
sqlStr = "DELETE FROM FIN_Fund"
TableName = "dbo.FIN_Fund"
DelAll()
ClearCounts()
timeStepStart = Date.Now
GenFund()
timeStepStop = Date.Now
DispOneCounts()
End If
If cbGenFunc.Checked Then
sqlStr = "DELETE FROM FIN_Function"
TableName = "dbo.FIN_Function"
DelAll()
ClearCounts()
timeStepStart = Date.Now
GenFunc()
timeStepStop = Date.Now
DispOneCounts()

End If
If cbGenObject.Checked Then
sqlStr = "DELETE FROM FIN_Object"
TableName = "dbo.FIN_Object"
DelAll()
ClearCounts()
timeStepStart = Date.Now
GenObject()
timeStepStop = Date.Now
DispOneCounts()
End If
If cbGenCenter.Checked Then
sqlStr = "DELETE FROM FIN_Center"
TableName = "dbo.FIN_Center"
DelAll()
ClearCounts()
timeStepStart = Date.Now
GenCenter()
timeStepStop = Date.Now
DispOneCounts()
End If
If cbGenProject.Checked Then
sqlStr = "DELETE FROM FIN_CodeBook"
TableName = "dbo.FIN_CodeBook"
DelAll()
sqlStr = "DELETE FROM FIN_BudgetAccnt"
TableName = "dbo.FIN_BudgetAccnt"
DelAll()
sqlStr = "DELETE FROM FIN_Budget"
TableName = "dbo.FIN_Budget"
DelAll()
sqlStr = "DELETE FROM FIN_Project"
TableName = "dbo.FIN_Project"
DelAll()
ClearCounts()
timeStepStart = Date.Now
GenProject()
timeStepStop = Date.Now
TableName = "dbo.FIN_Project"
DispOneCounts()
End If
If cbGenProgram.Checked Then
sqlStr = "DELETE FROM FIN_Program"
TableName = "dbo.FIN_Program"
DelAll()
ClearCounts()
timeStepStart = Date.Now
GenProgram()
timeStepStop = Date.Now
DispOneCounts()
End If
If cbGenGL.Checked Then
sqlStr = "DELETE FROM FIN_gl"
TableName = "FIN_gl"
DelAll()
ClearCounts()
timeStepStart = Date.Now
GenGL()
timeStepStop = Date.Now
DispOneCounts()
End If
If cbGenRevenue.Checked Then
sqlStr = "DELETE FROM FIN_Revenue"
TableName = "FIN_Revenue"
DelAll()
ClearCounts()
timeStepStart = Date.Now
GenRevenue()
timeStepStop = Date.Now
DispOneCounts()
End If
If cbGenBank.Checked Then
sqlStr = "DELETE FROM FIN_VendorBankAccnt"
TableName = "dbo.FIN_VendorBankAccnt"
DelAll()
sqlStr = "DELETE FROM FIN_VendorBank"
TableName = "dbo.FIN_VendorBank"
DelAll()
sqlStr = "DELETE FROM FIN_bankAdd"
TableName = "dbo.FIN_bankAdd"
DelAll()
sqlStr = "DELETE FROM FIN_bankTERMS"
TableName = "dbo.FIN_bankTerms"
DelAll()
sqlStr = "DELETE FROM FIN_bank"
TableName = "dbo.FIN_bank"
DelAll()
ClearCounts()
timeStepStart = Date.Now
GenBank()
timeStepStop = Date.Now
TableName2 = "dbo.FIN_bankTERMS"
TableName3 = "dbo.FIN_BankAdd"
TableName4 = "dbo.FIN_VendorBank"
TableName5 = "dbo.FIN_VendorBankAccnt"
DispTwoCounts()
End If
If cbFinAP.Checked Then
sqlStr = "DELETE FROM FIN_Period"
TableName = "FIN_Period"
DelAll()
ClearCounts()
timeStepStart = Date.Now
GenPeriod()
timeStepStop = Date.Now
DispOneCounts()
End If

If cbFinVM.Checked Then
sqlStr = "DELETE FROM FIN_vendorClass"
TableName = "FIN_vendorClass"
DelAll()
sqlStr = "DELETE FROM FIN_vendorAdd"
TableName = "FIN_vendorAdd"
DelAll()
sqlStr = "DELETE FROM FIN_vendor"
TableName = "FIN_vendor"
DelAll()
sqlStr = "DELETE FROM FIN_AddressType"
TableName = "FIN_AddressType"
DelAll()
sqlStr = "DELETE FROM FIN_VendorStatus"
TableName = "FIN_VendorStatus"
DelAll()
sqlStr = "DELETE FROM States"
TableName = "States"
DelAll()
sqlStr = "DELETE FROM Country"
TableName = "Country"
sqlStr = "DELETE FROM FIN_IndustrialCodes"
TableName = "FIN_IndustrialCodes"
DelAll()
ClearCounts()
timeStepStart = Date.Now
GenIndCodes()
timeStepStop = Date.Now
DispOneCounts()
DelAll()
ClearCounts()
timeStepStart = Date.Now
FinVendStat()
timeStepStop = Date.Now
TableName = "FIN_VendorStatus"
DispOneCounts()
ClearCounts()
timeStepStart = Date.Now
FinAddrType()
timeStepStop = Date.Now
TableName = "FIN_AddressType"
DispOneCounts()
ClearCounts()
timeStepStart = Date.Now
GenCountry()
timeStepStop = Date.Now
TableName = "Country"
DispOneCounts()
ClearCounts()
timeStepStart = Date.Now
GenState()
timeStepStop = Date.Now
TableName = "States"
DispOneCounts()
ClearCounts()
timeStepStart = Date.Now
FinVM()
timeStepStop = Date.Now
TableName = "FIN_Vendor"
TableName2 = "FIN_VendorAdd"
DispTwoCounts()
End If
If cbFinbudget.Checked Then
sqlStr = "DELETE FROM FIN_BudgetAccnt"
TableName = "FIN_BudgetAccnt"
DelAll()
sqlStr = "DELETE FROM FIN_Budget"
TableName = "FIN_Budget"
DelAll()
sqlStr = "DELETE FROM FIN_CodeBook"
TableName = "FIN_CodeBook"
DelAll()
ClearCounts()
TableName = "FIN_Budget"
timeStepStart = Date.Now
FinBudget()
timeStepStop = Date.Now
DispOneCounts()
ClearCounts()
TableName = "FIN_Codebook"
TableName2 = "FIN_budgetAccnt"
timeStepStart = Date.Now
FinCodeBook()
timeStepStop = Date.Now
DispTwoCounts()
ClearCounts()
End If

View 4 Replies View Related

DELETING RECORDS FROM TABLE WITH NESTED WHERE CLAU

Sep 11, 2007

Hi,

I have a query that is executing properly but i want to delete the results of the query. I am trying to do it but i am messing up somewhere in the syntax

Can anybody help me out with this problem?
Below is the query
DELETE FROM DPT_NEW_BINS WHERE(
Select BIN,LEFT(ACCT_NUM_MIN,16), LEFT(ACCT_NUM_MAX,16), ISO_CTRY_CD, REGN_CD ,PROD_TYPE_CD FROM DPT_NEW_BINS o
WHERE EXISTS (SELECT BIN,LEFT(ACCT_NUM_MIN,16), LEFT(ACCT_NUM_MAX,16), ISO_CTRY_CD, REGN_CD ,PROD_TYPE_CD FROM DPT_temp_NEW_BINS i
WHERE o.ACCT_NUM_MIN = i.ACCT_NUM_MIN AND o.ACCT_NUM_MAX = i.ACCT_NUM_MAX))

CAN SOMEBODY POINT OUT MY MISTAKE?

View 3 Replies View Related

DB Engine :: Reclaiming Table Space After Deleting Records

Aug 5, 2015

I have many large tables with millions of records in a SQL Server database. They all use an Identity column which is the clustered index. We haven't been deleting any records until recently because disk space is now becoming a problem.

Assuming I delete a lot of old records, I'm thinking that the freed up space in the data pages won't be reused. New records will be added at the end of the table because of the Identity column being the clustered index. So the table will keep getting bigger even though there is lots of free space.

Assuming I'm right, then how do I recapture this unused space? Is an alter table rebuild the best way? Or rebuilding the clustered index?

View 2 Replies View Related

How To Increase The DB Size

Mar 5, 2007



hi,

I have one DB in SQL Server 2005.When I was creating it

takes 7813 MB.Now the databse size almost full.Now I want to extend the

DB Size.At my HDD has more space(near by 160 GB).But I don't know how to

extend the Size.More over I had one doubt.Am executing the

exec sp_helpdb command.It shows the Datafile maxsize is Unlimited.I want to

know when the data is full,whether it automatically takes the size from the

HDD or not.

Please Help me out to this Problem.

View 2 Replies View Related

Increase Segment Size

Oct 6, 1998

Hi all,
I encountered error 1105 (Can`t allocate space for object .....) while running a query.
I had dump transaction with no log sucessfully and retry running my query but
still encounter error 1105.

I had checked my database size and following are the info:
Datasize : 2500MB Database size available : 753.39
Log space : 500MB Log space available : 500MB (this was acheive after
after dump trans. twice. it was around 480MB before)

Thus looks like the data segment is full!!!
I expanded the size of the disk device D on which the segment device A is on by 50MB. When I did a sp_helpdevice D, the expansion is reflected.
Next I run sp_extendsegement, A, D.
However running sp_helpsegment A doesn`t show that segment A is expanded.
Please help!!! How do I expand the size of the segment? (without creating a new disk device, is it possible)
Any other way to resolve this problem?

Also how to check if a particular segment is full? eg. the %usage of data/log segment.

Thanks in advance.

View 1 Replies View Related

How Do I Increase Font Size In 6.5?

Jan 27, 1999

I seem to remember that the font size and type can be controlled in SQL Server 6.5 and the process controlls the fonts displayed
throughout the program - Enterprise Manager, Query Tool, etc.

I have just re-installed 6.5 and the fonts are way too small.

Can anyone tell me how this is done?

Thanks.

Jack

View 1 Replies View Related

Increase Database Size

Jan 13, 2005

I have a database that is over 45 GB and need to increase the size, can someone help me with the code to get it done?

Thanks

View 6 Replies View Related

How To Increase Size Of Datatype...

Jul 15, 2006

Dear

I am using varchar data type in my table.it provides maximum 8000 character. but i want more than that.

how to increase size more than 8000

i want to use text datatype but when i type in length it doenst type.it displays only 16.i cant change to another value.

please help me out

Waiting for reply

Regards,
ASIF

View 1 Replies View Related

How Can I Increase The Size Of Varchar

Nov 10, 2006

Dearfriends,
please guide me,
i've a column with varchar(100).
presently, i need that column as varchar(500).



thank you very much.

Vinod

View 4 Replies View Related

HOW TO INCREASE THE COLUMN SIZE

Feb 23, 2007

Dear friends,

i've a column with nvarchar type. how can i increase the size of the column?

Vinod

View 5 Replies View Related

Cant Increase Column Size

Jul 9, 2007

hey

i've a db running sql server express sp2. the db size now is 1.1 gb
i've a table with a varchar column of size 20 . when i try to increase the column size to 50 i get a
timeout exception, and the the cloumn size is unchanged. this table has 2.5 million records

i use sql server management studio express to do the changes

is there a way to increase this timeout or whtever i can do to update this column size?

thx in advance

View 4 Replies View Related

Increase Transaction Log Size

Oct 22, 2007



Hi,

How can I increase the transaction log size of my sql server 2005 database? i can execute the shrink and backup log which can shrink the .ldf file to 1MB. However, since my dts involves a lot of inserts and updates, the my transaction log grows to 700MB in the middle of my dts execution. How can i increase the transaction log size maximum capacity to probably 1.5GB just so it can accommodate my full dts execution?

BTW, this is my commands to shrink the log file:

DBCC SHRINKFILE(<dbname>_log, 1)

BACKUP LOG <dbname> WITH NO_LOG

DBCC SHRINKFILE(<dbname>_log, 1)

cherriesh

View 3 Replies View Related

How To Increase The Data File Size?

Aug 2, 2006

Hi All,
Is it possible to increase the size of data file in SQL Server 2005 Express Edition.
I think the licensed limit is 4096MB whcih i am unable to increase.
Could anyone let if is it possible to increase the data file size and if yes then how?

Thanks,
Varun

View 4 Replies View Related

DB Size Increase From SQL 2000 To 2005

Feb 23, 2008

A few months ago a customer moved from SQL 2000 to SQL 2005. The db wasbacked up on SQL 2000 and restored to SQL 2005. The application using thisdata works on SQL 2005 but takes no advantage of new features. The db onSQL 2000 was about 2.9GB, now on SQL 2005, it is 16.5GB. The db is set toSimple recovery so trx log is only 2mb. The mdf file is 16.5GB, ManagementStudio shows only 5mb free space. There has not been a huge increase intransactions.One of the largest tables has only added 2,000 rows since the move to SQL2005. Yet the data and index size has jumped from about 400mb to 3.5 GB. Iused the 'BigTables.sql' script found at various SQL sites:www.databasejournal.com/img/BigTables.sqlAny ideas why such a large increase?Thanks

View 4 Replies View Related

How To Increase The Data File Size?

Aug 2, 2006

Hi All,

Is it possible to increase the data file size in SQL Server 2005 Express edition?

If yes then how?



Thanks,

Varun

View 1 Replies View Related

Query To Change Increase The Size Of A Field

Apr 11, 2007

Hi all,
I tried to change the size of a field of my table using the query :-

ALTER TABLE test MODIFY id varchar(50)

Initially the size of id was set to 30 .Is there any other way or any error in my query.Please help me soon.



joshymraj

View 2 Replies View Related

Delete Data, But File Size Increase

Jul 23, 2005

I encounter one weird problem, I have a database with around 7 GB ...when I delete a bunch of data from it, it suppose to reduce thedatabase file size, but weirdly, the file size increase to 8 GB.Wondering why. Is it suppose to be like that?Is it the architecture is designed to work like that?Is there any way for me to reduce the database file size?Thanks.Peter CCH

View 2 Replies View Related

SQL Search :: How To Increase Server Buffer Size

Nov 6, 2015

I'm trying to query a table where in the data in a cell is 65KB and when i try to do a SELECT I am unable to get the entire data from the cell.

SELECT CAST(Xml_data as XML) from TableName where ID=100
Error Message: Msg 9448, Level 16, State 1, Line 1 XML parsing: line 241, character 76, well formed check: undeclared entity

View 4 Replies View Related

How To Increase Datagroth Size In Sql 2005 Database?

Mar 4, 2008

View 2 Replies View Related

SQL 2012 :: Increase File Size For A Mirrored Database?

Apr 14, 2015

I need to increase the file size for a mirrored database. I am new to using mirroring for replication. Will increasing the file size break the mirror?

View 2 Replies View Related

Analysis :: Increase Size Of Calculated Column In Cube

Aug 21, 2015

Where we have increase the size of the calculated column in cube..whether in attribute  or some where else...

View 4 Replies View Related

Reporting Services :: How To Increase Chart Size In SSRS

May 25, 2015

How to increase the chart report size to avoid the mismatch of output data like below....

View 2 Replies View Related







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