Browse by Tags

Tagged Content List
  • Blog Post: The Windows Azure Software Development Kit (SDK) and the Windows Azure Training Kit (WATK)

    Windows Azure is a platform that allows you to write software, run software, or use software that we've already written. We provide lots of resources to help you do that - many can be found right here in this blog series. There are two primary resources you can use, and it's important to understand what...
  • Blog Post: PowerShell for the DBA: Search the Windows Event Logs for Errors

    This is a very simple script - but it's one I run each morning. It searches the Windows System Event Log for an error condition. You can replace "System" here with "Application" or "Security", or any of the other logs that are created on your Windows Server. This is run at the server, since I have each...
  • Blog Post: PowerShell and Extended Properties

    I use Extended Properties on databases and their objects all the time. They are a great way to include information about the object – I use them for versioning the database, detailing what a column is used for and so on. They can be a little tricky to set, but it’s really not bad once you...
  • Blog Post: Check Script

    Someone contacted me yesterday and said they were getting blocked when they tried to create a FileStream data column type. On investigation, I found they were Mirroring that database – and the two aren’t compatible. Which got me to thinking – it’s probably a good idea to make a “check script” as you...
  • Blog Post: Create and Track Your Own License Keys with PowerShell

    SQL Server used to have  cool little tool that would let you track your licenses. Microsoft didn’t use it to limit your system or anything, it was just a place on the server where you could put that this system used this license key. I miss those days – we don’t track that any more, and I want to...
  • Blog Post: List SQL Server Instances using the Registry

    I read this interesting article on using PowerShell and the registry , and thought I would modify his information a bit to list the SQL Server Instances on a box. The interesting thing about listing instances this was is that you can touch remote machines, find the instances when they are off and so...
  • Blog Post: Backup Meta-Data

    I'm working on a PowerShell script to show me the trending durations of my backup activities. The first thing I need is the data, so I looked at the Standard Reports in SQL Server Management Studio, and found a report that suited my needs, so I pulled out the script that it runs and modified it to this...
  • Blog Post: Open the SQL Server Error Log with PowerShell

    Using the Server Management Objects (SMO) library, you don’t even need to have the SQL Server 2008 PowerShell Provider to read the SQL Server Error Logs – in fact, you can use regular old everyday PowerShell. Keep in mind you will need the SMO libraries – which can be installed separately or by installing...
  • Blog Post: PowerShell – Show a Notification Balloon

    In my presentations for PowerShell I sometimes want to start a process (like a backup) that will take some time. I normally pop up a notification “balloon” at the start, and then do the bulk of the work, and then pop up a balloon at the end to let me know it’s done. You can actually try out this little...
  • Blog Post: PowerShell: Read Excel to Create Inserts

    I’m writing a series of articles on how to migrate “departmental” data into SQL Server . I also hold workshops on the entire process – from discovering that the data exists to the modeling process and then how to design the Extract, Transform and Load (ETL) process. Finally I write about (and teach)...
  • Blog Post: PowerShell Version Two – Get Continuous Perf Counters

    In version 2.0 of PowerShell, you can now use a direct command-let (get-Counter) to get at the Performance Monitor counters. For instance, to show the current value of the Processor Percent Time, use this command:   Get-Counter '\Processor(*)\% Processor Time'     The interesting...
  • Blog Post: Tools and Processes for “Fitting it all in”

    Most data professionals I’ve met work in two modes: we plan for our day, and we react to the situations around us. I’m staring at my list of things that I need to do today right now, which is my planned work. Of course, I have no idea how much of that will really get done – it’s optimistic to be sure...
  • Blog Post: SQL Server 2008 does not always script out all tables

    I teach my college students to periodically script out their databases so that they can run the script to create the entire project on any system. I use this to check their homework, and to teach them about source-code control. We use the scripting wizard in SQL Server Management Studio (SSMS) and select...
  • Blog Post: SQL Server Best Practices: Use Roles When You Can

    SQL Server has two major security vectors: “Principals”, which are primarily users and roles (groups), and “Securables”, which are primarily objects on the server or in the database, like tables or views. Many applications use Logins for their users, and then tie those Instance Logins to Database Users...
  • Blog Post: Code that Writes Code

    I have scripts that re-create my databases for testing and development purposes. But sometimes I want to take the data from a set of tables and move it as well – I could use SSIS, or a SELECT INTO statement, but what if I want to “re-set” the data to a point in time? In other words, load it with some...
  • Blog Post: Changing the Primary Key Before You Have Data

    In my class this week, the students went through the inserts, updates and deletes that they had created for their database design, and then the moment of truth – creating the queries that answer the questions from the requirements. It’s often at this stage when you realize that the design isn’t exactly...
  • Blog Post: Using Perfmon with SQL Server – Part Two

    Yesterday I posted a header from a script that shows you some links for how to use “Logman”, a Windows command-line utility that can automate your collection of Windows Performance Monitor counters. Towards the bottom, you can see the logman command I use, and you can see that it points to a counter...
  • Blog Post: Store XML Document as Binary, Read as XML

    I had an interesting question the other day, so I thought I would share both the question and the answer. We had an older application that had stored an XML document in a table as a binary data type column. I know, I know – we’ve had an XML data type for some time, but not when this app was written....
  • Blog Post: Templates for New Query Window

    When I’m in SQL Server Management Studio and I click the “New Query” button, my Query Window comes up like this: /* <ScriptFileName, SYSNAME, ScriptFileName>.sql Purpose: <Purpose, SYSNAME, Purpose> Author: <Author, SYSNAME, Buck Woody> Last Edited: <LastEdited, SYSNAME, LastEdited>...
  • Blog Post: T-SQL Prettifiers

    OK, I don't think that's even a word, but the synonyms (can a non-word have a synonym?) are code beautifiers, sql formatters, etc. The basic idea is that it's a program that re-formats the text in a Transact-SQL statement using a standard set of rules. They do things like capitalizing keywords or breaking...
  • Blog Post: The Importance of a Test System

    Most of us have three environments in our organizations: Development, Staging, and Production. But I don't count Staging as a test system. Sure, I use it to do an integration test for code before it goes to the users, but that's not the only kind of testing I do. I install management and performance...
  • Blog Post: Commenting your Code

    You should always add descriptive comments to any code that will live longer than a single event. It's useful not only for the other unfortunate souls blessed with your code, but for yourself, years later, when you say "what was I thinking here?" I've recently had to debug some code and it...
  • Blog Post: PowerShell and SQL Server: Script all Tables

    This is a script that I found/put together/re-arranged that will script out all of the tables from a database - in this case, Adventureworks2008. You need to change the BWOODY1 part to the name of your server, and the SQL2K8 part to your Instance name. You can change the database name as well, of course...
  • Blog Post: Use PowerShell to Backup All User Databases

    This script will back up all user databases - you need to change the BWOODY1\SQL2K8 part to your server\instance name, and of course, you should only run this on a test system until you completely understand it. Unfortunately, the SQL Server PowerShell Provider doesn't make this very easy - and there...
  • Blog Post: Read the SQL Server Error Log with PowerShell

    This script uses a native client call, so you can use it on any machine that has PowerShell installed along with the SQL Server client software. As always, only run this script on a test system until you understand what it does, and of course you'll need to change the server name in the connection string...
Page 1 of 3 (63 items) 123