sql 判断数据库是否已存在
if exists(select * from master.dbo.sysdatabases where name = 's2723103005')
begin
drop database s2723103005
print '已删除数据库s2723103005'
end
create database s2723103005
on primary
(name=His_data,
filename = 'd:\database\his_data.mdf',
size=10,
maxsize = 1500,
filegrowth = 5
)
log on
(
name=His_log,
filename='d:\database\his_log.ldf',
size=5,
maxsize=500mb,
filegrowth = 5mb
)
相关文档:
create PROCEDURE pagelist
@tablename nvarchar(50),
@fieldname nvarchar(50)='*',
@pagesize int output,--每页显示记录条数
@currentpage int output,--第几页
@orderid nvarchar(50),--主键排序
@sort int,--排序方式,1表示升序,0表示降序排列
......
系统环境:Windows 7
软件环境:Visual C++ 2008 SP1 +SQL Server 2005
本次目的:编写一个航空管理系统
这是数据库课程设计的成果,虽然成绩不佳,但是作为我用VC++ 以来编写的最大程序还是传到网上,以供参考。用VC++ 做数据库设计并不容易,但也不是不可能。以下是我的程序界面,后面 ......
using System.Data; // Use ADO.NET namespace
using System.Data.SqlClient;
SqlConnection thisConnection = new SqlConnection(
&nbs ......
首先我想谢谢园子的朋友们,是你们提醒我写内容有错误,记得曾经电子商务之数据存储流程(五)里面说到“选存储过程+传递参数用SqlParameter是因为,除非是ADO.NET有漏洞,那么就绝对不会发生SQL注入”。Keep Walking大哥也在关于防止sql注入的几种手段(二)中举出来一个例子说明我说的上句话是错误的。说实话当 ......
declare @tb3 table (商品编号 nvarchar(10),批次号 nvarchar(10),库存数量 int,出库数量 int)
declare @tb1 table (商品编号 nvarchar(10),批次号 nvarchar(10),库存数量 int)
insert into @tb1 select '0001','090801',200
union all select '0001','090501',50
&n ......