---
title: "自己平时很少用的sql语句"
author: "lms168"
date: "2011-11-20T00:02:31Z"
tags: []
categories: ["数据库"]
slug: "sql"
draft: false
lastmod: "2011-11-25T11:23:44Z"
id: 1267689
url: "https://lms168.iteye.com/blog/1267689"
---

```sql
alter table StudentInfo                                --增加一个字段
add  pwd varchar(20) not null 

alter table StudentInfo                                --删除一个字段
drop column pwd

alter table dbo.User_tbl                               --修改字段属性
alter column score varchar(10)


exec sp_rename StudentInfos,StudentInfo                --修改表名
exec sp_rename 'StudentInfo.pwd','stuPwd','Column'     --修改列名

```