↓
 

The Intransigent Data Blog

Getting data to toe the line

The Intransigent Data Blog
The Intransigent Data Blog
  • Home
  • About this Blog
  • Links
  • Toolset
Home→Tags T-SQL

Tag Archives: T-SQL

Columns to Rows without using UNION or UNPIVOT

The Intransigent Data Blog Posted on 06/05/2014 by Andrew Ing21/05/2014

Problem Table contains two or three columns that should be output as a single column over two or three rows.  Such as [Telephone1], [Telephone2], … columns in a table. Use Table Values constructor in CROSS APPLY clause Use the table … Continue reading →

Posted in T-SQL | Tagged T-SQL

Table Row Counts

The Intransigent Data Blog Posted on 30/03/2014 by Andrew Ing02/05/2014

What is the most efficient, least intrusive, way of getting table row counts (say, for keeping periodic statistics)?    Select(*) is accurate.  Using index statistics is instant but the statistics could be out of date. dm_db_index_physical_stats Dynamic management view.  http://technet.microsoft.com/en-us/library/ms188917.aspx … Continue reading →

Posted in DBA, T-SQL | Tagged T-SQL

Move SQL Permissions from Users to Roles

The Intransigent Data Blog Posted on 20/01/2014 by Andrew Ing23/01/2014

For ease of maintenance all object permissions should be granted to SQL Server roles and users simply made members of one role or another.    If you’re using SSDT, roles assigned to users don’t work at all well.  I find it … Continue reading →

Posted in T-SQL | Tagged T-SQL

Error Handler for T-SQL

The Intransigent Data Blog Posted on 28/12/2013 by Andrew Ing11/10/2020

This is the error handler created E. Sommarskog, with some slight alterations by me.  See http://www.sommarskog.se/error-handling-I.html. ERROR_HandleCaughtError stored procedure This is  ES’s error handler in a form that suits me: I usually want to add some additional information to aid … Continue reading →

Posted in T-SQL | Tagged SQL-Pattern, T-SQL

Conversion to INT failed where no conversion expected

The Intransigent Data Blog Posted on 27/12/2013 by Andrew Ing12/04/2018

I have twice now been wrong-footed by this SQL Server error message: “Microsoft SQL Server Native Client 10.0” Hresult: 0x80040E07 Description: “Conversion failed when converting the varchar value ‘abcd123’ to data type int.”. The statement causing this distress was: ISNULL(View1.long_name, View1.short_name) AS output_column … Continue reading →

Posted in T-SQL | Tagged SQL-Pattern, T-SQL

Recent Posts

  • Alternatives to the (slow) FORMAT function
  • Disable non-clustered indexes during data load
  • Script the creation of ODBC DSNs
  • DAX: partitioned conditional aggregations
  • Referential integrity checks
  • Understanding errors from Tabular Analysis Services
  • Error flows in Azure Data Factory
  • The effect of RAID cache backup battery failure

Pages

  • About this Blog
  • Links
  • Toolset

Categories

  • ASP.Net
  • Automation
  • Azure Data Factory
  • Data Warehouse
  • DAX
  • DBA
  • IIS
  • MDS
  • MDX
  • Permissions
  • SSAS
  • SSIS
  • SSRS
  • T-SQL
  • Uncategorized
  • VBA

Archives

  • January 2022 (1)
  • June 2021 (1)
  • May 2021 (1)
  • August 2020 (2)
  • June 2020 (1)
  • December 2019 (1)
  • March 2019 (1)
  • February 2019 (1)
  • December 2018 (1)
  • November 2018 (1)
  • August 2018 (1)
  • April 2018 (1)
  • October 2017 (1)
  • April 2017 (1)
  • January 2017 (2)
  • November 2016 (1)
  • September 2016 (1)
  • May 2016 (2)
  • April 2016 (1)
  • March 2016 (1)
  • February 2016 (2)
  • December 2015 (3)
  • October 2015 (1)
  • July 2015 (1)
  • May 2015 (1)
  • April 2015 (2)
  • February 2015 (1)
  • January 2015 (1)
  • December 2014 (1)
  • October 2014 (2)
  • September 2014 (2)
  • August 2014 (2)
  • July 2014 (3)
  • June 2014 (2)
  • May 2014 (2)
  • April 2014 (1)
  • March 2014 (1)
  • January 2014 (1)
  • December 2013 (5)

Tags

Blog Convention SQL-Pattern SSAS SSIS SSRS T-SQL Validation

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
©2022 - The Intransigent Data Blog - Weaver Xtreme Theme
↑