<legend id='43rdI'><style id='43rdI'><dir id='43rdI'><q id='43rdI'></q></dir></style></legend>

<small id='43rdI'></small><noframes id='43rdI'>

      • <bdo id='43rdI'></bdo><ul id='43rdI'></ul>

      1. <i id='43rdI'><tr id='43rdI'><dt id='43rdI'><q id='43rdI'><span id='43rdI'><b id='43rdI'><form id='43rdI'><ins id='43rdI'></ins><ul id='43rdI'></ul><sub id='43rdI'></sub></form><legend id='43rdI'></legend><bdo id='43rdI'><pre id='43rdI'><center id='43rdI'></center></pre></bdo></b><th id='43rdI'></th></span></q></dt></tr></i><div id='43rdI'><tfoot id='43rdI'></tfoot><dl id='43rdI'><fieldset id='43rdI'></fieldset></dl></div>
      2. <tfoot id='43rdI'></tfoot>

        sql server 函数中的 newid()

        时间:2023-09-18

          • <tfoot id='iWzV5'></tfoot>
              <tbody id='iWzV5'></tbody>

              <small id='iWzV5'></small><noframes id='iWzV5'>

                  <bdo id='iWzV5'></bdo><ul id='iWzV5'></ul>

                  <legend id='iWzV5'><style id='iWzV5'><dir id='iWzV5'><q id='iWzV5'></q></dir></style></legend>
                  <i id='iWzV5'><tr id='iWzV5'><dt id='iWzV5'><q id='iWzV5'><span id='iWzV5'><b id='iWzV5'><form id='iWzV5'><ins id='iWzV5'></ins><ul id='iWzV5'></ul><sub id='iWzV5'></sub></form><legend id='iWzV5'></legend><bdo id='iWzV5'><pre id='iWzV5'><center id='iWzV5'></center></pre></bdo></b><th id='iWzV5'></th></span></q></dt></tr></i><div id='iWzV5'><tfoot id='iWzV5'></tfoot><dl id='iWzV5'><fieldset id='iWzV5'></fieldset></dl></div>
                  本文介绍了sql server 函数中的 newid()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我必须在查询结果中插入一个假列,它是表值函数的返回值.此列数据类型必须是唯一标识符.最好的方法(我认为...)是使用 newid() 函数.问题是,我不能在这种类型的函数中使用 newid() :

                  I have to insert a fake column at the result of a query, which is the return value of a table-value function. This column data type must be unique-identifier. The best way (I think...) is to use newid() function. The problem is, I can't use newid() inside this type of function:

                  Invalid use of side-effecting or time-dependent operator in 'newid()' within a function.
                  

                  推荐答案

                  这里有一个聪明的解决方案:

                  here's a clever solution:

                  create view getNewID as select newid() as new_id
                  
                  create function myfunction ()
                  returns uniqueidentifier
                  as begin
                     return (select new_id from getNewID)
                  end
                  

                  我无法相信这一点.我在这里找到了:http://omnibuzz-sql.blogspot.com/2006/07/accessing-non-deterministic-functions.html

                  that i can't take credit for. i found it here: http://omnibuzz-sql.blogspot.com/2006/07/accessing-non-deterministic-functions.html

                  -唐

                  这篇关于sql server 函数中的 newid()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何在 SQL Server 2005 中将多行组合成逗号分隔的列表? 下一篇:如何在 SQL Server 数据库中搜索字符串?

                  相关文章

                  <small id='oPexG'></small><noframes id='oPexG'>

                    1. <i id='oPexG'><tr id='oPexG'><dt id='oPexG'><q id='oPexG'><span id='oPexG'><b id='oPexG'><form id='oPexG'><ins id='oPexG'></ins><ul id='oPexG'></ul><sub id='oPexG'></sub></form><legend id='oPexG'></legend><bdo id='oPexG'><pre id='oPexG'><center id='oPexG'></center></pre></bdo></b><th id='oPexG'></th></span></q></dt></tr></i><div id='oPexG'><tfoot id='oPexG'></tfoot><dl id='oPexG'><fieldset id='oPexG'></fieldset></dl></div>
                      <tfoot id='oPexG'></tfoot>

                        <bdo id='oPexG'></bdo><ul id='oPexG'></ul>
                      <legend id='oPexG'><style id='oPexG'><dir id='oPexG'><q id='oPexG'></q></dir></style></legend>