RIGHT_SHIFT

SQLServerCentral Article

Packing and Decoding Device Status Codes with LEFT_SHIFT() and RIGHT_SHIFT() in SQL Server

  • Article

Some systems store several small status values through a single packed integer. For example, a device integration may require tracking operating mode, alert level, and zone information as one status code rather than separate values in different columns. That creates a practical reporting problem. The packed value may be convenient for an integration format, but […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2026-11-06

8 reads

Blogs

Wait… Could This Be the End of Index Maintenance?

By

While attending SQLCon and FabCon Europe in Barcelona, there were a lot of announcements...

Copilot on the Power BI Report Canvas vs. Modern Report Builder

By

(This is the second post in a three-part series on how AI is changing...

The #MS_DatabaseConnector## Role: #SQLNewBlogger

By

I had seen these roles in various instances, but never dug into the new...

Read the latest Blogs

Forums

Pay for Performance

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Pay for Performance, which is...

Packing and Decoding Device Status Codes with LEFT_SHIFT() and RIGHT_SHIFT() in SQL Server

By john.martin

Comments posted to this topic are about the item Packing and Decoding Device Status...

SQL Server Audit Failures

By Steve Jones - SSC Editor

Comments posted to this topic are about the item SQL Server Audit Failures

Visit the forum

Question of the Day

SQL Server Audit Failures

If I have a SQL Server Server Audit setup, what are my options for configuring the instance in the event it can't write to the audit log?

See possible answers