You are currently browsing the Blog weblog archives for April, 2008.
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
| « Mar | May » | |||||
| 1 | 2 | 3 | 4 | 5 | ||
| 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| 13 | 14 | 15 | 16 | 17 | 18 | 19 |
| 20 | 21 | 22 | 23 | 24 | 25 | 26 |
| 27 | 28 | 29 | 30 | |||
- IIS (1)
- Open Source (1)
- Performance (4)
- Personal (3)
- Powershell (1)
- SQL (1)
- SQL Server (21)
- T-SQL (15)
- Uncategorized (6)
- Utilities (5)
- Windows OS (14)
- 14. April 2011: Deduplicating files with LogParser and SQL Server
- 25. February 2011: The final voyage of the USNS H. H. Hess
- 16. February 2011: Free SQL Server training videos
- 23. August 2010: Alert for long-running SQL datbase backups
- 7. April 2010: Learning SMO & Powershell
- 25. February 2010: SQL Generators for moving database files
- 28. January 2010: Index to Filegroup mapping
- 20. January 2010: PowerShell Script to Clean Up Old Files Based on Age
- 7. January 2010: Quick & Dirty way to identify orphan files
- 29. July 2009: Trigger Mass Enable / Disable
- April 2011
- February 2011
- August 2010
- April 2010
- February 2010
- January 2010
- July 2009
- June 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- August 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- October 2007
- September 2007
- May 2007
- April 2007
- February 2007
Archive for April 2008
Ongoing Lessons from the Cluster Lab
10. April 2008 by Bennett.
It’s been a while since I worked on my cluster lab. The first thing that I did was to tear down the old cluster and start over from scratch. The first lesson from this round of testing came when the cluster administrator scanned the hardware resoruces and threw a warning message that stated that only one adapter was found on the node. This warning is caused by fact that the two cluster nodes are interconnected via a crossover cable and the second node is shut down. With the node shut down, there is no physical layer link on the Ethernet card, so the OS thinks that the cable is disconnected.
I got past the error by simply plugging the cluster member’s private network connection into a spare switch that I had lying around. This provided a physical layer link which was what the OS needed to report a valid network connection. After that I rescanned the resources and the cluster installation proceeded.
Posted in Windows OS | Print | No Comments »
Getting HH:MM:SS value from Seconds
7. April 2008 by admin.
Here is another handy date manipulation function. This one converts the number of seconds, expressed as an int, into the HH:MM:SSS format
SELECT
CASE
WHEN @seconds/3600<10 THEN '0'
ELSE ”
END
+ RTRIM(@seconds/3600)
+ ':' + RIGHT('0'+RTRIM((@seconds % 3600) / 60),2)
+ ':' + RIGHT('0'+RTRIM((@seconds % 3600) % 60),2)
Rewritten as a function, we have:
CREATE FUNCTION SecToHHMMSS
(
– Add the parameters for the function here
@seconds INT
)
RETURNS VARCHAR(10)
AS
BEGIN
RETURN
CASE
WHEN @seconds/3600<10 THEN '0'
ELSE ”
END
+ RTRIM(@seconds/3600)
+ ‘:’ + RIGHT(‘0′+RTRIM((@seconds % 3600) / 60),2)
+ ‘:’ + RIGHT(‘0′+RTRIM((@seconds % 3600) % 60),2)
END
GO
Posted in T-SQL | Print | No Comments »
Stripping the time component from a datetime value
7. April 2008 by Bennett.
Here is a very simple and elegant way to strip the time component from a datetime value:
CAST(FLOOR(CAST(@date AS float)) AS datetime)
Written as a function:
CREATE FUNCTION BareDate
(
– Add the parameters for the function here
@date datetime
)
RETURNS datetime
AS
BEGIN
RETURN CAST(FLOOR(CAST(@date AS float)) AS datetime)
END
GO
When we pass in the value ‘2008-02-12 13:25:33.3′, it returns the value 2008-02-12 00:00:00.000
Other ways of stripping the time component:
SELECT DATEADD(dd,(DATEDIFF(dd,0,backup_start_date)),0)
or:
SELECT CAST(DATEDIFF(dd,0,backup_start_date) AS Datetime)Using the convert has performance issues. I’ll have to come up with numbers for all these: or
SELECT CONVERT(Datetime, CONVERT(NCHAR(10), backup_start_date, 121))
Posted in SQL Server | Print | No Comments »
Moving
3. April 2008 by admin.
Yahoo 360 is a lame duck, so I’m moving my postings over to this web site.
Posted in Uncategorized | Print | No Comments »
The IIS Metabase Explorer Rocks
3. April 2008 by Bennett.
Today I was reminded of something that I knew but forgot. The IIS Metabase Explorer for IIS6 (or MetaEdit for IIS 4 and 5) is a very useful tool. I needed to blow away an inheritable attribute of the HttpRedirect property. The Metabase explorer made the task ridiculously simple.
The Metabase Explorer is part of the IIS 6.0 Resource Kit.
Posted in IIS | Print | No Comments »
Partition Misalignment can Cause Poor Performance
1. April 2008 by Bennett.
Here is an interesting Microsoft Knowledgebase article titled Disk performance may be slower than expected when you use multiple disks in Windows Server 2003, in Windows XP, and in Windows 2000.
It explains how a partition misalignment can cause significant I/O by causing reads and writes to straddle track boundaries. The fix is to use the diskpart.exe utility to create an alignment offset when you first create the partition.
This is similar to what you do with SAN storage to align the starting offset to “significant” boundaries. See the 3/31/08 post for more details.
Posted in Performance, SQL Server | Print | 1 Comment »