Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 User does not have permission to perform this acti

Author  Topic 

sparrow37
Posting Yak Master

148 Posts

Posted - 2009-12-20 : 05:39:38
Hi all,

I have following stored procedure :

CREATE procedure [dbo].[USStats]

as
exec sp_fulltext_database 'enable'

Declare @rand int
Set @rand = Rand()

Declare @Stores int
Set @Stores = Round(( Select Count (grStoreID) from USgrStore )*9 + (Round(Rand()*2,0)) ,0)

Declare @Groups int
Set @Groups = ( Select Count (grGroupID) from USgrGroup )

Declare @Type int
Set @Type = Round(( Select Count (grTypeID) from USgrType )*2 ,0)

Declare @gr int
Set @gr = Round(( Select Count (grID) from USgr )*21.34 ,0)

Declare @Prices int
Set @Prices = Round(( Select Count (grPriceID) from USgrPrice )*134+ (Round(Rand()*2,0)) ,0)

Declare @User int
Set @User = (Select max(grUserID) from USstatsTable) + Round(Rand()*1,0)


Insert into USstatsTable (grStore , grGroup , grTypeID, grID, grPriceID, grUSerID, time)
Values (@Stores, @Groups, @Type, @gr, @Prices, @User, getdate())


Select top 1 grStore , grGroup , grTypeID, grID, grPriceID, grUSerID, time from USstatsTable order by USstatsTable.time desc



GO

It gives error on following line after 'as' word

exec sp_fulltext_database 'enable'

I get following error:

User does not have permission to perform this action.

if i comment this line, it works fine. Is there any harm in commenting this line. What is alternative to this statement that I can use in my stored procedure. I am testing it on database server. I cant change user permissions to I will have to change stored procedure. On my local system, It works fine because I have enough user permissions.

Please help me on this.

Regards,
Asif Hameed

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-12-20 : 06:02:16
what you're doing by that line is enabling full text index on database. you can comment that and ask anybody with admin rights to do that for you. it needs to be done once.
Go to Top of Page
   

- Advertisement -