• <tfoot id='SIvYX'></tfoot>

    • <bdo id='SIvYX'></bdo><ul id='SIvYX'></ul>
    1. <legend id='SIvYX'><style id='SIvYX'><dir id='SIvYX'><q id='SIvYX'></q></dir></style></legend>

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

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

        SQL Server - 将数据库列从 varchar 更新为 nvarchar(如果还不是 nvarchar)的脚本

        SQL Server - script to update database columns from varchar to nvarchar if not already nvarchar(SQL Server - 将数据库列从 varchar 更新为 nvarchar(如果还不是 nvarchar)的脚本)
        <tfoot id='Ned6V'></tfoot>
            <tbody id='Ned6V'></tbody>
        1. <i id='Ned6V'><tr id='Ned6V'><dt id='Ned6V'><q id='Ned6V'><span id='Ned6V'><b id='Ned6V'><form id='Ned6V'><ins id='Ned6V'></ins><ul id='Ned6V'></ul><sub id='Ned6V'></sub></form><legend id='Ned6V'></legend><bdo id='Ned6V'><pre id='Ned6V'><center id='Ned6V'></center></pre></bdo></b><th id='Ned6V'></th></span></q></dt></tr></i><div id='Ned6V'><tfoot id='Ned6V'></tfoot><dl id='Ned6V'><fieldset id='Ned6V'></fieldset></dl></div>

              • <bdo id='Ned6V'></bdo><ul id='Ned6V'></ul>

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

                • <legend id='Ned6V'><style id='Ned6V'><dir id='Ned6V'><q id='Ned6V'></q></dir></style></legend>
                • 本文介绍了SQL Server - 将数据库列从 varchar 更新为 nvarchar(如果还不是 nvarchar)的脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我必须使用脚本将现有数据库结构从 varchar 更新为 nvarchar.由于每次运行配置应用程序时都会运行此脚本,因此我宁愿确定列是否已更改为 nvarchar,而不是对表执行更改.我必须支持的数据库是 SQL Server 2000、2005 和 2008.

                  I am in a situation where I must update an existing database structure from varchar to nvarchar using a script. Since this script is run everytime a configuration application is run, I would rather determine if a column has already been changed to nvarchar and not perform an alter on the table. The databases which I must support are SQL Server 2000, 2005 and 2008.

                  推荐答案

                  以下查询应该可以满足您的需求:

                  The following query should get you what you need:

                  IF EXISTS 
                    (SELECT *
                     FROM sysobjects syo
                     JOIN syscolumns syc ON
                       syc.id = syo.id
                     JOIN systypes syt ON
                       syt.xtype = syc.xtype
                     WHERE 
                       syt.name = 'nvarchar' AND
                       syo.name = 'MY TABLE NAME' AND
                       syc.name = 'MY COLUMN NAME')
                  BEGIN
                     ALTER ...
                  END
                  

                  这篇关于SQL Server - 将数据库列从 varchar 更新为 nvarchar(如果还不是 nvarchar)的脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Python Pandas write to sql with NaN values(Python Pandas 使用 NaN 值写入 sql)
                  MySQL Insert amp; Joins(MySQL 插入 amp;加入)
                  MySQL concat() to create column names to be used in a query?(MySQL concat() 创建要在查询中使用的列名?)
                  NodeJS responded MySQL timezone is different when I fetch directly from MySQL(当我直接从 MySQL 获取时,NodeJS 响应 MySQL 时区不同)
                  WHERE datetime older than some time (eg. 15 minutes)(WHERE 日期时间早于某个时间(例如 15 分钟))
                  How to get a list of months between two dates in mysql(如何在mysql中获取两个日期之间的月份列表)

                            <tbody id='sWy6Z'></tbody>

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

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

                          • <bdo id='sWy6Z'></bdo><ul id='sWy6Z'></ul>

                            <legend id='sWy6Z'><style id='sWy6Z'><dir id='sWy6Z'><q id='sWy6Z'></q></dir></style></legend>
                          • <tfoot id='sWy6Z'></tfoot>