楼主: zespri
2948 8

请教关于远程连接SQL [推广有奖]

  • 0关注
  • 1粉丝

VIP

已卖:1278份资源

讲师

50%

还不是VIP/贵宾

-

威望
0
论坛币
3869 个
通用积分
272.6608
学术水平
7 点
热心指数
9 点
信用等级
8 点
经验
35949 点
帖子
374
精华
0
在线时间
616 小时
注册时间
2006-5-16
最后登录
2025-5-7

楼主
zespri 发表于 2009-7-10 09:10:40 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
我想用SAS读取远程SQL Server中的一个表, 用9.0中的Assist, 连不上,可能设置不对.
我把这表下到本地SQL server, 用Assist 就可以读取.

有没有直接用语法直接连接的,
比如我想连接SQL server 2005,
IP: 123.45.67.89
username: abcd
password: efg
database: aaa
table:bbb$

(还有就是, table名bbb$必须在SQL中改名才能读, 有没有办法直接读, 因为我不能改远程数据库,只能使用)

先谢谢了.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:sql password database Server ASSIST 请教 sql

回帖推荐

邓贵大 发表于4楼  查看完整内容

3# zespri 漏了OLEDB

本帖被以下文库推荐

沙发
邓贵大 发表于 2009-7-10 09:33:35
  1. options validvarname=any;
  2. libname mssql init_string="Provider=SQLOLEDB.1; Password=efg; Persist Security Info=True; User ID=abcd;Data Source=123.45.67.89; Initial Catalog=aaa";
  3. proc contents data=mssql.'bbbn;
  4. run;
复制代码
Be still, my soul: the hour is hastening on
When we shall be forever with the Lord.
When disappointment, grief and fear are gone,
Sorrow forgot, love's purest joys restored.

藤椅
zespri 发表于 2009-7-10 10:02:59
2# 邓贵大

谢谢答复, 不过产生如下error, 能看一下吗?

options validvarname=any;
WARNING: Only Base procedures and SAS/STAT procedures have been tested for use with
VALIDVARNAME=ANY. Other use of this option is considered experimental and may cause
undetected errors.





ERROR: Libname MSSQL is not assigned.
ERROR: Error in the LIBNAME statement.

板凳
邓贵大 发表于 2009-7-10 10:12:49
3# zespri 漏了OLEDB
  1. options validvarname=any;
  2. libname mssql OLEDB init_string="Provider=SQLOLEDB.1; Password=efg; Persist Security Info=True; User ID=abcd;Data Source=123.45.67.89; Initial Catalog=aaa";
  3. proc contents data=mssql.'bbbn;
  4. run;
复制代码
已有 1 人评分经验 论坛币 收起 理由
bakoll + 3 + 3 精彩帖子

总评分: 经验 + 3  论坛币 + 3   查看全部评分

Be still, my soul: the hour is hastening on
When we shall be forever with the Lord.
When disappointment, grief and fear are gone,
Sorrow forgot, love's purest joys restored.

报纸
zespri 发表于 2009-7-10 10:31:45

4# 邓贵大

能不能麻烦再看一下, 我检查了IP, userid, password, 数据库名, 都没错. 谢谢

WARNING: Only Base procedures and SAS/STAT procedures have been tested for use with
VALIDVARNAME=ANY. Other use of this option is considered experimental and may cause
undetected errors.


ERROR: Error trying to establish connection: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server
does not exist or access denied.
ERROR: Error in the LIBNAME statement.

地板
邓贵大 发表于 2009-7-10 11:10:30
你得确定你的SQL Server服务器开放TCP/IP连接在端口1433
还有其他种种可能
http://support.microsoft.com/kb/328306
http://support.microsoft.com/kb/888228
Be still, my soul: the hour is hastening on
When we shall be forever with the Lord.
When disappointment, grief and fear are gone,
Sorrow forgot, love's purest joys restored.

7
zespri 发表于 2009-7-10 12:05:12
6# 邓贵大

我解决不了, 不过还是非常感谢你.
以后还要再试.

8
sushe1527 发表于 2009-7-10 13:13:03
邓贵大的头像太返古了,每次我看到就好像穿越到清朝一样

9
platypus 发表于 2012-11-23 13:23:34
先学习了,马上要用到远程连接
机会稍纵即逝,且只给有准备的人。

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-25 20:20