sql常用语句
use myoa
select * from
delete from department where departmentid=1
insert Department(DepartmentId,DepartmentName) values(1,'技术部')
update Department set departmentname='信息技术部' where departmentid=1
--删除表
drop table department
--删除数据库
drop database bai
--统计数据库表中记录
select count(*) as 数据库记录 from Department
相关文档:
通过Sql语句获得 列的类型和说明:
得到的表头:表名|列名|类型|说明
1:针对sql server 2000,在sql2000中,使用:sysobjects,syscolumns和sysproperties表
SELECT o.name as table_name,c.name AS col_name,type_name(c.xtype) AS type_name,isnull(p.value,'') AS col_Pro ......
SQL 注入攻击原理及防护
在确认可以注入的情况下,使用下面的语句:
HTTP://www.163.com/news.asp?id=xx ;and (select count(*) from sysobjects)>0
HTTP://www.163.com/news.asp?id=xx ;and (select count(*) from msysobjects)>0
如果数据库是SQLServer,那么第一个网址的页面与原页面HTTP://www.163.com/news.asp? ......
Microsoft SQL Server2005技术内幕:T-SQL程序设计
http://www.amazon.cn/mn/detailApp/ref=sr_1_25?_encoding=UTF8&s=books&qid=1261538877&asin=B0011C2568&sr=8-25
Microsoft SQL Server 2005技术内幕:查询、调整和优化
http://www.amazon.cn/mn/detailApp/ref=sr_1_4?_encoding=UTF8&s=books&am ......
--日期转换参数,值得收藏
select CONVERT(varchar, getdate(), 120 )2004-09-12 11:06:08
select replace(replace(replace(CONVERT(varchar, getdate(), 120 ),'-',''),' ',''),':','')20040912110608
select CONVERT(varchar(12) , getdate(), 111 )2004/09/12
select CONVERT(varchar(12) , getdate(), 112 )20040912 ......
PowerBuilder是目前最流行的数据库开发工具之一。PowerBuilder提供了在程序代码中加入嵌入式SQL语句的功能来支持对数据库的访问。但这种嵌入式SQL语句只能支持一些固定的标准的SQL语句,即在进行程序代码编译处理时这些SQL语句必须是确定的,例如:对哪张表哪几个字段进行操作在程序代码中是固定写明的,另外这种方式也不能 ......