Posted on October 19, 2008 by codeslammer
In order to test drive the data modeling features of SS2008, I decided to use the engine for a real-world application. I’m now attempting to use SQL Server to manage the Bateman household. My first table in the design is a simple list of chores that we need to make sure get done around the [...]
Filed under: Design, SQL Server, Tools | 3 Comments »
Posted on October 10, 2008 by codeslammer
Depending on whether you are more of a developer or more of a DBA you may care more or less about this next feature. However, anyone can benefit from it. SSMS 2008 makes it very easy to crack open the Activity Monitor as there is a noticeable button right on the toolbar.
Once inside you get [...]
Filed under: Performance, SQL Server, Tools | 1 Comment »
Posted on October 9, 2008 by codeslammer
As I have been playing with the newest version of Microsoft’s SQL Server Managements Studio (SSMS), I wanted to share a few of the cool new features. It seemed that the jump from Query Analyzer in SQL Server 2000 to SSMS in 2005 was not necessarily a smooth one and many people complained about SSMS. [...]
Filed under: SQL Server, Tools | Leave a Comment »
Posted on September 7, 2008 by codeslammer
Although my previous post was a bit hasty, I wanted to follow up with some additional comments about the magic in the middle of the UDF created to remove any non-numeric characters from a column in a query result set. As you can see there is a relatively cryptic body of the function that somewhat [...]
Filed under: Data, SQL Server | 1 Comment »
Posted on September 2, 2008 by codeslammer
I recently had a need to get a distinct list of numbers from a freeform text field in a database. After some analysis, my needs were met by the following approach:
CREATE FUNCTION dbo.UFNG_ONLY_DIGITS (@StrVal AS VARCHAR(max))
RETURNS VARCHAR(max)
AS
BEGIN
WHILE PATINDEX(‘%[^0-9]%’, @StrVal) > 0
SET @StrVal = REPLACE(@StrVal,
SUBSTRING(@StrVal,PATINDEX(‘%[^0-9]%’, @StrVal),1),”)
RETURN @StrVal
END
The function can then be used [...]
Filed under: Data, SQL Server | 1 Comment »
Posted on June 10, 2008 by codeslammer
After a few hours of pulling out what few stubs of hair I have remaining, I finally tracked down a rather perplexing problem relating to the Script Wizard feature of SQL Server Management Studio (SSMS).
My goal was to script out all of the stored procedures in a database in a fully re-runnable state, one SP [...]
Filed under: Deployment, SQL Server, Tools | Leave a Comment »