- 1、本文档共10页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
Sql server 2008 的基础常识总结(国外英语资料)
Sql server 2008 的基础知识总结
Sql server 2008 basics summary
Finished by sina weibo@marmatt
SQL statements add columns, modify column types, modify columns, and delete columns.
The change statement for the database SQL language can be used to modify the base table, which is typically formatted as:
ALTER TABLE TABLE name [changing mode]
Change the way:
? ADD a column: ADD column 1 column 1
Delete a column: DROP column 1
? CHANGE the name of the column: CHANGE, new column name, new column name.
Change the column name: MODIFY column 1 new data type
As you can see, modifying the base table provides the following four changes:
(1) the ADD:
To add new columns and integrity constraints, the columns are defined in the same way as the columns in the CREARE TABLE statement, whose syntax format:
ALTER TABLE TABLE name ADD column definition | integrity constraint . Because the new column added in this method automatically fills NULL values, you cannot specify NOT NULL constraints for the new columns that are added.
(2) the DROP:
To delete the specified integrity constraint, or the specified column, whose syntax is:
ALTER TABLE TABLE name DROP []
ALTER TABLE TABLE name DROP COLUMN COLUMN name
Note: some database systems do not allow this to delete columns in the database table (DROP COLUMN COLUMN name ).
(3) CHANGE the way
Used to modify certain columns in their syntax format:
ALTER TABLE [TABLE name] CHANGE TO new column name new column data type - is wrong
The EXECUTE sp_rename N dbo. Student table. Name, N name, COLUMN - correct
(4) the MODIFY way
For modifying the data types of certain columns, the syntax format:
ALTER TABLE [TABLE name] [column name] [data type]
Note: all MSSQL systems have their own functions
(1) date and time type
-datatime accuracy is three hundredths of a second
The alter table student table
Add creation time datetime default getdate ()
Insert into student form (student class, student name, student age, teacher number) values ( class , 7,
您可能关注的文档
- chcon敕令详解(国外英语资料).doc
- Chinasec平台装置卸载教程(国外英语资料).doc
- cin,cout用法详解(国外英语资料).doc
- Cisco VoIP设备中translation-rule敕令的用法(国外英语资料).doc
- CMM可重复级在非凡软件项目中的应用(国外英语资料).doc
- c++对txt文件的读取与写入源代码(国外英语资料).doc
- Colors 教授教化案例剖析(国外英语资料).doc
- CORELDRAW课程教授教化纲目(国外英语资料).doc
- company用法说明(国外英语资料).doc
- countif函数查寻反双数据内容并标出色彩的方法(国外英语资料).doc
最近下载
- 数字电子技术说课精品课件.ppt VIP
- 二年级《小学低段如何进行整本书的阅读教学》.docx
- 人工智能对职业生涯发展的启示.pptx VIP
- 2019年湖北省武汉市中考作文解读和范文.doc
- 编排比赛秩序及编印秩序册.ppt
- 人美版九年级美术上册 6.《黑白装饰画》 教学设计.docx
- 学堂在线《临床中成药应用》作业单元考核答案.docx
- 第11章 比亚迪精诚钣喷快修体系(A0版).pdf
- Unit 5 Do you want to watch a game show?Section B 3a-Self Check 课件 人教版八年级英语上册 (共33张PPT).pptx VIP
- 城市绿化养护一体化建设运营方案.docx
文档评论(0)