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

sql 查询出来一个表在插入到另一个表里

ALTER  FUNCTION  [dbo].[fun_tongji]()
RETURNS  @t1 table (
  yue int ,
  money int
 )
AS
begin
 Declare @i int
 set @i=1
-- declare @t1 table (
--  yue int ,
--  money int
-- )
 while (@i<=12)     
 begin        
  INSERT into @t1 (yue,money) select isnull(sum(money),0) as money,@i as yue from zhangbenjilu where datepart(month,usedatetime)=@i
  set @i=@i+1
 end
 return ;
end


相关文档:

Config SQL Server for JDBC Access

1. In "MicroSoft SQL Server Management Studio", right click SQL Server instance, select "Properties", select "Security" in left panel and check "SQL Server and Windows Authentication mode" in right Panel.
2. In "SQL  Server Configuration Manager", select "SQL Server Network Configuration > ......

SQL之九 数据库设计

外键
======================
外键是相对于主键说的,是建立表之间 的联系的必须的前提。
   比如:学生表 、学生成绩表一一对应是因为 他们都具有相同的字段:学号,把学生表作为主表,学号是他的主键,相对于主表来说,学生成绩的字段 学号就是学生表的外键。
  没有外键,两个表就没办法建立联系啊! ......

SQL 2005 xml 处理的一些sample

USE Test
--Create 2 tables as an example
CREATE TABLE ExampleTable
(
[ID] int PRIMARY KEY
,[Name] nvarchar(256)
)
CREATE TABLE ExampleTable2
(
[ID] int PRIMARY KEY
,[Name] nvarchar(256)
)
----way1
SELECT *
from sys.objects [table]
WHERE
[Name] LIKE 'ExampleTable%'
FOR XML AUTO, ROOT ......

SQL MINUS的用法


< type="text/javascript">
document.body.oncopy = function() {
if (window.clipboardData) {
setTimeout(function() {
var text = clipboardData.getData("text");
......

防范SQL注入式攻击


SQL注入式攻击是利用是指利用设计上的漏洞,在目标服务器上运行Sql命令以及进行其他方式的攻击动态生成Sql命令时没有对用户输入的数据进行
验证是Sql注入攻击得逞的主要原因。
比如:
如果你的查询语句是select * from admin where
username="&user&" and password="&pwd&"&quo ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号