Tags » T-SQL

SQL SERVER - Error: Msg 245 - Conversion failed when converting the varchar value 'Inactive' to data type int

Using CASE statements is something I see a lot of developers use. They use it in complex environments and I have been fortunate to troubleshoot and look at code blocks that run for pages using the standard CASE statements. 369 more words

SQL Authority

And you said you are unconsolable...clean up before you leave

Greetings,

I am approaching my last day at my current job. I love it here and will be really sad to leave, but have an awesome opportunity to grow my knowledge and career with a company on my “want to work for” list. 272 more words

Awesome T-SQL

T-SQL query to get the number of columns in a table

SELECT COUNT(COLUMN_NAME) 
FROM [ this_is_my_database_name].INFORMATION_SCHEMA.COLUMNS 
WHERE TABLE_CATALOG = ' this_is_my_database_name' 
AND TABLE_SCHEMA = 'dbo' --this is dbo by default, change if you need
AND TABLE_NAME = 'this_is_my_table_name'

SQL Server

SQL SERVER - Free SQL Complete Add-in For SSMS

This article covers main features of ApexSQL Complete, free SQL complete add-in. You can download the most recent version, and check its features while reading the article. 927 more words

SQL Authority

SQL SERVER - Inserting into Sparse Column Sets and Errors Associated With It

I have written tons of blogs in the past around using sparse columns. The best part and lesser known part of sparse columns is that we can write to the column sets directly too. 474 more words

SQL Authority

Interview Question of the Week #029 - Difference Between CHARINDEX vs PATINDEX

Question: What is the difference between CHARINDEX vs PATINDEX?

Answer: We can use either CHARINDEX or PATINDEX to search in a TEXT field in SQL SERVER. 148 more words

SQL Authority

SQL SERVER - How to Find If Queries are Run in Parallel?

Technology innovations over years have made personal computing and the infrastructure inside our datacenters even more powerful. Gone are the days when our laptops used to come with single processors and single cores. 441 more words

SQL Authority