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

在SQL中向多个数据库中插入相同的记录

今天一个朋友问到这个问题,其实很好解决:
declare   @dbname   varchar(50)  
  declare   c_database   cursor   for  
      select   name   from   master.dbo.sysdatabases   where   name   like   '%数据库名%'  
  open   c_database  
  fetch   next   from   c_database   into   @dbname  
  while   @@fetch_status=0  
  begin  
      exec('use   '+@dbname  
            +'   insert   into   表名(字段)   values(''内容'')')  
      fetch   next   from   c_database   into   @dbname  
  end  
  close   c_database  
  deallocate   c_database
go


相关文档:

在SQL SERVER中实现RSA加密算法(第二版)

/***************************************************  
        作者:herowang(让你望见影子的墙)
    日期:2010.1.5
          注:    转载请保留此信息
     ......

SQL链接数据库

Standard   Security:  
   
  "Data   Source=Aron1;Initial  
Catalog=pubs;User   Id=sa;Password=asdasd;"    
        -   or   -  
 
"Server=Aron1;Database=pubs;User  
ID=sa;Pass ......

SQL Server DBA 的工作清单

有许多不同类型的数据库管理员。 一些类型的数据库管理员致力于于开发领域,而其他的一部分更重视数据库性能的调整以及仍然有一部分数据库管理员则致力于管理SQL Server的业务。 依据数据库管理员的工作环境不同,他们将执行一定数量的不同的任务。为了区分所有不同的任务,数据库管理员可能要执行我清单上所列的任务。
  ......

在SQL语句中截取字符串函数的应用


问题一 
有这样的一个问题,数据库中有两个表,分别是Guest,Hotel,即旅客信息表和旅馆信息表,Guest表中有一个旅客编码的字段,这个字段的有20位,它的前10位代表这个旅客所住的旅馆,现在的问题是要根据Guest表中的旅客编码字段信息查到他所住的旅馆的名称和旅馆地址!
问题解决:
SQL SERVER的SQL语句:select ......

SQL learning

Five basic search conditions are summarized here:
1) Comparison test
2) Range test
3) Set membership test
4) Pattern matching test (Like)
     The pattern matching test checks to see whether the data value in a column matches a specified pattern
   % mathes any se ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号