CSDN博客

img kingapex1

asp 中 创建表的的一段代码

发表于2004/10/7 13:46:00  1478人阅读

<!--#include file="../Inc/Function.asp"-->

<%
OpenDBConn
sql = "select * from dbo.sysobjects where id = object_id(N'[dbo].[TuiGuang]') and OBJECTPROPERTY(id, N'IsUserTable') = 1"
createRs
rs.open sql,conn,1,1


if rs.eof or rs.bof then

'创建TuiGuang(网站推广表)
sql ="create table [dbo].[TuiGuang]("&_
"[id][int] identity (1,1) not null,"&_                       'id标识
"[TName][varchar](100) collate chinese_prc_ci_as null,"&_    '名称
"[Content][ntext] collate chinese_prc_ci_as null,"&_         '产品描述
"[pic][varchar](100) collate chinese_prc_ci_as null,"&_      '图片
"[price][int] null,"&_                                       '价格
"constraint [pk_TuiGuang] primary key clustered("&_
"[id]"&_
")on [primary]"&_
")on [primary]"&_
rs.close

conn.execute(sql)

response.write "创建TuiGuang表成功<br>"

else
response.write "已存在"
rs.close
end if

Set rs = Nothing
CloseDBConn
%>

阅读全文
0 0

相关文章推荐

img
取 消
img