与直接在MS SQL Server Management Studio中执行相比,SQL执行返回的结果有所不同

时间:2019-02-25 06:56:54

标签: sql sql-server tsql sql-server-2008 sql-server-2012

我对SQL非常困惑,所以也许我做错了事。

我试图建立一个查询,该查询将显示几个SELECT的结果。代码很简单,但是总的来说是这样的:

结果转换为sql文本选项

select  MessageId from   NsDelivery..NudgeResponseDump (NOLOCK) where Pk_RowId = 28901649

输出

0:1550774328341685 9d012f009d012f

不带结果的sql文本选项

    select  MessageId from   NsDelivery..NudgeResponseDump (NOLOCK) where Pk_RowId = 28901649

输出

0:1550774328341685

我不知道为什么第二个选项中缺少字符串数据,请给我有效的解释...

1 个答案:

答案 0 :(得分:3)

我猜想字符串的两个部分(不是.container-Atanan { box-shadow:0px 3px 1px -2px rgba(0,0,0,0.2), 0px 2px 2px 0px rgba(0,0,0,0.14), 0px 1px 5px 0px rgba(0,0,0,0.12); display: flex; flex-direction: column; box-sizing: border-box; // background-color : #7AD3B1; width: 470px; height: 80%; overflow: auto; padding-bottom : 30px; font-family: 'Roboto', sans-serif; &-Header { display: inline-flex; background-color: #e2e2e2; height: 50px; align-items: center; &-Title{ padding:15px; } } &-ListItem{ display: inline-flex; .listItem{ display: inline-flex; width: 100%; height: 72px; text-decoration: none; color:black; padding: 15px 15px; } &-Avatar { margin-right: 10px; display: inline-flex; align-items: center; img{ border-radius: 50%; width: 40px; height: auto; } } &-Content { display: inline-flex; padding-right: 30px; flex-direction: column; justify-content: center; padding-left:10px; width: 362px; height: 72px; box-shadow: 0 8px 6px -20px rgba(0,0,0,0.2), 0px 2px 2px 0px rgba(0,0,0,0.14), 0px 1px 5px 0px rgba(0,0,0,0.12); transition: background-color 0.5s ease-out; .Content-Title{ font-weight: 500; } .Content-Subtitle { font-weight: 300; display: inline-flex; flex-direction: column; .italic{ font-weight : lighter; font-style: italic; font-size :1em; } .oldline{ text-decoration:line-through; } } &:hover{ background: rgba(0,0,0,0.05) } } } .divider{ display: block; margin-left: 72px; border: solid; border-width: thin 0 0 0; margin-left: 0; margin-right: 0; margin-bottom : 0; &-Light{ border-color: rgba(0,0,0,0.12); } } } 值,而是NULL)之间有一个空字符(又叫空终止符)。此字符导致字符串在结果中被切断为网格模式。这里有一些信息here。 本质上,字符串的最后一部分在那里,但是在可视化中由于空字符而被截断。您可以通过将字符串强制转换为CHAR(0)来进行测试,一个空字符将显示为VARBINARY