Connect to MS SQL Server

2010-04-19  来源:本站原创  分类:OS  人气:267 

Freetds is used to connect MS SQL Server in linux. And freetds depends on UnixODBC. In fedora, execute

yum -y freetds, freetds-devel

and freetds, unixodbc and freetds-devel will be installed. freetds-devel provides the driver.

Then, configure freetds: (The configuration file is / etc / freetds.conf)

[MSServer]
        host=172.29.128.204

        port=1433
        tds version=7.0

Configure unixodbc

  1. / Etc / odbcinst.ini
    [MSSQLServer
    ]
    Description=TDS Driver
    Driver=/usr/lib/libtdsodbc.so
    Setup=/usr/lib/libtdsodbc.so
    Trace=Yes
    TraceFile=/tmp/freetds.log
    FileUsage=1
    
  2. / Etc / odbc.ini
    [MSSQLServer]
    Driver = MSSQLServer
    
    Description = MS SQL Server Data Source
    Trace = Yes
    TraceFile = /tmp/mstext.log
    Servername = 172.29.128.204
    
    Database = durango_60
    Port = 1433
    

    Notice that Driver refers to odbcinst.ini and Servername is defined in freetds.conf.

At last, we can test by executing following commands:

isql MSSQLServer user password

Driver may be in different directory in different version. Make sure the path in the configuration file is valid.

相关文章
  • Connect to MS SQL Server 2010-04-19

    Freetds is used to connect MS SQL Server in linux. And freetds depends on UnixODBC. In fedora, execute yum -y freetds, freetds-devel and freetds, unixodbc and freetds-devel will be installed. freetds-devel provides the driver. Then, configure freetds

  • MS SQL Server Query Optimization 2010-06-09

    MS SQL Server Query Optimization Study: xmllover 2007-11-29 Query slow for many reasons, as several common 1, no index or index is not used (this is the most common problems slow query is programming defects) 2, I / O throughput is small, the formati

  • The Oracle database into MS SQL Server database 2011-01-13

    Described in this document is to convert the Oracle database, MS SQL Server database. Environment: Oracle 11g database, SQL Server 2005 database, WINDOWS xp operating system. Have: Oracle database, the database name is test. Preparation: 1, in the ne

  • 在linux下连接MS SQL Server 2013-11-04

    在工作中需要在Linux服务器上访问MS SQL Server数据库,我马上就想到了适用ODBC接口进行实现,毕竟它的移植性更好. 首先需要选一种支持MS SQL Server的ODBC驱动,商业的不能考虑,只能考虑开源的,于是,FreeTDS进入了视野,从官网(http://www.freetds.org/)上下载了它的0.91版本的包,在安装它之前需要安装libiconv,这个库用于进行编码转换. 开始安装! 1,从unixODBC官网(www.unixodbc.org)下载2.3.2版本

  • ibatis in the growth of the primary key automatically (Oracle, Ms sql server, mysql) 2008-07-30

    iBatis configuration file selectKey of sqlMap element has a type attribute, you can specify pre or post, said the former generation (pre), or generated after (post). Oracle Set <!-- Oracle SEQUENCE --> <insert parameterClass="com.domain.Prod

  • hibernate user 'xxxx' Login failed. the user to connect with trusted SQL SERVER unrelated 2010-03-19

    Doing hibernate connection data sqlserver 2005, when a mistake. The first is the pop-up Exception in thread "main" org.hibernate.exception.SQLGrammarException: Cannot open connection Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Us

  • Oracle \ MS SQL Server database table associated with multiple and multi-table update update UPDATE 2010-04-06

    http://hi.baidu.com/suofang/blog/item/249c067b40c8def00ad187aa.html An Update update statement is more than one table can not be updated, unless the trigger implicit update. And table update operation, in many cases need to be updated in the referenc

  • [Change] SQL2005] install Ms SQL Server 2005 Developer Edition when performance counters require the installation of the wrong solution 2010-04-14

    View article [SQL2005] install Ms SQL Server 2005 Developer Edition when performance counters require the installation of the wrong solutions to August 30, 2007 at 12:23 Now, Microsoft Sql Server 2005 introduced the Simplified Chinese version, but we

  • iBatis automatically generated primary key (Oracle, MS Sql Server, MySQL) 2010-05-08

    <> Headhunter jobs: <script type="text/javascript"> </ script> Anhui: Hefei, Hangzhou, Suzhou: java architect Jobs Related articles: iBATIS automatically generated primary key IBatis simple implementation (with primary key auto

  • iBatis auto-generated primary key (Oracle, MS Sql Server, MySQL) 2010-11-20

    The sqlMap iBatis configuration file selectKey element has a type attribute, you can specify that the former pre or post generation (pre) was generated after (post). Oracle Set <insert parameterClass="com.domain.Product"> <selectKey res

  • Collected: how to call stored procedure with return values, there are parameters, stored procedure calls the stored procedure. (MS SQL Server) 2011-07-13

    Collected: how to call stored procedure with return values, there are parameters, stored procedure calls the stored procedure. (MS SQL Server) Preserved to facilitate learning and also share with Stored procedures and output return difference thing i

  • MS SQL Server datetime format in CONVERT Daquan 2011-03-03

    From the original: http://www.cnblogs.com/fernando/archive/2008/04/29/1176581.html MS SQL Server datetime format in CONVERT Daquan CONVERT To a data type explicitly convert an expression to another data type. As the demand for frequently used to take

  • MS SQL Server游标(CURSOR)的学习使用 2014-01-09

    使用MS SQL Server这样久,游标一直没有使用过.以前都是使用WHILE循环加临时表来实现.刚刚联系个示例了解到游标概念与语法 说实的,使用MS SQL Server这样久,游标一直没有使用过.以前实现相似的功能,都是使用WHILE循环加临时表来实现.刚才有参考网上示例练习写了一下.了解到游标概念与语法. 下面代码示例中, 先是宣告你在游标中需使用变量,也就是临时存储处理字段的数据. 2. 宣告一个游标,并SELECT需要处理的数据集. 3. 打开游标(#8行代码). 4. 从游标中拿来

  • JSP连接MySql/MS SQL Server/Oracle数据库连接方法[整理] 2014-02-24

    这个经常整理更新 JSP连接MySql数据库方法 首先先将MySql的数据库连接驱动拷贝到Tomcat/common/lib包下 下载mysql-connector-java-5.1.6.zip http://mysql.cs.pu.edu.tw/Downloads/Connector-J/mysql-connector-java-5.1.6.zip 配置Tomcat的虚拟目录-略 创建jdbcMySql.jsp页面 页面代码如下: <%@ page contentType="text/h

  • 重装MS SQL Server 2000前必须彻底删除原安装文件的方法 2014-03-16

    重装MS SQL Server 2000一般需要彻底删除原安装文件,以前总是无法重新安装,默认被占了,现在网上看到了特 用如下方法对付安装挂起问题: 1.在开始->运行中输入regedit 2.到HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager 位置 3.选择文件->导出,保存(安全起见) 4.在右边窗口右击PendingFileRenameOperations,选择删除,然后确认

  • MS SQL Server2014链接到MS SQL Server 2000的解决方案及问题处理 2015-01-20

    在大数据中,我们经常需要用到分布式数据,那么在SqlServer中,我们如何来实现呢,答案就是创建链接服务器!同版本的SqlServer之间的操作网上有很多,今天我们来探讨下不同版本SqlServer之间的链接问题. 开发与企业应用中,好几个版本SQL Server相互链接.分布式读取与存储,需要实现sp_addlinkedserver.SQL Server 2000, SQL Server 2008, SQL Server 2012和SQL Server 2014: 但今天在本机的MS SQL

  • ms sql server中实现的unix时间戳函数(含生成和格式化,可以和mysql兼容) 2015-04-10

    这篇文章主要介绍了ms sql server中实现的unix时间戳函数,含生成和格式化UNIX_TIMESTAMP.from_unixtime两个函数,可以和mysql兼容,需要的朋友可以参考下 直接上代码: CREATE FUNCTION UNIX_TIMESTAMP (@ctimestamp datetime) RETURNS integer AS BEGIN /* Function body */ declare @return integer SELECT @return = DATED

  • MS SQL Server的一点学习记录 2014-05-09

    这段时间在设计一个vulnerability数据库, 现在基本成型了, 回头看看, 如果能重来一次, 我想我应该可以设计的更好. 记录一点过程中的心得. 1. 清空一张表用truncate替代delete, 效率会更高; 2. 四张表以上的联合查询要尽量避免出现, 在10w级别的四张表join操作上, 性能下降的已经非常明显; 大规模的联合查询除了在一些查询比较多的字段上建索引, 还应该考虑数据冗余以保障查询效率, 数据冗余的做法有很多种, 我比较喜欢用触发器的方式, 干净利落, 还有trans

  • Install MS SQL Server 2012 Step by Step 2013-11-23

    To install MS SQL Server successfully, 1. Make sure the disk storage is big enough. 2. Make sure the network is connected. Now Let's go. Choose The Specify a free edition option if you don't pay for it like me; [Evaluation has the largest set of SQL

  • Ms Sql SErver 2000 and 2005 data transconductance 2010-08-20

    Because the database attached to 2005, when the database file has been automatically upgraded to 2005, so in 2000, is no longer under the additional (not upward-compatible) direct restore or attach does not work, use the script + guide data certainly