Executing SQL Server Stored Procedures from Databricks (PySpark)

Databricks provides some nice connectors for reading and writing data to SQL Server. These are generally want you need as these act in a distributed fashion and support push down predicates etc etc. But sometimes you want to execute a stored procedure or a simple statement. I must stress this is not recommended - more on that at the end of this blog. I’m going to assume that as you made it here you really want to do this. [Read More]

Getting All Table Information

One thing that bugs me in SQL Server is how hard it is to get information about your tables to analyse usage, indexes and size. This is a query I wrote several years ago and still use today. Information exported includes: All Index information including columns Compression File Groups Space Used Row Count Index Usage SELECT O.object_id, O.name TableName, ISNULL(I.[name],'HEAP') IndexName, i.type_desc [IndexType], ISNULL(SDS.name,NPSDS.[name]) FileGroup, PS.row_count [RowCount], CAST(PS.used_page_count * 8 AS money)/1024 SpaceUsed_MB, CAST(PS. [Read More]