Click here to monitor SSC
Av rating:
Total votes: 72
Total comments: 23


Laerte Junior
I'm a SQL Server DBA, and I'm in Love with PowerShell
28 May 2010

To learn PowerShell, Laerte suggests that  you just start using it. To encourage you to start, he provides a series of tips on using PowerShell with SQL Server to solve various everyday problems. With a little patience, a good IDE, and  a bit of help and advice, "the lion is dead".

I'm the kind of guy who can't resist praising PowerShell, whether it’s applied to SQL Server or  some other administrative task. Unfortunately, PowerShell presents the user with an initial hurdle to jump: the initial learning effort that's required. Thankfully, there is a very easy way to overcome that hurdle, as pointed out to me by Shay Levy ( Twitter| blog) when I asked him for advice on the best way to learn PowerShell:

"Just use it"

And although it sounds facetious, it’s the honest truth; you will only begin to understand PowerShell if you start using it. More than that, you have to spend hours reading, testing the code, looking to improve it and not be ashamed to ask for pointers. This might sound like a real trial, but it’s actually deeply satisfying, and I’ve found the community which has sprung up to be warm and welcoming.

My little knowledge of PowerShell is applied purely to SQL Server, and for this purpose it is not difficult to learn. However, that doesn’t change the fact that I'm always looking for ways to improve the code I’ve written, and I‘ve seen some examples that truly make my brain hurt! Yet with a little patience, a good IDE and, of course, good contacts with the community, no challenge is too great (or as we say in Brazil, "the lion is dead").

To show just how easy PowerShell can be if you have a bit of determination, I got some of my unpublished blog posts together and decided to use them as demonstrations in this article. We'll see some solutions using just PowerShell, PowerShell with SQL Server and also SQLPSX. I hope you find it useful!

SSIS and the T-SQL Hammer

I firmly believe that you have to read Chad Miller’s Blog Post entitled “The T-SQL Hammer”. It is a fantastic example of productivity in PowerShell, and I took the liberty of using the same title here because, after reading his words...

“The over-reliance on a familiar tool is best described with the quote, 'if all you have is hammer, everything looks like nail', and for database professionals this means using or sometimes misusing T-SQL. Whenever database administrators are presented with a scripting problem they instinctively reach for good-old-familiar T-SQL.  And why not? In many cases T-SQL provides an ideal solution to SQL Server administration scripting problems, however there are certain scenarios where another tool, PowerShell, provides a  more elegant solution.”

...I believe we can demonstrate another great argument in favor of using PowerShell. As you may have guessed, PowerShell might be my own ‘hammer’, but nevertheless, I feel that it offers remarkably elegant solutions to many of the challenges I face, and can do the same for you.

I’d like to draw your attention to a great article by Rodney Landrum, showing a very interesting solution for consolidating SQL Server Error Logs. He shows how to use SSIS and some T-SQL to neatly handle this operation, and I decided to tinker with his solution. Before I carry on, you should either go and read it, or just accept what I’m saying on faith! Rodney’s solution is excellent, make no mistake; the only thing I feel I’m adding to it is ease-of-use and perhaps a little more elegance with respect to my own environment (prompted, perhaps, by Chad’s blog post). You’ll have to be the judge when it comes to which works better for you.

To start with, one of the things I’ve changed in my version is that I don’t use the MERGE statement, for a reason that become clear in a moment. I have one Server and Database repository, one table repository to save the logs to, and I created another control table called ServersInfo  with only two columns, Server Name (ServerName) and  last collection Date (DateLastLogErrorImported)

In his example, Rodney uses the Merge statement and SSIS to record the data that is brought across in the log for each server. In my case, rather than using an SSIS package to control which logs I store, I record the date of the most recent logs in this ServersInfo table, and only insert data collected after this date. This last table is handy; it means that, when I access the error log, I can always filter my information by date.

But let’s see the code:

First, we need some T-SQL to create the repository table and Server/date control table. Obviously, you will create these tables on your server and database repository.

Create Table SQLLogInfo (     ServerName varchar(50),

                              LogDate datetime,

                              ProcessInfo varchar(100),

                              Text varchar(max)

                                     )

                                     

Create Table ServersInfo (    ServerName varchar(100),

                              DateLastLogErrorImported datetime

                          )

Now let's populate the Servers table (Serversinfo) with the names of all the servers from which you want to have the error logs collected.

insert into ServersInfo(ServerName) values ('Colombo-pc\SQLExpress')

insert into ServersInfo(ServerName) values ('Colombo-pc')

After that’s sorted, let’s look at the PowerShell code (remember, I am using SQLPSX)

#Define Server and Database Repository

$ServerRepository = $env:COMPUTERNAME

$DatabaseRepository = "tempdb"

 

#Return the servers and the last collection date from error logs

get-SqlData -sqlserver $ServerRepository -dbname $DatabaseRepository -qry "Select ServerName,DateLastLogErrorImported from ServersInfo" | foreach {

      

       $ServerName = $_.Servername

       $DateLastLogErrorImported = $_.DateLastLogErrorImported

      

       get-sqlserver $ServerName | foreach {   

             

              #If this is the first collection, takes the date 2010/01/01

              if ($DateLastLogErrorImported.value -eq $null -or $DateLastLogErrorImported.value -eq "")

                     { $DateLastLogErrorImported = '2010/01/01' }

                          

#Retrieve the error log from the current server in foreach. Apply a   #filter to only LogDate above and equal to Last Collection date

              #and insert into Repository

              $Error.Clear()

              Get-SqlErrorLog -sqlserver $ServerName -lognumber 0 | where-object { $_.LogDate -ge $DateLastLogErrorImported} | foreach {

                          

                           $Text = $($_.text) -replace "'"

                           Set-SqlData -sqlserver $ServerRepository -dbname $DatabaseRepository -qry "Insert into SQLLogInfo (Servername,LogDate,ProcessInfo,text) values ('$($ServerName)','$($_.Logdate)','$($_.ProcessInfo)','$Text)')"

              }

                    

                     #Update Information Table with the server and the last collection date.

              Set-SqlData -sqlserver $ServerRepository -dbname $DatabaseRepository -qry "Update ServersInfo set DateLastLogErrorImported = getdate() where Servername = '$($Servername)'"

      

       }

}

I'm not handling errors at this stage, but that would be very simple to implement. With just a Try-Catch before the SQLPSX functions, we cover all error possibilities, logging them into a file for later inspection. To make your life even easier, you can find this code in my Simple-Talk articles.

With that , the data is neatly collected and saved into a SQL Server table. We can schedule this script to run once a day and, as I said earlier, we only insert data from the date of the last collection, so avoiding having to work with huge volumes of data. Naturally, with this collection system in place, you can apply summations, aggregates, filters and whatever else is necessary to set up your monitoring. To quote Chad, PowerShell provides a more elegant solution.

Searching and Logging with PowerShell

Not too long ago, I had the pleasure of helping a friend (and great Microsoft community  influencer) Jorge Segarra (Twitter| blog), in another PowerShell challenge. Jorge  needed the following:

A folder with several txt files (i.e. flat files) should be filtered for files that had the most recent change date (LastWriteTime) in a determined period, searched for whether they contain a particular string, and the result this search should be stored in a newly-created file. The results in this file should show the path and file name, as well as the line number corresponding to the string search result, and text of this line.

It sounds fairly complicated, but it really is quite simple in PowerShell. I’ve created two txt files to illustrate:

File1.txt contains this content:

111111111111111111111111111

222222222222222222222222222

33333Error33333333333333333

444444444444444444444444444

Error5555555555555555555555

666666666666666666666666666

777777777777777777777777777

8888888888888888888888Error

And File2.txt contains:

111111111111111111111111111

222222222222222222222222222

33333Error33333333333333333

444444444444444444444444444

Error5555555555555555555555

666666666666666666666666666

777777777777777777777777777

8888888888888888888888Error

999999999999999999999999999

100000000000000000000000000

AAAAAAAAAAAAAAAAAAAAErrorAA

BBBBBBBBBBBBErrorBBBBBBBBBB

CCCCCCCCErrorCCCCCCCCCCCCCC

You can see that in red & bold is the word “Error”, which is the string that I want to look for.

Let's go to the code:

Function Invoke-AdmErrors

 

{

       <#

       .SYNOPSIS

       Search for errors in files

       .DESCRIPTION

       Search for errors in files

       .INPUTS

       Pipe Path to files

       .OUTPUTS

       Flat file with files found

      

       #>

      

       param (

                     [Parameter(Position=0, Mandatory = $true, ValueFromPipeline = $true)] [String] $Path,

                    

                     [Parameter(position=1,Mandatory = $true )]

                     [system.DateTime]    $InitialDate ,

                    

                     [Parameter(position=2,Mandatory = $true )]

                     [system.DateTime]    $FinalDate ,

                    

                     [Parameter(position=3,Mandatory = $false )]

                     [string]      $ResultFile = "c:\users\jsegarra\desktop\example.txt"

                    

                )

                     Process

                     {

                           Get-ChildItem $path | Where-Object {$_.lastwritetime -ge $InitialDate -and $_.lastwritetime -le $FinalDate } |  foreach {

                                  Select-String -Pattern "Error" -Path $_ -AllMatches | Add-Content -Path $ResultFile -Force

                           }

                     }

}

If you look closely at the PowerShell above, you'll see that the process of finding and filtering results, and the saving of the final file is all done in one line. The rest are input parameters, help and function configuration.

Let’s say I want to search for the string “Error” in all files under the path C:\temp, with a filter focusing on files changed between the dates 01/01/2010 and 01/05/2010 (dd/mm/yyyy), and the save the results into the file C:\temp\result.txt.

Invoke-AdmErrors -Path c:\temp -Initialdate '01/01/2010' -FinalDate '01/05/2010' -SearchFor "Error" -ResultFile c:\temp\result.txt

...And the file result will look like this, showing the file name (with path), line number of the result, and string searched:

Figure 1. Search and Filter results

A Simpler Way to Get Values from SQL Server

This is a very quick demonstration of something which surprises me. In many code snippets and articles on the web, I see this method (or something similar) of returning values from a query (either a simple query, stored procedure etc. ..) from SQL Server to PowerShell:

$cn = new-object System.Data.SqlClient.SqlConnection("Data Source=myserver;Integrated Security=SSPI;Initial Catalog=Master")

$cn.open() 

$sql = "Select name,number from master..spt_values"

$cmd = new-object "System.Data.SqlClient.SqlCommand" ($sql, $cn)

$rt = $cmd.ExecuteReader()

while ($dr.Read()) {

      $rt.GetValue(0)

      $rt.GetValue(1)

}

It’s correct, for sure, but why not simplify the code? We could rewrite it to just:

Invoke-Sqlcmd -ServerInstance MyServer -Database Master -Query "Select name,number from master..spt_values" | Select-Object name,number

We can even put a condition on the return; let’s say we only want to display rows where the value of the column number is 2...

Invoke-Sqlcmd -ServerInstance MyServer -Database Master -Query "Select name,number from master..spt_values" | where-object { $_.number -eq 2} | Select-Object name,number

...Or even run a stored procedure.

Invoke-Sqlcmd -ServerInstance MyServer -Database MyDatabase -Query "exec usp_myproc" | Select-Object column1, column2

PowerShell provides many ways to do this, and you can choose the best method for yourself.

Scripting SQL Server Objects with SQLPSX

I’ve recently started using the SQLPSX library, and I am constantly finding gems buried inside it. One of my personal favorites, and one which I use a lot, is a very easy method for generating scripts of objects . For example, if we want to generate a script from a table, use:

Get-SqlDatabase -sqlserver YourServer -dbname YourDatabase | Get-SqlTable -name YourTableGet-SqlScripter

And to output to a text file:

Get-SqlDatabase -sqlserver YourServer -dbname YourDatabase | Get-SqlTable -name YourTableGet-SqlScripter |Out-File c:\temp\Script.txt

What if I want all the tables in my database, and not just a specific one? Simple; just delete the –name parameter in Get-SQLtable:

Get-SqlDatabase -sqlserver YourServer -dbname YourDatabase | Get-SqlTable  |  Get-SqlScripter |Out-File c:\temp\Script.txt

The same (i.e. how to generalize your scripts) can be applied to all other objects, such as stored procedures:

Get-SqlDatabase -sqlserver YourServer -dbname YourDatabase | Get-SqlStoredProcedure  | Get-SqlScripter

To see a complete list of the functions of SQLPSX, and read more about how to use them, go to SQL Server PowerShell Extensions Help.

How PowerShell Custom Tables Saved the day

This article’s final showcase of PowerShell Proclivity came about because a friend contacted me on MSN, and said:

"Laerte, I saw the hint you gave via twitter to Jorge Segarra, and want to see if you can help me. I need to output a result of a proc to an XML document every day (as is described in the Jorge´s blog post), but the result comes from a third-party procedure, and I need to insert a description of a flag. The problem is that the Stored Procedure only returns the code, and I cannot change the procedure (because it’s third–party). Can you help me?"

Well, enumerating the problems before us:

  1. We need to add one more column to the Stored procedure output,
  2. This column is a description of another column: a flag,
  3. We cannot change the Stored Procedure to add this column,

If I told you that we could solve this whole problem with only one line of PowerShell, you believe me? No? Well... Let's see.

First, let's create the scenario. I created a table and a stored procedure with the code below, and also included some names in the table. This table has a column called InsanityState and the content is a code and describe as:

Column InsanityState Char(1)  - can be  I – Insane, O - Out of Control, W - Without Hope, D - He has been a DBA

The T-SQL Code:

--Create The Table

Create table  Arkham_Asylum  (      Id int ,-- Patient ID,

                                    name varchar(100), -- Patient Name,

                                    InsanityState char(1) –-

State of madness - can be  I – Insane, O - Out of Control, W - Without Hope, D - He has been a DBA

                              )

go

-- Insert some Insanity

insert into Arkham_Asylum values (1,'Poison Ivy','I')

insert into Arkham_Asylum values (2,'Scarecrow','O')

insert into Arkham_Asylum values (3,'Two Face','W')

insert into Arkham_Asylum values (4,'Joker','I')

insert into Arkham_Asylum values (3,'Laerte Junior','D')

 

--Create Stored Procedure

go

                               

alter procedure usp_getInfoInsanes

 

as

 

select      Id,

            name,

            InsanityState

from  Arkham_Asylum

 

go

If we execute the proc, you will see the Flag that it needs to display as a description:

Figure 2. The results of the Stored Procedure.

As I said, we cannot change the Stored Procedure to return the description of InsanityState, so we need to use PowerShell Custom Tables. First, let’s see just the code to return all these crazy people with their Insanity State descriptions, but not the code to output to XML.

To repair this situation, I use a custom table, calling a function to convert the ID of the InsanityState flag, and display the description.

function get-InfoInsanes

{

               

       Begin

       {

      

              function ConvertTo-FlagCaption($Value)

              {

                     switch($value)

                     {

                           "I"   {"Insane";break}

                           "O"   {"Out of Control";break}

                           "W"   {"Without Hope";break}

                           "D"   {"He has been a DBA";break}

 

 

                     default {"Unknown";BREAK}

                     }

              }

 

       }

               

       Process

       {

      

              invoke-sqlcmd -server $env:computername -database teste -Query "exec usp_getInfoInsanes" |

                     Select-Object        Id,

                                  Name,

                                  @{Expression={ConvertTo-FlagCaption -value $_.insanityState};Label = "Insanity State"}

             

       }

}

...And look at the output:

Figure 3. InsanityStates, clarified.

Now, for the output to an XML file, just use the ConvertTo-XML cmdlet and the save property:

(invoke-sqlcmd -server $env:computername -database teste -Query "exec sp_getInfoInsanes"Select-Object        Id,

                     Name,

                     @{Expression={ConvertTo-FlagCaption -value $_.insanityState};Label = "Insanity State"} | ConvertTo-Xml -NoTypeInformation).save("c:\temp\ResultXml.Xml")

...And the XML will look like:

Figure 4 – The Insane XML Output

Now you just need to schedule this to run, and be happy!

Summary

Well my friends, I have described a few of the uses that I’ve put PowerShell to whilst working as a DBA. I realize I’ve presented a mixed bag here, but that reflects the wide spectrum of problems that a working DBA comes across that PowerShell can help to solve. I chose them because they can be used in a lot of different ways by people who are taking the first steps with the language. I hope that you, like me, look at the productivity gain that can be found in working with this fantastic  tool.

A big hug to everyone, and here are some links for further reading:



This article has been viewed 18528 times.
Laerte Junior

Author profile: Laerte Junior

Laerte Junior is a SQL Server MVP and, through his technology blog and simple-talk articles, an active member of the Microsoft community in Brasil. He is a skilled Principal Database Architect, Developer, and Administrator, specializing in SQL Server and Powershell Programming with over 8 years of hands-on experience. He holds a degree in Computer Science, has been awarded a number of certifications (including MCDBA), and is an expert in SQL Server 2000 / SQL Server 2005 / SQL Server 2008 technologies. He also organizes, and is a speaker at microsoft community events, attracting hundreds of attendees. Laerte has also recently become a Friend of Redgate in Brasil, has taught classes at universities, and produced webcasts for the community.

You should follow him on Twitter as @LaerteSQLDBA

Search for other articles by Laerte Junior

Rate this article:   Avg rating: from a total of 72 votes.


Poor

OK

Good

Great

Must read
 
Have Your Say
Do you have an opinion on this article? Then add your comment below:
You must be logged in to post to this forum

Click here to log in.


Subject: Great!!
Posted by: Felipe (view profile)
Posted on: Tuesday, June 08, 2010 at 2:09 PM
Message: I followed some of these scripts into your blog, and really are fantastic.
Congratulations!!!

Subject: Slimply the best
Posted by: Antony Nelson (not signed in)
Posted on: Tuesday, June 08, 2010 at 2:34 PM
Message: Fodastic!!!

Simply the best!!!

Subject: Keep Walking
Posted by: Barbosa (view profile)
Posted on: Tuesday, June 08, 2010 at 2:35 PM
Message: Keep Walking...

Subject: Very good
Posted by: 1000ton (not signed in)
Posted on: Tuesday, June 08, 2010 at 2:45 PM
Message: Congratulations my friend very good :)

Subject: Great post!
Posted by: Caio Proiete (not signed in)
Posted on: Tuesday, June 08, 2010 at 4:41 PM
Message: Thank you for sharing!

Subject: Good job
Posted by: Math (not signed in)
Posted on: Tuesday, June 08, 2010 at 6:27 PM
Message: LOL I think the worst insanity is the "He Has Been a DBA." Great post, informative and funny. Keep up the good work Laerte, I'm sure many people now use PowerShell for your articles. I am one of them.

Subject: Great!!
Posted by: FabricioLimaDBA (view profile)
Posted on: Tuesday, June 08, 2010 at 8:35 PM
Message: Great article...I realy need learning Powershell....

Subject: Very Nice!
Posted by: Nilton Pinheiro (not signed in)
Posted on: Thursday, June 10, 2010 at 7:22 AM
Message: Congrats Laerte...I totally agree with Math.

Good job!

Subject: Excellent
Posted by: Demétrio Silva (not signed in)
Posted on: Thursday, June 10, 2010 at 8:17 PM
Message: Very good as usual is not it?

Hugs my friend

Subject: What do you think of Document style databases?
Posted by: Paul Wand (view profile)
Posted on: Monday, June 14, 2010 at 1:11 AM
Message: What do you think of Databases like Couchdb and mongodb?

Subject: Great Article
Posted by: Ignacio Salom (not signed in)
Posted on: Monday, June 14, 2010 at 3:26 AM
Message: Thank you for sharing the information.

Subject: Re
Posted by: laerte (view profile)
Posted on: Monday, June 14, 2010 at 5:19 AM
Message: Hi Paul, If I like ? As one good friend said , as DBA its difficult for me accept something like "get even better scalability by loosening some of the durability guarantees" or "with Partly data integrity". But this is a personal opinion.
I believe for every application there is the correct architecture. The NoSQL, from what I read so far, has its functionality in certain environments.

Subject: Limiting results
Posted by: PSNewb (not signed in)
Posted on: Monday, June 14, 2010 at 8:55 AM
Message: Laerte-
Lont time lurker,1st time PowerShell user...
After running the code:
Get-SqlDatabase -sqlserver YourServer -dbname YourDatabase | Get-SqlTable -name YourTable | Get-SqlScripter
For a table: STOPS in my DB I get back results for tables with STOPS anywhere in the name, is there anyway to limit the results to more of an '=' than a 'like'

Subject: Limiting Results
Posted by: laerte (view profile)
Posted on: Monday, June 14, 2010 at 9:56 AM
Message: Hi PSNewb. Thanks for the comment :)

You are correct. By design, the Get-SQLTables use like or contains. You can try :
Get-SqlDatabase -sqlserver YourServer -dbname YourDatabase | Get-SqlTable | where-object { $_.name -eq "YourTableName" | Get-SqlScripter

Keep in mind that you use any of Powershell cmdlet that is applicable to the object returned by the function as a sort-object, out-file, where-object ..
And if you want and have any other questions, feel free to ping me at laertejuniordba@hotmail.com.
It will be a pleasure for me to help :)

Subject: Just use it. Yes!
Posted by: Ron Dameron (view profile)
Posted on: Monday, June 14, 2010 at 10:23 AM
Message: Laerte,

Great suggestion! Just use it.

I did.

Boogle PowerShell and the task you hope to complete for further info.

Lee Holmes's PowerShell Cookbooks are a good place to start.

Regards,

http://twitter.com/@RonDBA
http://RonaldDameron.blogspot.com

Subject: Re
Posted by: laerte (view profile)
Posted on: Monday, June 14, 2010 at 10:38 AM
Message: Hi Ron,
Thanks for the comments.
Good Point. Lee Holmes is always a good reading :)
Actually I start with "Just use it", after reading your excellent S-T article and required reading for anyone who wants to take the first step in powershell --> http://www.simple-talk.com/sql/database-administration/why-this-sql-server-dba-is-learning-powershell/

Thanks :)

Subject: Powershell scripts for secure offsite backups
Posted by: gbrayut (view profile)
Posted on: Monday, June 14, 2010 at 1:21 PM
Message: I have always found Powershell to be an invaluable tool in my IT skill set. When our hosting provider wanted $600 a month for offsite backups I decided to create an script to use 7zip for compression/encryption and then Amazon S3 for offsite storage. Runs every hour as an SQL Agent Job to create daily full backups and hourly differentials... all for $5 a month! Check it out if you want:

http://codeblog.theg2.net/2010/06/powershell-backup-all-databases-locally.html

Subject: Re - Powershell scripts for secure offsite backups
Posted by: laerte (view profile)
Posted on: Monday, June 14, 2010 at 1:39 PM
Message: Hi gbrayut,

Very nice Script my friend :) Congrats !! Bookmarked

Subject: nice
Posted by: blakmk (not signed in)
Posted on: Wednesday, June 16, 2010 at 4:10 AM
Message: Another nice script by you. I can see im easily going to be seduced by the ways of powershell

Subject: Re
Posted by: laerte (view profile)
Posted on: Wednesday, June 16, 2010 at 7:44 AM
Message: Hi blakmk,

Thanks my friend . Just to remind you. Prepare, PowerShell is addictive (I was completely seduced).
And if you need something please feel free to ping me :)

Subject: Fantastic Article
Posted by: timothyawiseman@gmail.com (view profile)
Posted on: Thursday, June 17, 2010 at 4:58 PM
Message: Laerte, as usual you have another fantastic PowerShell article.

You mentioned IDEs, do you have any specific recommendations? Right now when I play with PowerShell I am using a fairly standard text editor.

Subject: Re
Posted by: laerte (view profile)
Posted on: Thursday, June 17, 2010 at 6:01 PM
Message: Thanks my friend. Glad you liked it :)
Sure , you can take a look in Powershell ISE. The IDE is installed along with Powershell 2.0. With Powershell ISE you can use SQLIse , A Powershell Based SQL Server Query Tool. A very nice project created by Chad Miller and is part of SQLPSX. With it, besides running your Powershell scripts from within the Powershell ISE you can run TSQL commands in SQL Server.
But you can find another good IDEs in the web.
And if you need something, You already know, ping me... email, msn, skype, drums, smoke signal. We find a way to share information :)

Subject: I feel left out
Posted by: shellhead (view profile)
Posted on: Friday, January 13, 2012 at 8:32 PM
Message: Laerte,

As a dba for about 4 years now and without any scripting experience I just don't get it. Why is POSH better than creating jobs in SQL Server or scripting out login accounts to reuse, for example?

I purchased a WROX book on sql 2008 POSH for admin but I don't see the benefit.

I would really appreciate some kind words to convince me I should become POSH savvy. Thank you very much!

Jim Traub

 










Phil Factor
Automated Script-generation with Powershell and SMO
 In the first of a series of articles on automating the process of building, modifying and copying SQL Server... Read more...



 View the blog
Using SQL Test Database Unit Testing with TeamCity Continuous Integration
 With database applications, the process of test and integration can be frustratingly slow because so... Read more...

SQL Source Control: The Development Story
 Often, there is a huge difference between software being easy to use, and easy to develop. When your... Read more...

How to Import Data from HTML pages
 It turns out that there are plenty of ways to get data into SQL Server from websites, whether the data... Read more...

SQL Scripts Manager: An Appreciation
 SQL Scripts Manager is Simple-Talk's present to its readers. William Brewer was an enthusiastic... Read more...

Hosted Team Foundation Server 2010 Review
 Team Foundation Server (TFS) has expanded its remit to support the whole software development process,... Read more...

Beginning SQL Server 2005 Reporting Services Part 1
 Steve Joubert begins an in-depth tour of SQL Server 2005 Reporting Services with a step-by-step guide... Read more...

Ten Common Database Design Mistakes
 Database design and implementation is the cornerstone of any data centric project (read 99.9% of... Read more...

Reading and Writing Files in SQL Server using T-SQL
 SQL Server provides several "standard" techniques by which to read and write to files but, just... Read more...

Beginning SQL Server 2005 Reporting Services Part 2
 Continuing his in-depth tour of SQL Server 2005 Reporting Services, Steve Joubert demonstrates the most... Read more...

Creating CSV Files Using BCP and Stored Procedures
 Nigel Rivett demonstrates some core techniques for extracting SQL Server data into CSV files, focussing... Read more...

Over 400,000 Microsoft professionals subscribe to the Simple-Talk technical journal. Join today, it's fast, simple, free and secure.

Join Simple Talk