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

sql点滴

子表查询,父表一定要加别名,否则数据会有问题,不报编译错
select * from table1 a where exist(select 1 from table2 where a.id=b.id)
存储过程结果集插入到现有表
insert into table1 exec procname args
联合已有表,紧跟在后面,对汇总很有用
select a from table1 union all select '合计'
结果集里的某列相加
declare @var nvarchar(1000)
set @var=''
select @var=@var+','+alarmname from notice where args=@args
print @var
shell命令
declare @cmd nvarchar(1000)
set @cmd='bcp "select cellphone,msg from atm.dbo.sendoutmsg" queryout '+@outfile+' -c -q -t "|"  -U'+@sqluser+' -P'+@sqlpwd +' -S'+@server
EXEC master..xp_cmdshell    @cmd    ,NO_OUTPUT
(
@cmd 可以是:
dir    c:\      c:\dir_out.txt
del   c:\deposit.htm
copy   c:\resource\deposit.htm    c:\
move   c:\倒入0911.xls    d:\倒入0911.xls
)
大容量数据导入(以\r\n为数据行结尾,|为列分割符)
DECLARE @bulk_cmd varchar(1000);
SET @bulk_cmd = 'BULK INSERT dbo.tmpbasedevinfo from ''D:\dev_bmsg.txt''
                             with (FIELDTERMINATOR =''|'',
                                      ROWTERMINATOR = '''+CHAR(10)+''')';
exec(@bulk_cmd);
判断文件是否存在
create table #tb(a bit,b bit,c bit)  
  insert into #tb exec master..xp_fileexist 'c:\furniture.txt'
  if exists(select * from #tb where a=1)
  PRINT 文件存在
  else
  PRINT 文件不存在
drop table #tb


相关文档:

给mysql添加一个管理员的SQL语句

insert into mysql.user
SELECT '%', 'admin', PASSWORD('admin'), Select_priv, Insert_priv, Update_priv,
 Delete_priv, Create_priv, Drop_priv, Reload_priv,
 Shutdown_priv,  Process_priv, File_priv, Grant_priv, References_priv,
 Index_priv, Alter_priv, Show_db_priv, Super_priv, ......

JAVA中防止SQL注入攻击类的源代码

JAVA-字符串过滤类
package cn.com.hbivt.util;
/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2005</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class StringUtils {
/ ......

SQL操作全集

using System;
using System.Threading;
namespace ConsoleApplication1
{
 /// <summary>
 /// Class1 的摘要说明。
 /// </summary>
 class Class1
 {
  /// <summary>
  /// 应用程序的主入口点。
  /// </summary>
  [STAThread]
& ......

JAVA中防止SQL注入攻击类的源代码

package cn.com.hbivt.util;
/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2005</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class StringUtils {
//过滤通过页面表单提交 ......

sql server2005值比较求救各位高手

在sql server2005中怎么进行多值与多值之间的比较?可以比较吗?
例如:
 我要证明1,2,3,4,5(在表中查询出的值)与3,2,6,5(自定义参数)两条数据中有相同的值,并将相同值的列的相应表信息用print打印出来
注意,不能单个比较……
不知道可不可查询出来, 请各位高手帮帮忙…… ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号