久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

更改 varchar 列的最大長度?

Changing the maximum length of a varchar column?(更改 varchar 列的最大長度?)
本文介紹了更改 varchar 列的最大長度?的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我試圖在不丟失內(nèi)容的情況下將 varchar 列的長度從 255 個(gè)字符更新為 500 個(gè)字符.我之前刪除并重新創(chuàng)建了表,但我從未接觸過 alter 語句,我相信我需要使用它來執(zhí)行此操作.我在這里找到了文檔:ALTER TABLE (Transfact-SQL) 但是我不能讓它正面或反面.

I'm trying to update the length of a varchar column from 255 characters to 500 without losing the contents. I've dropped and re-created tables before but I've never been exposed to the alter statement which is what I believe I need to use to do this. I found the documentation here: ALTER TABLE (Transfact-SQL) however I can't make heads or tails of it.

到目前為止,我有以下內(nèi)容(不幸的是,基本上沒有):

I have the following so far (essentially nothing unfortunately):

alter table [progennet_dev].PROGEN.LE
alter column UR_VALUE_3

我該如何解決這個(gè)問題?是否有關(guān)于此語句的更好的文檔(我搜索了一些示例語句,但結(jié)果為空)?

How do I approach this? Is there better documentation for this statement out there (I did some searches for an example statement but came up empty)?

推薦答案

您需要

ALTER TABLE YourTable ALTER COLUMN YourColumn <<new_datatype>> [NULL | NOT NULL]

但請記住,如果需要,請明確指定 NOT NULL.

But remember to specify NOT NULL explicitly if desired.

ALTER TABLE YourTable ALTER COLUMN YourColumn VARCHAR (500) NOT NULL;

如果你不指定如下...

If you leave it unspecified as below...

ALTER TABLE YourTable ALTER COLUMN YourColumn VARCHAR (500);

然后該列將默認(rèn)允許空值,即使它最初定義為 NOT NULL.即省略 ALTER TABLE ... ALTER COLUMN 中的規(guī)范總是被視為.

Then the column will default to allowing nulls even if it was originally defined as NOT NULL. i.e. omitting the specification in an ALTER TABLE ... ALTER COLUMN is always treated as.

ALTER TABLE YourTable ALTER COLUMN YourColumn VARCHAR (500) NULL;

此行為不同于用于使用 ALTER TABLE(或在 CREATE TABLE 時(shí)間)創(chuàng)建的新列的行為.默認(rèn)的可空性取決于 ANSI_NULL_DFLT設(shè)置.

This behaviour is different from that used for new columns created with ALTER TABLE (or at CREATE TABLE time). There the default nullability depends on the ANSI_NULL_DFLT settings.

這篇關(guān)于更改 varchar 列的最大長度?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

SQL trigger on Truncate(截?cái)鄷r(shí)的 SQL 觸發(fā)器)
sql search query with multiple optional search parameters(具有多個(gè)可選搜索參數(shù)的 sql 搜索查詢)
SQL Efficiency: WHERE IN Subquery vs. JOIN then GROUP(SQL 效率:WHERE IN 子查詢 vs. JOIN 然后 GROUP)
Retrieving XML element name using t-SQL(使用 t-SQL 檢索 XML 元素名稱)
Insert double quotes into SQL output(在 SQL 輸出中插入雙引號)
Delete rows from CTE in SQL SERVER(從 SQL SERVER 中的 CTE 中刪除行)
主站蜘蛛池模板: 午夜精品一区二区三区在线 | 久久男人 | 久久伊人一区 | 精品欧美一区二区三区久久久 | 玩丰满女领导对白露脸hd | 欧美日韩在线一区二区 | 黄视频免费| 91精品国产综合久久婷婷香蕉 | 久久国内 | 欧美一级毛片在线播放 | 日韩视频一区二区三区 | 国产高清精品在线 | 黑色丝袜三级在线播放 | 日韩精品999 | 亚洲激情av | 欧美一区二区三区日韩 | 99精品视频在线观看免费播放 | 五月天天丁香婷婷在线中 | 成人国产精品久久 | 欧美久久久电影 | 91久久精品一区二区二区 | 国产精品久久国产精品 | 伊人色综合久久天天五月婷 | 久久久久久久久久久一区二区 | 91在线免费观看网站 | 羞羞视频网 | 黄色毛片网站在线观看 | 91亚洲精选| 午夜精品91| 久久久久亚洲 | 国产精品成人在线 | 国产精品久久久久久妇女6080 | 亚洲精品自在在线观看 | 日韩中文在线 | 欧美精品1区2区3区 免费黄篇 | 精品日韩一区 | 影音先锋男 | 日韩有码一区 | 久久亚洲精品国产精品紫薇 | 中文字幕av在线播放 | 视频一区二区在线观看 |