8. February 2009 19:17
Although it is not possible to create NTFS folders ending in periods through Explorer, there are a few ways in which you may end up with such a folder on your hard drive. If you do, you will find that folder difficult to read, update, or delete. Windows will allow you to move it to the recycling bin, but not delete it. You will be presented with an error indicateing that it "Could not find..." when trying to navigate via Explorer or the command prompt.
This folder is likely valid, so running checkdisk will not resolve the issue.
Certain command line tools support a special syntax ("\\?\") which allows you to reference these folders. In this example, I will describe how to delete a folder "C:\Folder\Misc.." which contains files and folders at a lower level. First, we must remove those files and folders:
del "\\?\C:\Folder\Misc.." /s
Next, I can remove the folder itself
1. May 2008 21:12
While troubleshooting DNS related issues, it may become practical for you to flush the local cache of resolved domains. The following command, run from the command line, will do just that.
4. March 2008 09:24
The following script will truncate eveything from the SQL transaction log, and shrink the file.
--Truncate the Transcation log
BACKUP LOG DatabaseName WITH NO_LOG
---Shrink the physical file with 10% reserve
DBCC SHRINKDATABASE (DatabaseName, 10)
27. February 2008 23:08
On the occasion that you must removed data from a table and recover the space, there is a two step process to do this in SQL.
First, you must delete the data, using TRUNCATE or DELETE. The difference between the two has to do with how the data is removed. The delete command allows for a WHERE clause, and the deletions will be processed into the transaction logs. TRUNCATE, on the other hand, is a method for the bulk deletion of an entire table, and it not processed into the transaction logs.
Second, in order to reclaim the disk space previously consumed by data, you must ask the database files to resize themselves accordingly. The following script exemplifies how to truncate a database table, then resize the database (leaving a 10% reserve for future growth).
/* --Remove All Records from TableName */
TRUNCATE TABLE TABLENAME
/* --Shrink the database files with 10% reserve */
DBCC SHRINKDATABASE(DATABASENAME, 10)
11. February 2008 22:45
When you need to understand where which tables are consuming the most space in your database, the following script will come in handy.More...
5. February 2008 12:36
While troubleshooting SQL scripts that run inconsistently, it is often helpful to understand the time it takes to compile a query plan, assess the it, and understand how many index seeks and/or scans are required to complete it. The following code encapsulating your query will allow you to do so.
SET STATISTICS IO ON
SET STATISTICS TIME ON
SET STATISTICS PROFILE ON
SET STATISTICS IO OFF
SET STATISTICS TIME OFF
SET STATISTICS PROFILE OFF