免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 3216 | 回复: 12
打印 上一主题 下一主题

求助,数据库属主问题。 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-09-27 08:53 |只看该作者 |倒序浏览
用sa用户建立一个数据库db1,有一个用户user1,如果user1不被赋予sa_role角色,那么在执行sql语句:
select * from dbo.table1时出错,提示:
Select error:The column prefix 'table1' does not match with a table name or alias name used in the query.Either the table is not specified in the FROM clause or it has a correlation name which must be used instead.
现在即想执行上面的sql语句,又不想赋予user1用户sa_role的角色,并且不仅是user1还有user2等其它用户都想执行这条sql语句,请问应该如何做?

论坛徽章:
0
2 [报告]
发表于 2006-09-27 08:54 |只看该作者
用sa用户执行
grant select on table1 to user1
go

论坛徽章:
0
3 [报告]
发表于 2006-09-27 09:16 |只看该作者
楼上的试了,还是不行。

论坛徽章:
4
2015年亚洲杯之阿联酋
日期:2015-03-10 10:32:022015年亚洲杯之阿曼
日期:2015-03-10 14:53:222015亚冠之水原三星
日期:2015-07-18 15:40:262015亚冠之塔什干棉农
日期:2015-07-27 20:52:05
4 [报告]
发表于 2006-09-27 09:53 |只看该作者
select id,name,uid,type from sysobjects where name='table1'
go

论坛徽章:
0
5 [报告]
发表于 2006-09-27 10:18 |只看该作者
1824009529 table1                        1 U   
楼上的,查出来了,有什么用?

论坛徽章:
0
6 [报告]
发表于 2006-09-27 10:25 |只看该作者
sp_helpuser user1

论坛徽章:
0
7 [报告]
发表于 2006-09-27 10:46 |只看该作者
楼上的,查询结果是
Users_name        ID_in_db    Group_name        Login_name        
----------        ----------- ----------        ----------        
user1                       3 group1            user1

论坛徽章:
4
2015年亚洲杯之阿联酋
日期:2015-03-10 10:32:022015年亚洲杯之阿曼
日期:2015-03-10 14:53:222015亚冠之水原三星
日期:2015-07-18 15:40:262015亚冠之塔什干棉农
日期:2015-07-27 20:52:05
8 [报告]
发表于 2006-09-27 11:12 |只看该作者
select @@version
go

论坛徽章:
0
9 [报告]
发表于 2006-09-27 13:12 |只看该作者
楼上,结果为
Adaptive Server Enterprise/12.5.2/EBF 11798/P/NT (IX86)/OS 4.0/ase1252/1831/32-bit/OPT/Fri Apr 09 04:15:03 2004

论坛徽章:
0
10 [报告]
发表于 2006-09-28 01:41 |只看该作者
hobbylu already gave you the solution if it's permission related:
grant select on table1 to user1.

I guess it's caused by ODBC or OLEDB driver, for instance, if you use PB10 and set disablebind=0 with pb10 oledb.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP