Re: Please help with sorting?

From: Brett (no_at_spam.com)
Date: 02/02/05


Date: Wed, 2 Feb 2005 14:45:46 -0500

I've changed the database name in the script but keep getting these errors:

Using emailaudit database
Checking for the existence of this procedure
DBCC execution completed. If DBCC printed error messages, contact your
system administrator.
Server: Msg 2714, Level 16, State 5, Procedure sp_generate_inserts, Line 446
There is already an object named 'sp_generate_inserts' in the database.
Created the procedure
DBCC execution completed. If DBCC printed error messages, contact your
system administrator.
Granting EXECUTE permission on sp_generate_inserts to all users
Server: Msg 4610, Level 16, State 1, Line 3
You can only grant or revoke permissions on objects in the current database.
Done

I'm trying to create the SP in the database that has the tables and data
needed. The master doesn't have this information. Any idea what is wrong?

It did create fine in the master database. However, if I try to run it in
the master database with this code:
exec sp_generate_inserts 'Links_PartitionbyYear'

I get this:

Server: Msg 50000, Level 16, State 1, Procedure sp_generate_inserts, Line
165
User table or view not found.
You may see this error, if you are not the owner of this table or view. In
that case use @owner parameter to specify the owner name.
Make sure you have SELECT permission on that table or view.

which is correct because the table Lniks_PartitionbyYear is not in the
master database.

Thanks,
Brett

"Anith Sen" <anith@bizdatasolutions.com> wrote in message
news:ebvscvVCFHA.3908@TK2MSFTNGP15.phx.gbl...
> Can you post your table structures, sample data and expected results? For
> details refer to: www.aspfaq.com/5006. It would provide your datatypes,
> keys, constraints, nature of the involved data and help others understand
> your requirements better.
>
> --
> Anith
>



Relevant Pages

  • Re: Cross database update issue
    ... Also, for dbo-owned objects, the owner of both databases must be the ... You can execute sp_helpdb to determine the current database owners. ... > User Name: Test1 Role Name=Test ... > Role Test has select permission to table t_test ...
    (microsoft.public.sqlserver.security)
  • Re: PHP Query Issues on Ingres R3 Linux Version
    ... If a table is owned by the DBA (the database owner) then there is no ... "permission" thing so much as an object ownership issue. ... An object which is not prefixed by a schema name is found by looking ...
    (comp.databases.ingres)
  • Re: Windows Power User SQL
    ... Bill has not been given any access to the master database, ... In SQL Server 2005, you can use the Has_Perms_By_Namefunction ... power user with permission to log onto the server and have given them ...
    (microsoft.public.sqlserver.security)
  • Re: Cluster will not fail over.
    ... Senior Database Administrator ... >> As far as the TCP/IP issue goes, you had to rebuild the cluster and were ... >> able to restore the master database. ... >> a cluster installation you'll have to revisit. ...
    (microsoft.public.sqlserver.clustering)
  • Re: Cross database granting
    ... connection will default to the master database. ... You could enable cross database chaining ownership (whatever it is called, ... > Chris Buys ... >>> the EXECUTE priviledge. ...
    (microsoft.public.sqlserver.programming)