Reclaiming Reserved Space For Tables
Jan 23, 2008
Dear Friends,I'm running a SQL 2005 database. Lately (in the last 4 months) my database size has grown exponentially and now totals 2.5 gig (it used to be about 100mb). When I run sp_spaceused i get the following info:
Reserved Space 2522MB
Data 450MB
Indexes 215MB
Unused 1856MB
<!--[if !supportLineBreakNewLine]-->
The unused space is reserved by my two largest tables, one being 542mb (which is a log I create and the size seems fine for the amount of data) reserving 1033mb and the other being 121mb (which is another log and also seems fine) reserving most of the rest.
I have tried running DBCC SHRINKFILE and DBCC CLEANTABLE commands on a backup copy of the database and cannot seem to free the unused space.
I have also tried copying the database in an attempt to reduce the unused reserved space and have tried creating a new database and importing the tables with no luck
Any help would be greatly appreciated, noting that I'm honestly not that technical and would probably need step by step instructions, but if you only have time to point me in the right direction that would also be of great help!
Jano
View 9 Replies
ADVERTISEMENT
Nov 27, 2012
I'm running a security application that generates a lot of events. I have gone in over the past couple days and deleted large numbers of old events in an effort to reclaim space on the D: drive where the SQL DB for this app resides. I did this throught the app itself... through its GUI front end.
I'm not having any impact. There is not a file on the same drive where the deleted events are being directed to. If all these events are going away, why does my used space on the drive not shrink? I came at it from another tack, creating sql queries to delete old events from the same app. I did this through queries in the SQL mgmt studio. The tasks (multiple) completed successfully, and the report on the # of rows 'affected' showed that it was a substantial number. No decrease in the windows drive space being used. Any tips?
View 1 Replies
View Related
Mar 13, 2008
I'm trying to figure out how to reclaim unused space in a huge table (tbl) after setting one of the text columns to be the empty string. Other tables have foreign key columns associated with tbl.
After doing something like this,
update tbl set col = ''
the table doesn't automatically reclaim that space. If I do a direct insert into a new table like this,
insert into tbl2 (cola, colb, colc) select * from tbl
the new table is smaller as expected (about half the size in my case). Any ideas?
Rob
View 3 Replies
View Related
Jul 11, 2014
Having just archived quite a bit of data from the main Production DB, I now have around 15% free, reclaimable space sat in the data file.
I'm reluctant to run DBCC SHRINKFILE as that apparently causes a lot of Index fragmentation which will cause issues for performance - how else can the space be allocated back to the OS?
View 4 Replies
View Related
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
Sep 22, 2005
Hey guys,
I have a table which has 6 text columns (tblA).. I no longer require 1 of those text columns and want to reclaim the space that it is currently taking up..
Is the only way to BCP out all the data (except the 1 column i no longer require) drop the column and BCP the data back into the table?
View 12 Replies
View Related
May 20, 2015
In on of the server tempdb is not releasing the reserved space after completion of data loads,as of now 99% of free space available in data file,we tried to shrink the datafile ,and space has not been released.
View 7 Replies
View Related
Nov 19, 2007
I was trying to find out how much space is available in a 2000 db for allocation to tables and indexes. I am trying to find the amount of space that has to be used-up before another allocation is automatically made to the database. I looked at sp_spaceused but BOL is rather sketchy at defining what the numbers it returns really mean. Is the "unallocated space" the value I am looking for?
Thanks,
Michael
View 1 Replies
View Related
Jun 2, 2004
How to find rowcount and size(space used) for all tables in a db? Can any one give me the script please?
Thanks,
View 2 Replies
View Related
Aug 13, 2014
Recently maintenance was done removing some tables from the original filegroup in one drive of our SQL Server 2012 Standard Edition 64bits to another created on a separate physical drive. I was expecting the full amount of data moved to the secondary filegroup to show up as unused on the primary filegroup but that doesn't seem to be the case. Do I have to do anything after the move to release that space, not to disk, but to the database as unused?
View 2 Replies
View Related
Jan 12, 2001
Hi,
We have a table with a column called 'text' Yes, text is a reserved keyword for data type. I can select it 'SELECT text FROM thistable' but when I try to use it in the order clause, 'SELECT text FROM thistable ORDER BY text', I get this error:
'The text, ntext, and image data types cannot be used in an ORDER BY clause'
I know, you're not supposed to used reserved keywords but the person who initially created this didn't know. We would prefer not to change the column name as this would require tons of changes in the code & COM object.
Is there a way to order this column?
Thanks.
View 2 Replies
View Related
Mar 2, 2001
The Query:
INSERT INTO Table1
VALUE('this doesn't work')
How can I Insert strings like the one above, into my database?
View 3 Replies
View Related
Sep 24, 1998
Does anyone know where I can get a 7.0 reserved word list?
View 1 Replies
View Related
Apr 29, 2002
I migrated a SQL7 database to a SQL2000 server by restoring from a backup file. Everything worked fine until we restarted the SQL Service a few days later and suddenly a table named Function caused me much grief
It seems Function is a reserved word in 2000 - but not in SQL 7.
I am guessing the restore fooled the system into thinking it was a SQL7 database until the restart? Anyone have any ideas why else it would have worked just fine for 5 days, then die on a restart of SQL service (not even a reboot!)
Sandie
View 1 Replies
View Related
Feb 11, 2014
I've got a sproc that we are migrating from SS2K that uses the reserved keyword 'Pivot'. Best way to replace it. I think it is renameable until the select from TempDB (which is mysterious as I can't see a table in tempDB by that name!!) as below...
CREATE PROCEDURE [dbo].[sp_CreateXtab]
@select varchar(8000),
@sumfunc varchar(100),
@pivot varchar(100),
@table varchar(100),
@SQLOutput varchar(8000) OUTPUT
[code]....
View 3 Replies
View Related
Oct 21, 2005
Hi, I have got a problem. When I try to access my database table Users, I get the following error:
SELECT permission denied on object 'Users', database 'Users', owner 'dbo'.
So
I tried to grand this select command in MS Web Data Administration, but
it doesnt work. When I try to grand db_datareader role to dbo, I get
the following error
[Microsoft][ODBC SQL Server Driver][SQL
Server]Cannot use the reserved user or role name 'db_datareader'.
Does someone have an idea where could be a problem?
View 1 Replies
View Related
Jan 14, 2005
We want to covert all reserved words
in procedures to upper case,any suggestions ?
View 3 Replies
View Related
May 8, 2007
I have one column name that is: description
when i write a query the world lights up with blue, I think I saw someone using [ ] around the word but I no longer remember if this is the way to handle reserve words that have been use as columns names
View 10 Replies
View Related
Nov 8, 2007
Hi there,
I'm trying to recreate a MS-SQL database in MySQL. One particular table has a column names "Precision", a reserved word in MySQL. I woudl really prefer to keep this name if possible as it will be referenced in all sorts of places. I've tried single and double quotes, that didn't work.
Is it possible to use reserveds word as column names? How?
cheers
View 6 Replies
View Related
Jul 25, 2007
Hi!
We are encountering an issue of using OLE DB destination with the field name of the table is a reserved word in the database.
The database is DB2 V8 (mainframe). "partition" is one of the reserved word in V8 (It is not in the previous version and the whole thing worked fine).
It errors out when it reaches to the OLE DB destination task to do the insert. It complaints about using the reserved word, "partition". We could use an "OLE DB command" (instead of a to do an OLE DB Destination) with the insert SQL statement explicitly by putting double quote around the field name, partition in the insert statement. It works this way. But We wondered if there is any work around of using a reserved word in OLE DB destination in that case?
Thanks!
View 10 Replies
View Related
Mar 8, 2010
I am attempting to define a Transactional Publication with Updateable Subscriptions.
One of the articles in the definition has a column called "insertDate" The attempt fails with"A .NET Framework error occurred during execution of user-defined routine or aggregate "sp_MSmakeconflicttable_ sqlclr" System.Data.SqlClient.SqlException: Column names in each table must be unique. Column name insertdata in table 'conflict_ <Publication Name>_<TableName>' is specified more than onceDoes sp_MSmakeconflicttable_sqlclr attempt to create a derived table with this additional column.
Must I rename my column.Are there any other names I should watch out for (other than the standard reserved keywords).
View 8 Replies
View Related
Jan 8, 2008
Here we go,
I have a great question for all of you.
What is the problem in using reserved words in table columns name? Any one have a compeling reason not to use?
Here is an exemple:
/ ******** Table ********/
Entity
EntityId
Name
When you query this table you should use the [ ] like this:
SELECT EntityId,[Name] FROM Entity
Anyone have any objection to this, with actual facts?
The question why use this?
This about the programing object in C#
Entity oneEntity = new Entity();
oneEntity.Name = "Test Entity";
It could be:
oneEntity.EntityName = "Test Entity";
Any one???
View 9 Replies
View Related
Nov 29, 2007
I have tried both in sql server 2000 and sql server 2005 the following code:
DECLARE @DOC VARCHAR(100)
DECLARE @HDOC INT
SET @Doc='<datos><texto><![CDATA[lÃnea átona]]></texto></datos>'
EXEC sp_xml_preparedocument @HDOC OUTPUT, @DOC
SELECT * FROM OPENXML(@HDOC,'datos',2) WITH (texto nvarchar(50))
I always get an error 6603 in SQL2000 and 6602+8179 in SQL2005, wich means it can't parse the 'Ã' and 'á' characters, though they are in a CDATA.
I have tried with <,>,@ characters and it works fine.
I have also tried using 'á' and 'í' without CDATA but I get the same message:
DECLARE @DOC VARCHAR(100)
DECLARE @HDOC INT
SET @Doc='<datos><texto><línea átona></texto></datos>'
EXEC sp_xml_preparedocument @HDOC OUTPUT, @DOC
SELECT * FROM OPENXML(@HDOC,'datos',2) WITH (texto nvarchar(50))
View 5 Replies
View Related
Dec 9, 2003
Please can anyone help me - I am trying to establish whether there are any reserved symbols in SQL passwords
eg % £ " $ ( / < * etc
The SQL BOL has a list of reserved words but I cannot find a list of reserved symbols.
We have a problem where by for example if the main part of the password is "test" and my user wants to add a punctuation mark into this we get "You are attempting to use an invalid character message"
Specifically
"test$" is accepted "$test" is not accepted
None of "te+st" "+test" "test+" are accepted.
Has anyone else come across this and found a list of the logic that produces these results so I can point my users in the right direction?
Cheers
View 3 Replies
View Related
Sep 26, 2007
Hi,
I haven't found anything that shows that "sample" is a reserved word in SQL 2000. However when I enter it in Query Analyzer, the color changes to blue, as it is a transact-sql word. However, I'm still able to create a table called sample or name the column.
Does anybody know why query analyzer recognizes it as a transact-sql/reserverd word??
Thanks in advance,
Jorge
View 6 Replies
View Related
Mar 19, 2004
Hello all,
I have a database that supports two different applications.
For arguments sake I'll call them "intelligent app" and "clueless app"
The client that provided me the schema for the clueless app used reserved words as field names.
The words used are:
value, state, and time
I explained to the client that modifying them could prevent current/future issues.
The client is an "oracle" db (and in my mind should know better but .....) and responded back to me with the following:
BEGIN QUOTE
They are not currently reserved and there is no guarantee they will ever be reserved. In fact, the SQL server line eliminates as many words from the reserved list as they add with new releases. There are other words on the
possible future reserved keyword list that I do not wish to avoid either unless forced to some day, like depth, size, class, zone, level and others.
END QUOTE
Now for the assistance request, where can I find the documented ramifications of using reserved words?
I want to have my documentation (and my ducks lined up) when this clients portion of the app fails.
Any and all assistance is greatly appreciated.
T. Mullins
View 4 Replies
View Related
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
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 <Pre> instead of <pre>)
But in all the cases result is same. The Report Viewer control is showing €œ €? 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
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
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
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
Nov 19, 2007
Re: SSRS report viewer Execution ' ' cannot be found
(rsExecutionNotFound) Reserved.ReportViewerWebControl.axd
Every now and then, my users get this error while in the Reportviewer.
Usually, they have to close the window where the report was rendered
and pull it open again. Attempting to open the report again does not
work.
What is this?
I run the report viewer like this:
<rsweb:ReportViewer BackColor="Transparent" ZoomMode="Percent"
width="100%" ProcessingMode="Remote" ID="ReportViewer1"
runat="server">
<ServerReport ReportPath="/myfolder/myreport"
ReportServerUrl="http://myserverr/reportserver" />
</rsweb:ReportViewer>
In my web config:
<compilation debug="true" strict="false" explicit="true">
<assemblies>
<add assembly="System.Data.OracleClient, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="Microsoft.ReportViewer.Common, Version=8.0.0.0,
Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0,
Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
</assemblies>
<buildProviders>
<add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider,
Microsoft.ReportViewer.Common, Version=8.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a"/>
</buildProviders>
</compilation>
<httpHandlers>
<add path="Reserved.ReportViewerWebControl.axd" verb="*"
type="Microsoft.Reporting.WebForms.HttpHandler,
Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a" validate="false"/>
</httpHandlers>
Thanks for any help or information.
View 1 Replies
View Related
Jul 28, 2015
I am setting up my first sql node on a 2 node cluster and runing into this
The disks are already added into the failover cluster manager
View 10 Replies
View Related