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

SQL Server JDBC Deriver Problems

If the SQL data type is 'timestamp', we need to use ResultSet.getBytes() to retrieve its value. If the SQL data type is 'datetime', we can use ResultSet.getTimestamp(). It is said timestamp is interanlly saved as binary data.
  try {
     Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
     Connection conn = DriverManager.getConnection
            ("jdbc:sqlserver://<url_address>;user=<user>;password=<password>;database=<database>");
     Statement statement = conn.createStatement
            (ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
     ResultSet rs = statement.executeQuery("...");
     while (rs.next()) {
         System.out.println(rs.getTimestamp(1));
      }
  } catch (Exception e) {
      e.printStackTrace();
  }


相关文档:

sql 2008 对远程数据库的操作

1:exec sp_addlinkedserver   'ITSV ', ' ', 'SQLOLEDB ', '192.168.*.12'
     exec sp_addlinkedsrvlogin 'ITSV ', 'false ',null, 'sa ', 'F00000'
2:
EXEC sp_configure 'show advanced options', 1
GO
RECONFIGURE
GO
EXEC sp_configure 'Ad Hoc Distributed Queries', ......

SQL Server 索引结构及其使用(四)

SQL Server 索引结构及其使用(四)
作者:freedk
一、深入浅出理解索引结构
二、改善SQL语句
三、实现小数据量和海量数据的通用分页显示存储过程
聚集索引的重要性和如何选择聚集索引
  在上一节的标题中,笔者写的是:实现小数据量和海量数据的通用分页显示存储过程。这是因为在将本存储过程应用于“办 ......

sql server创建表

use test
go
if exists table student is not null
else
drop table student
go
create table  database_name.schema_name.table_name
(属性1  字符类型  约束,
属性2  字符类型  约束....
)
go
insert into table_name values ('属性1’,‘属性2’,......)
--插 ......

如何找到sql server数据库中的死锁?


检测死锁
如果发生死锁了,我们怎么去检测具体发生死锁的是哪条SQL语句或存储过程?
这时我们可以使用以下存储过程来检测,就可以查出引起死锁的进程和SQL语句。SQL Server自带的系统存储过程sp_who和sp_lock也可以用来查找阻塞和死锁, 但没有这里介绍的方法好用。
use master
go
create procedure s ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号