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

Excel导入SQL SERVER中

--Excel导入SQL SERVER中
--表结构不存在可以使用
--启用Ad Hoc Distributed Queries:
exec sp_configure 'show advanced options',1
reconfigure
exec sp_configure 'Ad Hoc Distributed Queries',1
reconfigure
select * into serv_user_bak1 from
OpenRowSet('microsoft.jet.oledb.4.0','Excel 8.0;HDR=yes;database=c:\test.xls;','select * from [Sheet1$]')
---使用完成后,关闭Ad Hoc Distributed Queries:
exec sp_configure 'Ad Hoc Distributed Queries',0
reconfigure
exec sp_configure 'show advanced options',0
reconfigure
-----------------------------------------------------------
--表结构存在可以使用
--启用Ad Hoc Distributed Queries:
exec sp_configure 'show advanced options',1
reconfigure
exec sp_configure 'Ad Hoc Distributed Queries',1
reconfigure
insert into serv_user_bak1
SELECT * from
OpenRowSet('microsoft.jet.oledb.4.0','Excel 8.0;HDR=yes;database=c:\test.xls;','select * from [Sheet1$]')
---使用完成后,关闭Ad Hoc Distributed Queries:
exec sp_configure 'Ad Hoc Distributed Queries',0
reconfigure
exec sp_configure 'show advanced options',0
reconfigure


相关文档:

SQL 2000和2005 树形递归法小汇总 收藏

--测试数据
if OBJECT_ID('tb') is not null
drop table tb
go
CREATE TABLE tb(ID char(3),PID char(3),Name nvarchar(10))
INSERT tb SELECT '001',NULL ,'山东省'
UNION ALL SELECT '002','001','烟台市'
UNION ALL SELECT '004','002','招远市'
UNION ALL SELECT '003','001','青岛市'
UNION ALL SELECT '00 ......

SQL*PLUS中函数

创建函数
CREATE OR REPLACE FUNCTION ntfuc(inp IN NUMBER)
RETURN NUMBER
IS
ntmp NUMBER;
BEGIN
ntmp := inp;
RETURN ntmp;
END ntfuc;
/
执行该函数时
DECLARE
rcn NUMBER;
BEGIN
rcn := ntfunc(1);
END;
/ ......

SQL Server查询优化

MS SQL Server查询优化方法
作者:xmllover 2007-11-29 
查询速度慢的原因很多,常见如下几种 
  1、没有索引或者没有用到索引(这是查询慢最常见的问题,是程序设计的缺陷) 
  2、I/O吞吐量小,形成了瓶颈效应。 
  3、没有创建计算列导致查询不优化。 
  4、内存 ......

textarea中的内容通过添加按钮添加到SQL数据库中

我定义了一个 textarea:
  <tr bgcolor="#CCCCCC" align="center" valign="bottom">
            <td align="right" valign="top" class="style1"  >文章内容:</td>
         &nbs ......

sql server选择了混合模式问题

sql server选择了混合模式问题
因为要选择混合模式才能使用sa用户登录的问题
然后企业管理器里面竟然选了以后没有效果 永远都是仅windows模式
无语 不断重启mssql 又选择 混合模式  大约几分钟后竟然可以选择了
zhenTMD 的无奈! ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号