The End of the TOP

After dealing with TOP and ROWCOUNT in SQL Server, there is one more way of getting a limited amount of data from a query that you should be aware of – OFFSET/FETCH. It can be a little bit more difficult to set up and work with but if you’re in need of the data a…… Continue reading The End of the TOP

Not Quite To the Top

After the past few blog posts, I’m sure you’re like “Sherpa! How many more things can we learn about the TOP Operator?” My friends, the answer is “Still more!” Today, let’s go over an option that can be used in conjunction with TOP. That option is SET ROWCOUNT (Number); This option has the potential to…… Continue reading Not Quite To the Top

More Fun with Smushing Data Together

Last week, we learned all about the old-style string concatenation and the new-ish, hip CONCAT function. This week, it’s time to talk about the CONCATs lesser talked about, but equally helpful cousin – CONCAT_WS. With CONCAT, we formatted the person’s name in a LastName, FirstName format using the following query. SELECT CONCAT(TRIM(LastName), ‘, ‘, TRIM(FirstName))…… Continue reading More Fun with Smushing Data Together

Time to give the data a TRIM()

For years, when it came to getting rid of the spaces at the beginning/end of a string, you were stuck with using the functions LTRIM and RTRIM – meaning left trim and right trim respectively. For many versions of SQL Server – and probably quite often even in code written today – you will see…… Continue reading Time to give the data a TRIM()

Published
Categorized as SQLBasics