Category Archives: Uncategorized

Parameters in Get and Transform

Had a question about using parameters to control a query used with Get and Transform (Power Query) in Excel 2016 or Power BI. This article gives a nice example:

https://www.howtoexcel.org/power-query/how-to-parameterize-your-power-query/

Here is another technique that uses single values rather than a table:

https://exceloffthegrid.com/power-query-using-parameters/

Running a report from a command prompt

While I was teaching a Reporting Services course recently, I was asked how to run a report from a command line. I could think of several techniques.

Using SQL server
My initial thought was to create a subscription to run the report, then use SQL stored procedure msdb.dbo.sp_start_job to run the subscription job, perhaps using SQLcmd from a command line.

Using a .Net application
Creating a small .Net application  using vb or C#. This link gives details of the method that a .net developer can make into an application. https://msdn.microsoft.com/en-us/library/reportexecution2005.reportexecutionservice.render.aspx

Using Powershell
For those who like working with Powershell, it is possible to make similar calls to the render method. http://blogs.technet.com/b/stefan_stranger/archive/2010/05/16/rendering-sql-reporting-reports-with-powershell.aspx

Using an rs.exe script
Finally using a .rss script that can be executed using the rs.exe command line utility. This link gives an example of this technique. http://sqlblog.com/blogs/roman_rehak/archive/2009/06/12/ssrs-report-rendering-from-command-prompt.aspx

Once you have created  some kind of script or app, it then becomes straightforward to pass appropriate parameters to the script.

 

Learning to Query SQL Server

I have been teaching a number of Querying courses recently. Delegates seem to fall into 2 groups.

  • Office workers who need to access data
  • IT specialists

The Microsoft Querying course (20461) is excellent for those from an IT background, particularly those with some programming experience. Recently I have taught some  of theses courses and there have been delegates who are really just administrative staff but need to get data from SQL server. They have usually struggled on this course. There is far too much material for a week. Don’t get me wrong, the examples and exercises in this course are excellent, but for some people they are too much for an initial entry in SQL server.

Much better to do a 2 day basic querying course, or a customised version of 20461 with just some of the first few modules.

Re-installing Windows 10

Nothing to do with SQL Server for once. Was having problems with my Dell Latitude 10 Windows tablet. Decided to reset the Windows 10 installation. Used the option in the control panel to reset to original installation. Now what that actually means is as it was when the tablet was shipped – Windows 8. So I then had apply updates, upgrade to Windows 8.1. Apply updates, upgrade to Windows 10. Except couldn’t get the Windows 10 option to appear. After a quick search I found Get Windows 10. Would have been a much easier and faster to way to do a fresh install.