<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://sqlblog.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Search results matching tags 'SQL Server' and 'Tips'</title><link>http://sqlblog.com/search/SearchResults.aspx?o=DateDescending&amp;tag=SQL+Server,Tips&amp;orTags=0</link><description>Search results matching tags 'SQL Server' and 'Tips'</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>Back up a single table in SQL Server</title><link>http://sqlblog.com/blogs/buck_woody/archive/2010/06/03/back-up-a-single-table-in-sql-server.aspx</link><pubDate>Thu, 03 Jun 2010 12:51:34 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:25902</guid><dc:creator>BuckWoody</dc:creator><description>&lt;p&gt;SQL Server doesn’t have an easy way to take a table backup, so I often use the bcp (Bulk Copy Program) to accomplish the same goal. I’ve mentioned this before, and someone told me when they tried it they couldn’t restore the table – ah the dangers of telling people half the information! I should have mentioned that you need to have a “format file” ready if the table does not exist at the destination. In my case I already had the table, in this person’s case they did not. The format file can be used to rebuild that table structure before the data is bcp’d in, and you can read more about it here: &lt;a href="http://msdn.microsoft.com/en-us/library/ms191516.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms191516.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;There’s another way to back up a table, and that’s to create a Filegroup and place the table there. Then you can take a Filegroup backup to back up a single table.&lt;/p&gt;  &lt;p&gt;Of course, there are other methods of moving a single table’s data in an out, including SQL Server Integration Services and even the older Data Transformation Services, or simply by using hte SQLCMD or PowerShell utilities to run a query and just save the output to a file. In fact, these days I’m using a PowerShell script to build INSERT statements from that query. That could also easily be modified to create the table structure (or modify one if needed) quite easily.&lt;/p&gt;</description></item><item><title>Backup those keys, citizen</title><link>http://sqlblog.com/blogs/buck_woody/archive/2010/04/20/backup-those-keys-citizen.aspx</link><pubDate>Tue, 20 Apr 2010 12:14:50 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:24408</guid><dc:creator>BuckWoody</dc:creator><description>&lt;p&gt;Periodically I back up the keys within my servers and databases, and when I do, I blog a reminder here. This should be part of your standard backup rotation – the keys should be backed up often enough to have at hand and again when they change.&lt;/p&gt;  &lt;p&gt;The first key you need to back up is the Service Master Key, which each Instance already has built-in. You do that with the &lt;a href="http://msdn.microsoft.com/en-us/library/ms190337.aspx" target="_blank"&gt;BACKUP SERVICE MASTER KEY command, which you can read more about here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;The second set of keys are the Database Master Keys, stored per database, if you’ve created one. You can back those up with the &lt;a href="http://technet.microsoft.com/en-us/library/ms174387.aspx" target="_blank"&gt;BACKUP MASTER KEY command, which you can read more about here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Finally, you can use the keys to create certificates and other keys – those should also be backed up. &lt;a href="http://msdn.microsoft.com/en-us/library/ms189586.aspx" target="_blank"&gt;Read more about those here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Anyway, the important part here is the backup. Make sure you keep those keys safe!&lt;/p&gt;</description></item><item><title>PowerShell PowerPack Download</title><link>http://sqlblog.com/blogs/buck_woody/archive/2010/04/07/powershell-powerpack-download.aspx</link><pubDate>Wed, 07 Apr 2010 13:30:20 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:24123</guid><dc:creator>BuckWoody</dc:creator><description>&lt;p&gt;I read &lt;a href="http://redmondmag.com/articles/2010/04/01/pack-some-power-in-your-shell.aspx" target="_blank"&gt;Jeffery Hicks’ article in this month’s Redmond Magazine&lt;/a&gt; on a new add-in for Windows PowerShell 2.0. It’s called the PowerShell Pack and it has a some great new features that I plan to put into place on my production systems as soon as I finished learning and testing them.&lt;/p&gt;  &lt;p&gt;You can &lt;a href="http://code.msdn.microsoft.com/PowerShellPack" target="_blank"&gt;download the pack here if you have PowerShell 2.0&lt;/a&gt;. I’m having a lot of fun with it, and I’ll blog about what I’m learning here in the near future, but you should check it out. The only issue I have with it right now is that you have to load a module and then use get-help to find out what it does, because I haven’t found a lot of other documentation so far.&lt;/p&gt;  &lt;p&gt;The most interesting modules for me are the ones that can run a command elevated (in &lt;strong&gt;PSUserTools&lt;/strong&gt;), the task scheduling commands (in &lt;strong&gt;TaskScheduler&lt;/strong&gt;) and the file system checks and tools (in &lt;strong&gt;FileSystem&lt;/strong&gt;). There’s also a way to create simple Graphical User Interface panels (in ). I plan to string all these together to install a management set of tools on my SQL Server Express Instances, giving the user “task buttons” to backup or restore a database, add or delete users and so on. Yes, I’ll be careful, and yes, I’ll make sure the user is allowed to do that.&lt;/p&gt;  &lt;p&gt;For now, I’m testing the download, but I thought I would share what I’m up to. If you have PowerShell 2.0 and you download the pack, let me know how you use it.&lt;/p&gt;  &lt;p style="margin:0in 0in 0pt;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;b&gt;&lt;i style="mso-bidi-font-style:normal;"&gt;&lt;span style="color:maroon;font-size:10pt;mso-bidi-font-size:11.0pt;mso-bidi-font-family:calibri;mso-ansi-language:en;"&gt;Script Disclaimer, for people who need to be told this sort of thing: &lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;b&gt;&lt;i style="mso-bidi-font-style:normal;"&gt;&lt;span style="color:maroon;font-size:10pt;mso-bidi-font-family:calibri;mso-ansi-language:en;"&gt;           &lt;p&gt;&lt;/p&gt;         &lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="margin:0in 0in 0pt;" class="MsoNormal"&gt;&lt;i style="mso-bidi-font-style:normal;"&gt;&lt;span style="color:maroon;font-size:10pt;mso-bidi-font-family:calibri;mso-ansi-language:en;"&gt;&lt;font face="Calibri"&gt;Never trust any script, including those that you find here, until you understand exactly what it does and how it will act on your systems. Always check the script on a test system or Virtual Machine, not a production system. Yes, there are always multiple ways to do things, and this script may not work in every situation, for everything. It’s just a script, people. All scripts on this site are performed by a professional stunt driver on a closed course. Your mileage may vary. Void where prohibited. Offer good for a limited time only. Keep out of reach of small children. Do not operate heavy machinery while using this script. If you experience blurry vision, indigestion or diarrhea during the operation of this script, see a physician immediately.&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;</description></item><item><title>Process Improvement and the Data Professional</title><link>http://sqlblog.com/blogs/buck_woody/archive/2010/04/06/process-improvement-and-the-data-professional.aspx</link><pubDate>Tue, 06 Apr 2010 13:23:48 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:24098</guid><dc:creator>BuckWoody</dc:creator><description>&lt;p&gt;Don’t be afraid of that title – I’m not talking about &lt;a href="http://en.wikipedia.org/wiki/Six_Sigma" target="_blank"&gt;Six Sigma&lt;/a&gt; or anything super-formal here. In many organizations, there are more folks in other IT roles than in the Data Professional area. In other words, there are more developers, system administrators and so on than there are the “DBA” role. &lt;/p&gt;  &lt;p&gt;That means we often have more to do than the time we need to do it. And, oddly enough, the first thing that is sacrificed is process improvement – the little things we need to do to make the day go faster in the first place. Then we get even more behind, the work piles up and…well, you know all about that.&lt;/p&gt;  &lt;p&gt;Earlier I challenged you to find 10-30 minutes a day to study. Some folks wrote back and asked “where do I start”? Well, why not be super-efficient and combine that time with learning how to make yourself more efficient? Try out a new scripting language, learn a new tool that automates things or find out ways others have automated their systems. In general, find out what you’re doing and how, and then see if that can be improved. It’s kind of like doing a performance tuning gig on yourself!&lt;/p&gt;  &lt;p&gt;If you’re pressed for time, look for bite-sized articles (&lt;a href="http://www.informit.com/guides/content.aspx?g=sqlserver&amp;amp;seqNum=253" target="_blank"&gt;like the ones I’ve done here for PowerShell and SQL Server&lt;/a&gt;) that you can follow in a “serial” fashion. In a short time you’ll have a new set of knowledge you can use to make your day faster.&lt;/p&gt;</description></item><item><title>Cluster Nodes as RAID Drives</title><link>http://sqlblog.com/blogs/buck_woody/archive/2010/03/25/cluster-nodes-as-raid-drives.aspx</link><pubDate>Thu, 25 Mar 2010 05:56:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:23734</guid><dc:creator>BuckWoody</dc:creator><description>&lt;P&gt;I'm unable to sleep tonight so I thought I would push this post out VERY early. When you don't sleep your mind takes interesting&amp;nbsp;turns, which can be a good thing. &lt;/P&gt;
&lt;P&gt;I was watching a briefing today by a couple of friends as they were talking about various ways to arrange a Windows Server Cluster for SQL Server. I often see an "active" node of a cluster with a "passive" node backing it up. That means one node is working and accepting transactions, and the other is not doing any work but simply "standing by" waiting for the first to fail over.&lt;/P&gt;
&lt;P&gt;The configuration in the demonstration I saw was a bit different. In this example, there were three nodes that were actively working, and a fourth standing by for all three. I've put configurations like this one into place before, but as I was looking at their architecture diagram, it looked familar - it looked like a RAID drive setup! And that's not a bad way to think about your cluster arrangements. The same concerns you might think about for a particular RAID&amp;nbsp;configuration provides a good way to think about protecting&amp;nbsp;your systems in general.&lt;/P&gt;
&lt;P&gt;So even if you're not staying awake all night thinking about SQL Server clusters, take this post as an opportunity for "lateral thinking" - a way of combining in your mind the concepts from one piece of knowledge to another. You might find a new way of making your technical environment a little better.&lt;/P&gt;</description></item><item><title>PowerShell: Read Excel to Create Inserts</title><link>http://sqlblog.com/blogs/buck_woody/archive/2010/03/18/powershell-read-excel-to-create-inserts.aspx</link><pubDate>Thu, 18 Mar 2010 12:09:36 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:23520</guid><dc:creator>BuckWoody</dc:creator><description>&lt;p&gt;I’m writing &lt;a href="http://www.informit.com/guides/content.aspx?g=sqlserver&amp;amp;seqNum=342" target="_blank"&gt;a series of articles on how to migrate “departmental” data into SQL Server&lt;/a&gt;. 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) a few methods on actually moving the data.&lt;/p&gt;  &lt;p&gt;One of those options is to use PowerShell. There are a lot of ways even with that choice, but the one I show is to read two columns from the spreadsheet and output statements that would insert the data using a stored procedure. Of course, you could re-write this as INSERT statements, out to a text file for bcp, or even use a database connection in the script to move the data directly from Excel into SQL Server. &lt;/p&gt;  &lt;p&gt;This snippet won’t run on your system, of course – it assumes a Microsoft Office Excel 2007 spreadsheet located at &lt;strong&gt;c:\temp&lt;/strong&gt; called &lt;strong&gt;VendorList.xlsx&lt;/strong&gt;. It looks for a tab in that spreadsheet called &lt;strong&gt;Vendors&lt;/strong&gt;. The statement that does the writing just uses one column: &lt;strong&gt;Vendor Code&lt;/strong&gt;. Here’s the breakdown of what I’m doing:&lt;/p&gt;  &lt;p&gt;In the first block, I connect to Microsoft Office Excel. That connection string is specific to Excel 2007, so if you need a different version you’ll need to look that up.&lt;/p&gt;  &lt;p&gt;In the second block I set up a selection from the entire spreadsheet based on that tab. Note that if you’re only after certain data you shouldn’t get the whole spreadsheet – that’s just good practice.&lt;/p&gt;  &lt;p&gt;In the next block I create the text I want, inserting the Vendor Code field as I go.&lt;/p&gt;  &lt;p&gt;Finally I close the connection.&lt;/p&gt;  &lt;p&gt;Enjoy!&lt;/p&gt;  &lt;p&gt;&lt;font color="#408080"&gt;$ExcelConnection= New-Object -com &amp;quot;ADODB.Connection&amp;quot;      &lt;br /&gt;$ExcelFile=&amp;quot;c:\temp\VendorList.xlsx&amp;quot;       &lt;br /&gt;$ExcelConnection.Open(&amp;quot;Provider=Microsoft.ACE.OLEDB.12.0;`       &lt;br /&gt;Data Source=$ExcelFile;Extended Properties=Excel 12.0;&amp;quot;) &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#408080"&gt;$strQuery=&amp;quot;Select * from [Vendors$]&amp;quot;      &lt;br /&gt;$ExcelRecordSet=$ExcelConnection.Execute($strQuery) &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#408080"&gt;do {      &lt;br /&gt;Write-Host &amp;quot;EXEC sp_InsertVendors '&amp;quot; $ExcelRecordSet.Fields.Item(&amp;quot;Vendor Code&amp;quot;).Value &amp;quot;'&amp;quot;      &lt;br /&gt;$ExcelRecordSet.MoveNext()}       &lt;br /&gt;Until ($ExcelRecordSet.EOF) &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#408080"&gt;$ExcelConnection.Close()&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Calibri"&gt;&lt;b&gt;&lt;i style="mso-bidi-font-style:normal;"&gt;&lt;span style="color:maroon;font-size:10pt;mso-bidi-font-size:11.0pt;mso-bidi-font-family:calibri;mso-ansi-language:en;"&gt;Script Disclaimer, for people who need to be told this sort of thing: &lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;b&gt;&lt;i style="mso-bidi-font-style:normal;"&gt;&lt;span style="color:maroon;font-size:10pt;mso-bidi-font-family:calibri;mso-ansi-language:en;"&gt;           &lt;p&gt;&lt;/p&gt;         &lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="margin:0in 0in 0pt;" class="MsoNormal"&gt;&lt;i style="mso-bidi-font-style:normal;"&gt;&lt;span style="color:maroon;font-size:10pt;mso-bidi-font-family:calibri;mso-ansi-language:en;"&gt;&lt;font face="Calibri"&gt;Never trust any script, including those that you find here, until you understand exactly what it does and how it will act on your systems. Always check the script on a test system or Virtual Machine, not a production system. All scripts on this site are performed by a professional stunt driver on a closed course. Your mileage may vary. Void where prohibited. Offer good for a limited time only. Keep out of reach of small children. Do not operate heavy machinery while using this script. If you experience blurry vision, indigestion or diarrhea during the operation of this script, see a physician immediately.&lt;/font&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;</description></item><item><title>Challenge: Learn One New Thing Today</title><link>http://sqlblog.com/blogs/buck_woody/archive/2010/03/17/challenge-learn-one-new-thing-today.aspx</link><pubDate>Wed, 17 Mar 2010 13:07:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:23485</guid><dc:creator>BuckWoody</dc:creator><description>&lt;P&gt;Most of us know that there's a lot to learn. I'm teaching a class this morning, and even on the subject where I'm the "expert" (that word always makes me nervous!) I still have a lot to learn.&lt;/P&gt;
&lt;P&gt;To learn, sometimes I take a class, read a book, or carve out a large chunk of time so that I can fully grasp the subject. But since I've been working, I really don't have a lot of opportunities to do that. Like you, I'm really busy. So what I've been able to learn is to take just a few moments each day and learn something new about SQL Server. I thought I would share that&amp;nbsp;process here.&lt;/P&gt;
&lt;P&gt;First, I started with an outline of the product. You can use Books Online, a college class syllabus, a training class outline,&amp;nbsp;or a comprehensive book&amp;nbsp;table of contents. Then I checked off the things I felt I knew a little about. Sure, I'll come back around to those, but I want to be as efficient as I can. I then trolled various checklists to see what&amp;nbsp;I needed to know about the subjects I didn't have checked off. &lt;/P&gt;
&lt;P&gt;From there (I'm doing all this in a notepad, and then later in OneNote when that came out) I developed a block of text for that subject.&amp;nbsp;Every time I ran across a book, article, web site or recording&amp;nbsp;on that topic I wrote that reference down.&amp;nbsp;Later I went back and quickly looked over those resources and tried to figure out how I could parcel it out - 10 minutes for this one, a&amp;nbsp;free seminar (like the one I'm teaching today - ironic) takes 4 hours, a web site takes an hour to grok, that sort of thing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Then all I did was figure out how much time&amp;nbsp;each day I'll give to training. Sure, it literally may be ten minutes, but it adds up.&lt;/P&gt;
&lt;P&gt;One final thing - as I used&amp;nbsp;something I learned, I&amp;nbsp;came back and made notes in that topic. You learn to play the piano not just from a book, but&amp;nbsp;by playing the piano, after all. If you don't use what you learn, you'll lose it.&lt;/P&gt;
&lt;P&gt;So&amp;nbsp;if you're interested in getting better at&amp;nbsp;SQL Server, and&amp;nbsp;you're willing to do a little work, try out this method. Leave a note here for others to encourage them.&amp;nbsp;&lt;/P&gt;</description></item><item><title>Using linked servers, OPENROWSET and OPENQUERY</title><link>http://sqlblog.com/blogs/buck_woody/archive/2010/03/16/using-linked-servers-openrowset-and-openquery.aspx</link><pubDate>Tue, 16 Mar 2010 12:41:33 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:23448</guid><dc:creator>BuckWoody</dc:creator><description>&lt;p&gt;SQL Server has a few mechanisms to reach out to another server (even another server type) and query data from within a Transact-SQL statement. Among them are a set of stored credentials and information (called a &lt;a href="http://msdn.microsoft.com/en-us/library/ms190479.aspx" target="_blank"&gt;Linked Server&lt;/a&gt;), a statement that uses a linked server called called &lt;a href="http://msdn.microsoft.com/en-us/library/ms188427.aspx" target="_blank"&gt;OPENQUERY&lt;/a&gt;, another called &lt;a href="http://msdn.microsoft.com/en-us/library/ms190312.aspx" target="_blank"&gt;OPENROWSET&lt;/a&gt;, and one called &lt;a href="http://msdn.microsoft.com/en-us/library/ms179856.aspx" target="_blank"&gt;OPENDATASOURCE&lt;/a&gt;. This post isn’t about those particular functions or statements – hit the links for more if you’re new to those topics.&lt;/p&gt;  &lt;p&gt;I’m actually more concerned about where I see these used than the particular method. In many cases, a Linked server isn’t another Relational Database Management System (RDMBS) like Oracle or DB2 (which is possible with a linked server), but another SQL Server. My concern is that linked servers are the new Data Transformation Services (DTS) from SQL Server 2000 – something that was designed for one purpose but which is being morphed into something much more.&lt;/p&gt;  &lt;p&gt;In the case of DTS, most of us turned that feature into a full-fledged job system. What was designed as a simple data import and export system has been pressed into service doing logic, routing and timing. And of course we all know how painful it was to move off of a complex DTS system onto SQL Server Integration Services.&lt;/p&gt;  &lt;p&gt;In the case of linked servers, what should be used as a method of running a simple query or two on another server where you have occasional connection or need a quick import of a small data set is morphing into a full federation strategy. In some cases I’ve seen a complex web of linked servers, and when credentials, names or anything else changes there are huge problems.&lt;/p&gt;  &lt;p&gt;Now don’t get me wrong – linked servers and &lt;a href="http://msdn.microsoft.com/en-us/library/ms188721.aspx" target="_blank"&gt;other forms of distributing queries&lt;/a&gt; is a fantastic set of tools that we have to move data around. I’m just saying that when you start having lots of workarounds and when things get really complicated, you might want to step back a little and ask if there’s a better way. Are you able to tolerate some latency? Perhaps you’re &lt;a href="http://msdn.microsoft.com/en-us/library/ms345108(SQL.90).aspx" target="_blank"&gt;able to use Service Broker&lt;/a&gt;. Would you like to be platform-independent on the data source? &lt;a href="http://www.c-sharpcorner.com/UploadFile/mikegriffin/middle_tier12232005054629AM/middle_tier.aspx" target="_blank"&gt;Perhaps a middle-tier might make more sense&lt;/a&gt;, abstracting the queries there and sending them to the proper server. Designed properly, I’ve seen these systems scale further and be more resilient than loading up on linked servers.&lt;/p&gt;</description></item><item><title>System Variables, Stored Procedures or Functions for Meta Data</title><link>http://sqlblog.com/blogs/buck_woody/archive/2010/03/11/system-variables-stored-procedures-or-functions-for-meta-data.aspx</link><pubDate>Thu, 11 Mar 2010 13:42:22 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:23190</guid><dc:creator>BuckWoody</dc:creator><description>&lt;p&gt;Whenever you want to know something about SQL Server’s configuration, whether that’s the Instance itself or a database, you have a few options.&lt;/p&gt;  &lt;p&gt;If you want to know “dynamic” data, such as how much memory or CPU is consumed or what a particular query is doing, you should be using the Dynamic Management Views (DMVs) that you can read about here: &lt;a href="http://msdn.microsoft.com/en-us/library/ms188754.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms188754.aspx&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;But if you’re looking for how much memory is installed on the server, the version of the Instance, the drive letters of the backups and so on, you have other choices.&lt;/p&gt;  &lt;p&gt;The first of these are system variables. You access these with a SELECT statement, and they are useful when you need a discrete value for use, say in another query or to put into a table. You can read more about those here: &lt;a href="http://msdn.microsoft.com/en-us/library/ms173823.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms173823.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;You also have a few stored procedures you can use. These often bring back a lot more data, pre-formatted for the screen. You access these with the EXECUTE syntax. It is a bit more difficult to take the data they return and get a single value or place the results in another table, but it is possible. You can read more about those here: &lt;a href="http://msdn.microsoft.com/en-us/library/ms187961.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms187961.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Yet another option is to use a system function, which you access with a SELECT statement, which also brings back a discrete value that you can use in a test or to place in another table. You can read about those here: &lt;a href="http://msdn.microsoft.com/en-us/library/ms187812.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms187812.aspx&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;By the way, many of these constructs simply query from tables in the &lt;strong&gt;master &lt;/strong&gt;or &lt;strong&gt;msdb &lt;/strong&gt;databases for the Instance or the &lt;em&gt;system tables&lt;/em&gt; in a user database. You can get much of the information there as well, and there are even system views in each database to show you the meta-data dealing with structure – more on that here: &lt;a href="http://msdn.microsoft.com/en-us/library/ms186778.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms186778.aspx&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Some of these choices are the only way to get at a certain piece of data. But others overlap – you can use one or the other, they both come back with the same data. So, like many Microsoft products, you have multiple ways to do the same thing. And that’s OK – just research what each is used for and how it’s intended to be used, and you’ll be able to select (pun intended) the right choice. &lt;/p&gt;</description></item><item><title>Have you backed up your keys lately?</title><link>http://sqlblog.com/blogs/buck_woody/archive/2010/03/01/have-you-backed-up-your-keys-lately.aspx</link><pubDate>Mon, 01 Mar 2010 14:06:04 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:22679</guid><dc:creator>BuckWoody</dc:creator><description>&lt;p&gt;Did you know that you already have a Server Master Key (SMK) generated for your system? That’s right – while a Database Master Key (DMK) is generated when you encrypt a certificate or Asymmetric Key with code, the Server Master Key is generated automatically when you start the Instance. &lt;/p&gt;  &lt;p&gt;So you should back all of those keys up periodically, and then store that backup AWAY from the server itself. &lt;/p&gt;  &lt;p&gt;There are two reasons for this – first, if the drives get stolen and you’re storing the key backup there, well, that should be obvious why that’s bad. Second, you want to protect the keys in case the system is destroyed or you can’t recover the drives. You will need those keys if you have encrypted anything in the database to get the data back.&lt;/p&gt;  &lt;p&gt;More here: &lt;a href="http://technet.microsoft.com/en-us/library/bb964742.aspx"&gt;http://technet.microsoft.com/en-us/library/bb964742.aspx&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;No, the standard Maintenance Wizards don’t get this data. And no, I haven’t seen it addressed in most of the maintenance scripts out there anyway – sometimes for good reason, but this means you need to take care of it manually, and then document where you put that backup.&lt;/p&gt;</description></item></channel></rss>