易截截图软件、单文件、免安装、纯绿色、仅160KB

SQL插入例题

--创建表TongXunLu
CREATE TABLE TongXunLu
 (
 [tName] nvarchar(30),
 [tAddress] nvarchar(50),
 [tEmail] varchar(50)
 )
--创建表 students
CREATE TABLE students
 (
 [sId] int IDENTITY (1, 1) primary key NOT NULL ,
 [sName] varchar (50)   NOT NULL ,
 [sAddress] varchar (50) default 'daxing'   ,
 [sEmail] varchar (50) check([sEmail] like '%@%')   ,
 [sSex] bit NOT NULL
 )
insert into students (sname,saddress,semail,ssex) values ('张果老',default,'a@a',1)
insert into [students] (sname,saddress,semail,ssex) values ('李寻欢',null,'b@b',1)
insert into [students] (sname,saddress,semail,ssex) values ('令狐冲',default,'c@c',1)
insert into [students] (sname,saddress,semail,ssex) values ('程灵素',null,'d@f',0)
insert into [students] (sname,saddress,semail,ssex) values ('笑哈哈','beijing','e@e',0)
insert into [students] (sname,saddress,semail,ssex) values ('乐呵呵','neimenggu','f@f',1)
insert into [students] (sname,saddress,semail,ssex) values ('AAAAA',default,'a@a',1)
insert into [students] (sname,saddress,semail,ssex) values ('BBBBB',null,'b@b',1)
insert into [students] (sname,saddress,semail,ssex) values ('CCCCC',default,'c@c',1)
insert into [students] (sname,saddress,semail,ssex) values ('DDDDDD',null,'d@f',0)
insert into [students] (sname,saddress,semail,ssex) values ('EEEEE','beijing','e@e',0)
insert into [students] (sname,saddress,semail,ssex) values ('FFFFF','neimenggu','f@f',1)
insert into [students] (sname,saddress,semail,ssex) values ('GGGGGG',default,'a@a',1)
insert into [students] (sname,saddress,semail,ssex) values ('HHHHHH',null,'b@b',1)
insert into [students] (sname,saddress,semail,ssex) values ('IIIIII',default,'c@c',1)
insert into [students] (sname,saddress,semail,ssex) values ('JJJJJ',null,'d@f',0)
insert into [students] (sname,saddress,semail,ssex) values ('KKKKK','beijing','e@e',0)
insert into [students] (sname,saddress,semail,ssex) valu


相关文档:

hibernate 多条件组合查询 之 sql 拼接

  public static void main(String[] args) {
      
       Session session = null;
       Transaction tx = null;
       List list = null;
     &nb ......

sql server中将自增长列归零

一个项目完成后数据库中会有很多无用的测试数据,可以使用delete * 将数据全部删除,但自增长列(一般是主键)基数不会归零,使用TRUNCATE函数可以将表中数据全部删除,并且将自增长列基数归零。一定要注意,表中的数据全部删除了。它的语法如下:
TRUNCATE TABLE tableName –其中tableName中所要操作的数据
......

最简单的最高效的过滤SQL脚本防注入

.errInfo
{
    border:solid 1px #d00;
    background:#F7F0F7;
}
1.URL地址防注入:
//过滤URL非法SQL字符
var sUrl=location.search.toLowerCase();
var sQuery=sUrl.substring(sUrl.indexOf("=")+1);
re=/select|update|delete|truncate|join|union|exec|insert|drop|count|&r ......

Sql函数大全

---返回表达式中指定字符的开始位置
select charindex('c','abcdefg',1)
---两个字符的值之差
select difference('bet','bit')
---字符最左侧指定数目
select left('abcdef',3)
---返回字符数
select len('abcdefg')
--转换为小字符
select lower('ABCDEFG')
--去左空格后
select ltrim('   &nbs ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号