Skip to content

Jim Salasek's SQL Server Blog

Sharing what I learn about Sql Server

  • Home
  • About
  • Contact

Recent Posts

  • Terminate SSIS Jobs: A Step-by-Step Guide January 7, 2025
  • Copy SQL Server tables between servers easily with dbatools. December 17, 2024
  • Master Filtering in SSMS: Quick Database Object Access December 3, 2024
  • Find SQL Server Tables with Identity Columns Easily November 12, 2024
  • How to find all jobs that call a stored procedure. June 4, 2024
April 2017
M T W T F S S
 12
3456789
10111213141516
17181920212223
24252627282930
« Mar   May »

Month: April 2017

View Jpg’s and other file types stored in a table

Do you have files stored in your SQL Server database and need to see what they are.  Here is a way using my favorite add-in SSMSBoost.

http://www.ssmsboost.com/

Continue reading View Jpg’s and other file types stored in a table

Posted on April 25, 2017April 15, 2017Categories UncategorizedLeave a comment on View Jpg’s and other file types stored in a table

Extract string before a special character

Here is an easy way to get (extract) all of the characters before a special character in a string.  In our example we have a listing of email addresses and we want to get the name before the @domain.

Continue reading Extract string before a special character

Posted on April 18, 2017March 25, 2017Categories Hints and TipsTags charindex, extract characters, extract string, substring2 Comments on Extract string before a special character

Analytic Function — Lag

Starting with SQL Server 2012, Microsoft has included analytic functions within the database.  A couple that I use often, Lag and Lead, are very handy when you need to reference a previous or next row in a table without having to use self-joins or having to create a complicated sql statement.

Continue reading Analytic Function — Lag

Posted on April 11, 2017March 18, 2017Categories UncategorizedLeave a comment on Analytic Function — Lag

Count Rows per Hour

Here is a useful technique to know.  We have a delivery service and we want to know what hour of the day is most popular for completed deliveries.  Using the DATEPART function, this can be easily calculated.

Continue reading Count Rows per Hour

Posted on April 4, 2017March 12, 2017Categories Hints and TipsTags datapart, rows per hour3 Comments on Count Rows per Hour
Create a website or blog at WordPress.com
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
  • Subscribe Subscribed
    • Jim Salasek's SQL Server Blog
    • Join 34 other subscribers
    • Already have a WordPress.com account? Log in now.
    • Jim Salasek's SQL Server Blog
    • Subscribe Subscribed
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar