开发者

create function return : you do not have permission (SQL Server 2000)

I'm trying to execute an SQL file who is doing this :

create function [finder].[fn_getName] (
...
)

I get this error :

Specified owner name 'finder' either does not exist or you do not have permission 开发者_JAVA百科to use it.

After some lines, the script is doing :

grant all on [finder].[fn_getName]
to myaccount

What finder means ?

If finder should be a User or a Login, do I have to create it before executing those lines ?

USE master
GO
sp_addlogin 'finder'

Thanks.


[finder] is the schema name.

When you open a query page in SQL Server it usually has the [master] database selected, so you need to tell it which database to run your query on. You can do that by selecting the database in the 'Available Databases' drop-down list, or using the USE statement before executing other query statements.

E.g.

USE [finder]
GO

CREATE FUNCTION [dbo].[fn_getName] (
...
)
GO

GRANT ALL ON [dbo].[fn_getName] TO myaccount
GO
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜