Latest stories

Calculate the Date of Previous Sunday

There are a number of ways that you can calculate dates using T-SQL.  A common practice is to find the first day of the week which can be accomplished easily by using the following function. SELECT DATEADD(wk, DATEDIFF(wk,0,GETDATE()), 0) However, you will notice that this returns the date for Monday as SQL Server uses Monday for the start of the week. If your week starts on Sunday or you need to...

Use SQL from the Command Line

More often than not an execute SQL task in SSIS will do the trick.  If not, then the data flow will accomplish whatever objective is set out.  Occasionally those can become cumbersome in a package to accomplish something simple.  In those cases using SQL from the command line could be the perfect fit.  SQLCMD will allow SQL commands to be run from the command line in has the ability to define...

Why Won't My .dbf Destination Work

This past week I ran into an issue where I needed to use a .dbf destination in my SSIS package. All was going well; I set up the destination and pressed the preview button to make sure everything was great, and BOOM! Blew up in my face. Not cool. So if you happen to be having issues setting up a connection for a .DBF here is what you need to do. Use the Native OLE DBMicrosoft Jet 4.0 OLE DB...

Prepare To Install Reporting Services

The first step in setting up a report server is getting Reporting Services installed.  There are a few differences between the process for 2005 and 2008.  On the installation side, if you do not have the IIS setting configured before running the SQL install process you will not even be given the option to install reporting services in 2005.  You still have the option even without setting up IIS...

Control Flow vs Data Flow

After my first day of SSIS training my boss walked into the office and said to me, “how was the first day of class”.  To which I responded, “great!”  Then asked me, “so what is the difference between the control flow and data flow?”  This posed a simple, but foundational concept, of SSIS.  There are a few key things to remember when talking about the...

Show All Projects in the Solution Explorer

If your like me, then you may have a little OCD and need everything to be completely organized in your environment.  BIDS has been annoying me in this respect lately.  I am working on creating a data warehouse and will be starting on the next portion of the project shortly.  I wanted to keep everything for it in the same solution, my warehouse ETL as well as the work on the Cube.  So I figure...

SQL Maintenance Plan Doesn't Delete Backups

I recently created a maintenance plan for our server to backup all the databases on a daily basis.  In the cleanup step I set it to delete backups older than 7 day.  I let the plan run for a week and checked on it to make sure the old backups were being deleted.  This would be kind of a useless post if everything was working correctly, so as you guessed, they were not being deleted.  I check...

SQL UPDATE Using a Join

You may need to do an update on joined tables to get a more conditional update.  For instance, I have a Student table as well as an AcademicStatus table.  The Student table contains all the students (profound, I know) and the AcademicStatus table tells if a student is in good standing, at risk, or has dropped out based on a StandingID.  The Student table also lists a graduation date and a current...

Trouble Viewing Reports in Report Server

Have you ever opened your report server only to find a blank section of nothing-ness where your reports should be?  The solution to your problem is more than likely in the permissions.  The easiest fix for this situation is to right click on IE and select Run As Administrator.  There are, however, ways around having to run IE as an administrator each time you want to view reports.  If disabling...

Saving Changes Is Not Permitted

Have you ever created a table thinking everything looked amazing and was designed perfect only to come back and need to add to it?  Maybe you need to change a data type, add a column, delete a column or move a column.  It’s an easy fix, right.  Just right click on the table, go to Design mode and make your changes. Well, this would be a pretty useless story if all that worked flawlessly. As...

Bradley Schacht

Bradley Schacht is a Senior Program Manager on the Microsoft Azure Synapse Analytics team based in Jacksonville, FL. He has worked with Microsoft SQL Server and Azure data services since 2009 as a consultant, trainer, and architect. He has co-authored 4 SQL Server and Power BI books, most recently the Microsoft Power BI Quick Start Guide. Bradley enjoys solving interesting problems and teaching others to use new technology. He frequently presents at community events around the country, is a contributor to sites such as SQLServerCentral.com, and is a member of the Jacksonville SQL Server User Group (JSSUG).

Follow Me