SQL
< Programmierung
< sundrummer
Get flash to fully experience Pearltrees
USE Master IF EXISTS ( SELECT * FROM sysobjects WHERE name = 'sp_CompareDB' and type = 'P' ) DROP PROC sp_CompareDB CREATE PROC sp_CompareDB @db1 varchar (128),
Der normale Weg, eine Microsoft SQL Server-Datenbank zu verkleinern ist über das Microsoft SQL Server Management Studio bzw. über den Befehl DBCC SHRINKDATABASE . Doch was ist, wenn die Datei der Datenbank nicht kleiner wird? Was ist, wenn die Datenbank anzeigt, dass nur noch ein paar Megabyte Speicherplatz frei sind, obwohl Sie jede Menge Datensätze aus der Datenbank gelöscht haben? Das ist mir mit einer Datenbank passiert. Inhalt: ca. 40 Mio.
New article in wiki code: Breaking Up SQL Server Databases into Multiple Files File access is fundamental and essential consideration to an OLTP system. If your system is busy (it gets a high number of transactions), or you expect it will be in the future, put in a little planning to prevent wait times at the disk. Here we will discuss file placement, adding data and log files, and how to determine if your system is experiencing disk contention. For even more information, check out the Recommended Reading links at the bottom of this article.
By Scott Mitchell Introduction One of the benefits of using Source Code Control (SCC) software like SourceSafe, Perforce, Subversion, Vault, and others is that the software keeps a detailed history of all changes to the source code. With SCC, you can see how the code for a particular file has changed over time, and when and who made the changes.
Some time ago I happened to comment on the post, " How do I track data changes in a database " ... My comment didn't come out as understandable, so I wrote this little piece to explain how to audit changes in a table. First I create a table to record the changed data: CREATE TABLE [dbo].
Av rating: Total votes: 132 Total comments: 43 Database Design: A Point in Time Architecture 22 February 2007 Point in Time Architecture (PTA) is a database design that guarantees support for two related but different concepts – History and Audit Trail.
Welcome to SQLBackupRestore.com, your online resource for SQL Server backup and recovery issues. The articles are generally applicable to both SQL Server 2000, SQL Server 2005, SQL Server 2008, SQL Server 2008 R2 and SQL 2012. If any parts are applicable only to a specific version, they will be clearly indicated. The SQL Server Books Online documentation should still be your primary source of information on SQL Server. The information presented here is more of a troubleshooting guide, a discussion of common issues faced by users, when dealing with SQL Server backup and recovery issues. If there are any topics you would like me to add, or suggestions on improving the articles, please drop me a line at yeoh.ray.mond@yohz.com .
I have modified isp_Backup, which is the stored procedure that I use to backup SQL Server databases. This new version includes one bug fix and three new features: Bug Fix – removed ReportServerTempdb from exclusion list Bug Fix – fixed file retention code to handle database names with spaces Feature – support for SQL Server 2008 including compression Feature – archive bit option Feature – COPY_ONLY option I decided that excluding the ReportServerTempdb from the backups was unnecessary. This database, used by Reporting Services, is in FULL recovery model by default, so this exclusion could have caused you to run out of space in its transaction log.
In a current project we were wondering why an application database grew quickly during the last couple of weeks of development and testing. We wanted to know the space used of each table without using Management Studio's table properties. Actually SQL Server gives you everything you need with its Stored Procedure sp_spaceused . Unfortunately this SP does not support iterating over all tables in a database, so we needed to leverage another (undocumented) Stored Procedure sp_msForEachTable . SET NOCOUNT ON DBCC UPDATEUSAGE(0) -- DB size.