What does the pipe/veritcal bar character mean in TSQL? [duplicate]

纵然是瞬间 提交于 2019-11-28 13:58:23

It's the bitwise OR operator. See this article. Effectively, message is a bitfield, and by bitwise-ORing it with 2, you're setting the second bit. See Wikipedia's bitwise operation article for a good overview of bit-twiddling :)

| is a bitwise OR in T-SQL:

http://msdn.microsoft.com/en-us/library/ms186714.aspx

So if message contained 0, it would contain 2, if it contained 1, it would contain 3, etc.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!