in

SQL Server Blogs

Voices from the UK SQL Server Community

Browse by Tags

  • Changing database collations with Powershell

    Changing a database collations is rarely as simple as it may seen. You may have found articles which show you the ALTER DATABASE statement such as Example B , unfortunately that example only works because you have just created the testDB and nobody has connected to it! Anyone who has tried to do this...
    Posted to Martin Bell UK SQL Server MVP (Weblog) by MartinBell on Mon, Mar 7 2011
  • Signing Powershell scripts

    I wanted to write a post on signing Powershell scripts, but doing a few internet searches found this article . Which is great if you have a certificate store, and this is the recommended method, but using a certificate store is not always an available option. There are several alternate methods to create...
    Posted to Martin Bell UK SQL Server MVP (Weblog) by MartinBell on Wed, Feb 16 2011
  • Quirky Invoke-Sqlcmd?

    One thing I was going to mention in my last post on Invoke-Sqlcmd was the fact that you need to return unique column names. This is not mentioned in Books online and I’ve not seen it anywhere else. For example, if you run the following Powershell script: # load snap-in if not in SQLPS Add-PSSnapin SqlServerCmdletSnapin100...
    Posted to Martin Bell UK SQL Server MVP (Weblog) by MartinBell on Tue, Jan 25 2011
  • Cursors in Powershell

    Invoke-cmd is a cmdlet available in the SQL Server Powershell snap-ins. I talked about these snapins in my blog post Using SQL Server in Powershell outside of SQLPS Whilst I have seem many examples of invoking invoke-sqlcmd to do DML I can’t remember seeing anything on how to use the results of a query...
    Posted to Martin Bell UK SQL Server MVP (Weblog) by MartinBell on Mon, Jan 24 2011
  • Powershell debugging II

    In my previous Powershell blog post I talked about debugging Powershell scripts using Set-PSDebug and Set-PSBreakpoint, which is great if you can use them, but there are certain circumstances where you may not be able to do that. This is where writing to a log file may be useful. Powershell has several...
    Posted to Martin Bell UK SQL Server MVP (Weblog) by MartinBell on Sat, Jan 22 2011
  • Powershell debugging

    I have to admit that I am still quite stick in my Powershell 1.0 ways when it comes to writing scripts. That is I write the script in textpad and paste it into the command prompt window. Many times I have pasted a script and wondered why I still have a continuation prompt then realise I have missed out...
    Posted to Martin Bell UK SQL Server MVP (Weblog) by MartinBell on Tue, Jan 18 2011
  • Powershell Error Handling

    I remember giving a talk at Developer Day Scotland on T-SQL and one of the feedback was something like “A well presented talk on what is usually a very boring subject”. Although error is a mandatory part of programming, and some people may find testing all the possible use cases tedious, I would not...
    Posted to Martin Bell UK SQL Server MVP (Weblog) by MartinBell on Sun, Jan 16 2011
  • Free Powershell resources

    I found this great free Powershell resource at http://blog.sapien.com/index.php/2009/12/01/free-windows-powershell-ebook/ by Powershell MVPs Don Jones and Jeff Hicks . It may be Powershell V1.0 but it’s an excellent general reference to have at hand. Another resource is Dr. Tobias Weltner's "Mastering...
    Posted to Martin Bell UK SQL Server MVP (Weblog) by MartinBell on Wed, Jan 12 2011
  • Using Powershell to not script database collations for columns

    If you use the SMO scripting object to script a table as I did in my previous article on Powershell for the following script which scripts out the Person.Contact table in the Adventureworks database: cd SQLSERVER:\SQL\localhost\DEFAULT\Databases\AdventureWorks\Tables $Scripter=new-object ("Microsoft...
    Posted to Martin Bell UK SQL Server MVP (Weblog) by MartinBell on Fri, Nov 19 2010
  • Converting Deadlock Reports to Graphs

    I’d only just posted my blog about persisting deadlock reports from extended events when I had the following email conversation with David Betteridge David: It sounds like you hit the same issues as me, the deadlock xml is invalid until you apply CU1 to 2008 R2. Only then you discover that xml format...
    Posted to Martin Bell UK SQL Server MVP (Weblog) by MartinBell on Sat, Nov 6 2010
Page 2 of 4 (32 items) < Previous 1 2 3 4 Next >
Powered by Community Server (Commercial Edition), by Telligent Systems