by Joe Havelick
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
rmdir "\\?\C:\Folder\Misc.."
References:
http://support.microsoft.com/default.aspx?scid=kb;en-us;320081
44c31172-de5f-4a53-8ce6-de0a8d26df92|1|5.0|27604f05-86ad-47ef-9e05-950bb762570c
Tags: server 2003,
Tech Tips
by Joe Havelick
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.
ipconfig /flushdns
1ff44cf0-fb7f-4c5d-8f1b-bd51b7819725|0|.0|27604f05-86ad-47ef-9e05-950bb762570c
Tags:
Tech Tips
by Joe Havelick
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)
cf152ad4-bd75-41ef-957c-35cd8f207f8d|2|5.0|27604f05-86ad-47ef-9e05-950bb762570c
Tags: sql
Tech Tips
by Joe Havelick
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).
USE DATABASENAME
/* --Remove All Records from TableName */
TRUNCATE TABLE TABLENAME
/* --Shrink the database files with 10% reserve */
DBCC SHRINKDATABASE(DATABASENAME, 10)
e91c351e-e5c3-4aa4-b196-3cb5d585ddba|4|5.0|27604f05-86ad-47ef-9e05-950bb762570c
Tags: sql
Tech Tips
by Joe Havelick
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...
c57c1945-e591-4405-a3e7-b0b33d50de5a|0|.0|27604f05-86ad-47ef-9e05-950bb762570c
Tags: sql
Tech Tips
by Joe Havelick
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
--SQL Statement
SET STATISTICS IO OFF
SET STATISTICS TIME OFF
SET STATISTICS PROFILE OFF
b6ac4bf4-da6e-40aa-8bf7-f09b4d9cc2f7|2|5.0|27604f05-86ad-47ef-9e05-950bb762570c
Tags: sql
Tech Tips