I was doing some research on my SQL Servers and wanted to know just how much disk space an instance’s database were taking up. Since the databases on this instance are across a couple of different arrays and backups and other stuff exist on the server, I figured i’d write some t-sql to figure out this question. Here’s what I wrote: SELECT SUM(SIZE*8)/1024.0/1024.0 FROM master.sys.sysaltfiles That select statement shows me exactly how much space an entire instance (2005+) is taking up (save for any database in any state besides just online). This isn’t just the size of the data, but rather the space that the database files have taken up.
This is an archive of the posts published to LessThanDot from 2008 to 2018, over a decade of useful content. While we're no longer adding new content, we still receive a lot of visitors and wanted to make sure the content didn't disappear forever.
I’ve heard stories about people being approached about a new job by a company, rather than the other way around, because the company liked their work, their writing, their presentations, or maybe all three. I thought, “That’s an awesome dream. It’s not going to happen to me.” Until last week. Blue Door Consulting, a boutique marketing firm in Oshkosh, WI, asked me to join their growing company. I’ll be working with a small team that feels like a family as a Technology Consultant. I’ll be bringing my database knowledge to their client’s web and mobile apps, and am looking forward to bringing business intelligence solutions to the clients as well.
Realizing I was lucky enough to attend PASS Summit 2011, I’ve decided a blog post is de rigueur. So, here goes. Jeremiah Peschka’s session Rewrite Your T-SQL for Great Good ! kept me in stitches. His statement “We need standards like a Lego whale needs a bicycle” still cracks me up. I wanna use that line myself, only it probably won’t be as effective without the photo that Jeremiah used in his slides. I’m still scratching my head about his suggestion that code should be tested in Production, though. I wish he’d included a methodology for this. Of course, I may have misunderstood him completely…
When I installed Roslyn I thought the visualizer tool window would just be there; But it isn’t. You need to install it. And you need to install it in an awkward way ;-). First you need to open the Getting started document. Then you should read the whole document, of course. If you did that you can click on the link that says Syntax Visualizer Tool Window You can find that solution file in your my documents under Microsoft Codename Roslyn CTP – October 2011SharedSyntaxVisualizerExtension
Introduction In part 1 of trying to move the classes to their own files, I made sure I got the classes I needed. Now I’m going to Write out those classes and remove them from where they were before. Writing the classes to their own file The easy bit is writing out class3 and partial class 1 to their own files. Option Strict Off Imports System.IO Module Module1 Sub Main() Const foldername As String = "F:MyDocumentsVisual Studio 2010ProjectsConsoleApplication5" Dim sourcetext As String Using streamReader = New StreamReader(Path.Combine(foldername, "Class1.vb")) sourcetext = streamReader.ReadToEnd End Using Dim tree = SyntaxTree.ParseCompilationUnit(sourcetext) Dim root As CompilationUnitSyntax = tree.Root Dim classes = From e In root.DescendentNodes.OfType(Of ClassStatementSyntax)() Where (From f In e.Modifiers Select f.Kind.GetText).Contains("Public") Select e For Each classstatement In classes Console.WriteLine("Class: " & classstatement.Identifier.GetText) Dim tree2 = SyntaxTree.ParseCompilationUnit(classstatement.GetFullText) Dim filename = Path.Combine(foldername, classstatement.Identifier.GetText & ".vb") For Each modifier1 In classstatement.Modifiers Console.WriteLine(modifier1.Kind) Console.WriteLine(modifier1.Kind.GetText) If modifier1.Kind.GetText = "Partial" Then filename = Path.Combine(foldername, classstatement.Identifier.GetText & "_partial.vb") End If Next File.WriteAllText(filename, classstatement.Parent.GetText) Next Console.ReadLine() End Sub End Module With this as the result.
Introduction In my previous attempts to work with Roslyn [I installed Roslyn][1] and [read the sourcefiles][2]. Now it’s time to do some refactoring. Find the class to refactor I had made this file in my first attempts. Public Class Class1 Public Property string1 As String Public Property string2 As String Private Class Class2 Public Property string3 As String Public Property string4 As String End Class End Class Public Class Class3 Public Property string5 As String Public Property string6 As String End Class Partial Public Class Class1 Public Property string7 As String Public Property string8 As String End Class I want to move Class3 and the partial Class1 out of that file and into their own files.
Introduction In part one of reading the sourcefile with Roslyn I installed Roslyn, made a new console project and read the content of this file. Now lets go a bit further. Property and class So I adapted my sourcefile to contain a bit more posibilities. Public Class Class1 Public Property string1 As String Public Property string2 As String Private Class Class2 Public Property string3 As String Public Property string4 As String End Class End Class Public Class Class3 Public Property string5 As String Public Property string6 As String End Class Partial Public Class Class1 Public Property string7 As String Public Property string8 As String End Class If I now run my previous example.
Introduction Roslyn has been long awaited, especially in the VB.Net world. Since we need it to make some kind of VBCop. Of course this does not mean that Roslyn will be available in the next version of Visual studio yet. But we are hopeful for the version after that. Installing Installing Roslyn CTP is easy. Just got to the download page, download it (duh) and then install it (duh again). I guess if your a programmer that these steps should be childsplay. You might notice that Roslyn is stil a codename. I’m guessing the official version will be named, .Net compiler services. Or they might come up with something original this time around…nah probably not.
I managed to survive my first PASS Summit speaking engagement! That was exhilarating, and I think it went very well! Thank you to everyone that attended my session, “Reporting Services 201: From Basic to WOW!” I covered a few of my favorite RS features that I think can make your reports stand out: Background images NoRows property Toggle items Matrix Lists Charts My presentation materials – PowerPoint and .rdls – are available for download at http://www.sqlpass.org/summit/2011/Speakers/CallForSpeakers/SessionDetail.aspx?sid=1004.
I am putting a wiki page together on what a SQL Server DBA needs to monitor daily, weekly, monthly, quarterly and yearly. So far I have created a couple of things here: What does a DBA need to check for daily, weekly, monthly, quarterly and yearly So far I have added only a few items and a couple of blurbs, I would like to expand that and need some input from you the readers. What do you monitor