Tag Archive: SQL Server

  • SQL Server vs Fabric Warehouse: T-SQL gotchas nobody warns you about

    SQL Server vs Fabric Warehouse: T-SQL gotchas nobody warns you about

    Fabric Warehouse looks just like SQL Server. It uses T-SQL, has schemas, stored procs and more. Yet, you migrate your first proper workload and see “that’s not supported” errors you never had to think about before. Fabric Warehouse isn’t SQL Server. Under the bonnet it’s storing everything as Delta Parquet in OneLake, and that storage format shapes what T-SQL can and can’t do. Here’s what actually trips…

    » Read more
  • My Broken Query Runs Successfully in Synapse, Not That I’m Complaining, But How?

    My Broken Query Runs Successfully in Synapse, Not That I'm Complaining, But How?

    I had one of those moments this week, I spent too long trying to figure out how something that I knew was broken, was running fine and throwing no errors. Can it be called troubleshooting if it isn’t causing trouble? I have a Synapse pipeline that’s been running just fine for months, due to some migration work, I needed to take a look at the source query and found it was broken. I had it open in SSMS on the other monitor, ran it,…

    » Read more
  • Connect Azure Data Studio to Microsoft Fabric

    Azure Data Studio and Microsoft Fabric As organisations increasingly adopt Microsoft Fabric for their data warehousing and analytics needs, finding the right tools to speed up development is crucial. Connecting Azure Data Studio to Microsoft Fabric can streamline your workflow, enabling you to navigate environments, pinpoint variances, release code, and assign memorable names to connections instead of relying on lengthy connection strings. Step…

    » Read more
  • Power BI Dataset Gives Mashup Timeout Error While Refreshing

    Help – my Power BI dataset is giving mashup timeout error on refresh The mashup timeout error Incremental refreshes are a great benefit to have in order to reduce refresh times – but not when they give a mashup timeout error. Although they are meant to be a performance enhancement, they aren’t always the best approach as they fire parallel queries to the source and apply date time filters. Despite the default timeout being 2 hours, or 5…

    » Read more
  • Using Stored Procedure as a Power BI Source (with parameters)

    Using a SQL Server stored procedure as a source in Power BI We might be most familiar with using a view as the source to our PBI datasets, a series of views creating a series of tables. This can be great but when handling more complex view queries with lookups, you might find yourself with a severely long refresh and even an error. This is where a stored procedure is required – this gives you more control layer by layer in the source query.…

    » Read more
  • Exporting to a CSV file from SSMS – Simple BCP Method

    Export table contents to a CSV file from SQL Server  It may be useful to export a tables contents to a CSV file for some exploratory analysis, to feed an ETL and much more. This can be done with some simple SQL commands that exist as a stored procedure, SQL agent job or just a one off piece of code. The export can be the whole table or filtered results but one thing to keep in mind is the number of rows and result size as it may become…

    » Read more
  • @@ROWCOUNT in Synapse Dedicated SQL Pool

    If you’ve been working with dedicated SQL pools in Synapse, you may have noticed that the SQL Server system variable @@RowCount is not supported. I will show you a workaround in synapse to get the same information. First, use the query label option to give your query an identifier that you can use to track it: SELECT * FROM Dim.Date OPTION (LABEL = ‘MyQuery’) You can then use DMVs to find your query using the specified label…

    » Read more
  • Why Are There Gaps in the Identity Column in My SQL Database?

    All too often there are questions asked about missing records that are identified by gaps in the identity column of a table. If a table, ordered by the identity column, shows “1, 2, 3, 5”, record 4 must have been deleted right? Well, although that is a possibility, it’s not a safe assumption as there are other causes of these “missing” IDs. Let’s start with a simple table, it only has 3 columns, the first of which being an…

    » Read more
  • #This vs @That – Should I use a Table Variable or a Temporary Table?

    When working with SQL Server, it’s not uncommon to need to store data in a temporary table or table variable. While both options can be used to accomplish the same goal, there are differences between the two that can affect performance and the ability to write efficient code. Let’s explore the differences between table variables and temporary tables, and when to use each one. @Table Variables Table variables are declared using the…

    » Read more
  • Query Store Forced Plan Failures

    Query Store is a fantastic feature of both SQL Server and Azure SQL DB. It allows you to monitor how queries execute against the database which is invaluable for troubleshooting performance issues. More than that though, it gives you the option to force an erratic query to use a particular execution plan, this helps avoid queries from running with inefficient plans and provides predictability and stability on the server. Here we can see an…

    » Read more