设置主键:ALTER TABLE [tablename] ADD PRIMARY KEY ([fieldname])<br><br>"
echo "
查询:select * from tablename where fieldname *** order by id desc<br><br>"
echo "更新:update tanlename set fieldname = values,cn_name=''values'' where ID = 1<br><br>"
echo "添加:insert into tanlename (fieldnam,fieldnam2)values (1,''values'')<br><br>"
echo "删除:delete from tanlename where fieldname = values<br><br>"
echo "删除表:DROP TABLE 数据表名称<br><br>"
echo "添加字段:ALTER TABLE [表名] ADD [字段名] NVARCHAR (50) NULL<br><br>"
echo "删除字段:alter table [tablename] drop [fieldname]<br><br>"
echo "修改字段:ALTER TABLE [表名] ALTER COLUMN [字段名] 类型(大小) NULL<br><br>"
echo "新建约束:ALTER TABLE [表名] ADD CONSTRAINT 约束名 CHECK ([约束字段] <= ''2000-1-1'')<br><br>"
echo "删除约束:ALTER TABLE [表名] DROP CONSTRAINT 约束名<br><br>"
echo "新建默认值:ALTER TABLE [表名] ADD CONSTRAINT 默认值名 DEFAULT ''51WINDOWS.NET'' FOR [字段名]<br><br>"
echo "删除默认值:ALTER TABLE [表名] DROP CONSTRAINT 默认值名<br><br>"
end sub
%>
<!--
程序界面主表格开始-->
<table width="100%" height="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td width="18%" valign="top">
<div id="Layer1" style="overflow-x:auto;overflow-y:auto; width:100%;height:100%;">
<div style="width:140px;height:0px;overflow:hidden;"></div>
表: <a href="?">主界面</a> <a href="?key=exit">退出</a> <a href="?key=help">Help</a><br>
<%
set objSchema = Conn.OpenSchema(adSchemaTables)
Do While Not objSchema.EOF
if objSchema("TABLE_TYPE") = "TABLE" then
''输出表名
echo "<a href=''?key=view&table_name="& objSchema("TABLE_NAME") &"''>" & objSchema("TABLE_NAME") & "</a><br>"
end if
objSchema.MoveNext
Loop
echo "所有视图:<br>"
objSchema.MoveFirst
Do While Not objSchema.EOF
if objSchema("TABLE_TYPE") = "VIEW" then
''输出表名
echo "<a href=''?key=sql&sql=SELECT * FROM [" & objSchema("TABLE_NAME")& "]''>" & objSchema("TABLE_NAME") & "</a><br>"
end if
objSchema.MoveNext
Loop
objSchema.Close
set objSchema = nothing
''echo "存储过程:<br>"
''set objSchema = Conn.OpenSchema(adSchemaProcedures)
''Do While Not objSchema.EOF
'' echo "<a href=''?key=proc&table_name="& objSchema("PROCEDURE_NAME") &"''>" & objSchema("PROCEDURE_NAME") & "</a><br>"
''objSchema.MoveNext
''Loop
''objSchema.Close
''set objSchema = nothing
%>
</div>
</td>
<td width="82%" valign="top">
<div id="Layer2" style="overflow-x:anto;overflow-y:auto; width:100%;height:100%;">
<%
select case request("key")
case "" ''显示主界面
call main("")
case "addtable" ''显示创建表界面
call add_