易截截图软件、单文件、免安装、纯绿色、仅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 Code表设计

在Asp.net后有很多常用的表结构 membership就是一个典型,除此还有code表
CREATE TABLE [dbo].[CodeTables](
    [CodeTableID] [uniqueidentifier] NOT NULL,
    [ParentCodeTableID] [uniqueidentifier] NULL,
    [Name] [varchar](200) COLLATE SQL_Latin1_General_ ......

sql 语句分类

sql 语句按功能分为3类:数据定义语句,数据操作语句,数据控制语句
一:数据定义语句:
       CREATE TABLE --创建一个数据库表
       DROP TABLE --从数据库中删除表
      ALTER TABLE --修改数据库表结构
  &n ......

sql server创建数据库脚本

use master
go
--切换master数据库
if exists(select 1 from sysdatabases where name = N'test')
--注意该同名数据库是否还要用到
begin
drop database test
end
go
create database test
on
primary
( name = 'testprimary', --主数据文件逻辑名
filename = 'D:\testprimary.mdf',--主数据文件存放路径
......

安装SQL SERVER 2000 后更改服务器名的解决。

今天刚开通这个小博,作为庆祝,把我以前空间中的一篇文章转过来。
希望对
问题:由于安装sql server 2000 sp4以后修改了服务器的名称导致SQL中保留的服务器名不正确。
解决方法:
1.select @@servername
查看返回值是否与现在机器名不一致(如果一致就是别的问题了)
2.exec sp_helpserver
查看应该有NAME与network ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号