忙了好一阵子了 才记起来我的博客园
时间:2011-03-24 来源:周晗
SQL Server 数据库表的基本建设:
USE [master]
GO
IF NOT EXISTS(SELECT NAME FROM sys.databases where name='vovlodb')
/**创建数据库**/
begin
create database vovlodb on primary(
name=N'vovlodb_data',FILENAME=N'E:\company\计算器\SQL\vovlodb_data.mdf',size=3072,MAXSIZE=UNLIMITED,FILEGROWTH=1024KB)
LOG ON (
NAME=N'vovlodb_log',FILENAME=N'E:\company\计算器\SQL\vovlodb_data.ldf',SIZE=1024,MAXSIZE=2048,FILEGROWTH=10%
)
end
use vovlodb
Go
/**创建表***/
IF NOT EXISTS(SELECT NAME FROM sys.objects where object_id=object_id(N'[dbo].[crm_authority]') AND TYPE IN (N'U'))
begin
create table crm_authority (
authority_id int ,
user_id varchar (96),
customer_id int ,
update_date datetime ,
update_user varchar (96)
)
end