Microsoft sql server ошибка 2812

SQL Server 2016 Developer — duplicate (do not use) SQL Server 2016 Enterprise — duplicate (do not use) SQL Server 2016 Enterprise Core — duplicate (do not use) SQL Server 2016 Standard — duplicate (do not use) Еще…Меньше

Проблемы

Рассмотрим следующий сценарий.

  • Подразделение » Y»Использование среды публикации репликации транзакций в следующих версиях SQL Server:

    • Версия, предшествующая накопительному обновлению 3 (CU3) для SQL Server 2016 с пакетом обновления 2 (SP2)

    • Версия, предшествующая накопительному обновлению 6 (CU6) для SQL Server 2017

  • Вы настраиваете этот сервер как распространитель и создаете базу данных распространителя.

  • Вы добавляете этот сервер или другой сервер в качестве издателя на этот сервер распространителя, но не создавайте публикацию.

Нужна дополнительная помощь?

Нужны дополнительные параметры?

Изучите преимущества подписки, просмотрите учебные курсы, узнайте, как защитить свое устройство и т. д.

В сообществах можно задавать вопросы и отвечать на них, отправлять отзывы и консультироваться с экспертами разных профилей.


  • September 24, 2010 at 12:37 pm

    #238776

    I am able to run the stored procedure in management studio.

    when i create a dataset in BIDS, the metadata came up, but when i execute the stored procedure in a dataset, its giving me the following error.

    «Could not find stored procedure. SQL Server error 2812»

    Thanks for your help guys.

    Satish

  • Luke L

    SSC-Dedicated

    Points: 35547

    Make sure the user you are using to connect to the database has permissions to that stored procedure. Also, depending on the version of SQL you are using make sure that you’re using the correct owner/schema to call the stored procedure if it’s needed.

    I.E. in 2000 and the owner is not DBO or the user callign the procedure you must specify the owner Exec owninguser.myprocedure

    in 2005+ make sure you are specifying the schema if it’s not in the default schema of the user attempting to execute the procedure.

    -Luke.

    To help us help you read this[/url]For better help with performance problems please read this[/url]

  • SatishAyyar

    SSCrazy

    Points: 2825

    All the permissions are good.Thanks for the reply.

    I found the soultion. Its really crazy, I do not know why and how but it worked.

    I droped the procedure and recreated and it worked like that.

    Thanks

    Satish

  • Luke L

    SSC-Dedicated

    Points: 35547

    Were you the one that originally created the procedure? IF not, and this is a SQL 2000 instance, you were not the owner, therefor you would have needed to specify the owner. Since you dropped and recreated the procedure, you are now the owner and do not need to specify the owner, but other users will need to.

    -Luke.

    To help us help you read this[/url]For better help with performance problems please read this[/url]

  • SatishAyyar

    SSCrazy

    Points: 2825

    I created the sp first and then I gave exec permissions to other person. so the other person got the error which I pasted. we tried and tried but worked only after I recreated the proc. I was the one who created the proc the first time and the second time also.

  • SatishAyyar

    SSCrazy

    Points: 2825

  • Luke L

    SSC-Dedicated

    Points: 35547

    satishseth143 (9/24/2010)


    Its SQL2008

    Thanks for finally posting the version number. Sorry I assumed this was 2000 as that’s what the largest majority of articles I could find on this error number were dealing with. Glad you got it sorted.

    -Luke.

    To help us help you read this[/url]For better help with performance problems please read this[/url]

Viewing 7 posts — 1 through 6 (of 6 total)

SQL Server 2016 Developer — duplicate (do not use) SQL Server 2016 Enterprise — duplicate (do not use) SQL Server 2016 Enterprise Core — duplicate (do not use) SQL Server 2016 Standard — duplicate (do not use) More…Less

Symptoms

Consider the following scenario:

  • You use Transactional Replication publication environment in the following SQL Server versions:

    • Version before Cumulative Update 3 (CU3) for SQL Server 2016 Service Pack 2 (SP2)

    • Version before Cumulative Update 6 (CU6) for SQL Server 2017

  • You configure this server as a distributor and create a distribution database.

  • You add this server or another server as a publisher to this distributor server, but don’t create publication.

  • Later, you upgrade SQL Server to Cumulative Update 3 for SQL Server 2016 SP2 or later versions, or you upgrade SQL Server to Cumulative Update 6 for SQL Server 2017 or later versions.

In this scenario, when you remove publisher server from distributor, you may receive error messages that resemble the following:

Msg 2812, Level 16, State 62, Procedure sp_dropdistpublisher, Line LineNumber

Could not find stored procedure.

When you enable database for publication, you may receive error messages that resemble the following:

Msg 20028, Level 16, State 1, Procedure ProcedureName, Line LineNumber

The Distributor has not been installed correctly. Could not enable database for publishing.

The replication option ‘publish’ of database ‘DatabaseName‘ has been set to false.

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the «Applies to» section.

Resolution

This issue is fixed in the following cumulative updates for SQL Server:

  • Cumulative Update 14 for SQL Server 2017

  • Cumulative Update 6 for SQL Server 2016 SP2

About cumulative updates for SQL Server:

Each new cumulative update for SQL Server contains all the hotfixes and all the security fixes that were included with the previous cumulative update. Check out the latest cumulative updates for SQL Server:

  • Latest cumulative update for SQL Server 2017

  • Latest cumulative update for SQL Server 2016

References

Learn about the terminology that Microsoft uses to describe software updates.

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

  • Remove From My Forums
  • Question

  • I had an error free transactional replication running between MSSQL 2000 (pub) and MSSQL 2008 R2 (sub). Because schema changes were disabled, I needed to delete the subscription and publication to add a new column to one of the replicated tables. I recreated
    the publication and added the subscriber. The snapshot was recreated. Now when the distribution agent runs it fails with error 2812. The Distribution DB is on the 2008 R2 box and the subscribers are pull subscriptions.

    I ran a trace on the subscriber and found that the replcmd that was failing is ‘exec sp_MSins_z2t_Activity;2’. NOTE the ‘;2’.

    I review the snapshot data and the replcmd script has CREATE PROCEDURE sp_MSins_z2t_Activity *without* ‘;2’. Hence the subscriber database as sp_MSins_z2t_Activity.

    I deleted and recreated the pub/sub a couple of times with a *new* INS/DEL/UPD cmds and still get a ‘;2’ when the distribution agent runs. I understand the use of the ‘;2’, but it unnecessary.

    So how can I fix this??

    SteveB.

SQL Server 2016 Developer SQL Server 2016 Enterprise SQL Server 2016 Enterprise Core SQL Server 2016 Standard SQL Server 2017 on Windows (all editions) More…Less

Symptoms

Consider the following scenario:

  • You use Transactional Replication publication environment in the following SQL Server versions:

    • Version before Cumulative Update 3 (CU3) for SQL Server 2016 Service Pack 2 (SP2)

    • Version before Cumulative Update 6 (CU6) for SQL Server 2017

  • You configure this server as a distributor and create a distribution database.

  • You add this server or another server as a publisher to this distributor server, but don’t create publication.

  • Later, you upgrade SQL Server to Cumulative Update 3 for SQL Server 2016 SP2 or later versions, or you upgrade SQL Server to Cumulative Update 6 for SQL Server 2017 or later versions.

In this scenario, when you remove publisher server from distributor, you may receive error messages that resemble the following:

Msg 2812, Level 16, State 62, Procedure sp_dropdistpublisher, Line LineNumber

Could not find stored procedure.

When you enable database for publication, you may receive error messages that resemble the following:

Msg 20028, Level 16, State 1, Procedure ProcedureName, Line LineNumber

The Distributor has not been installed correctly. Could not enable database for publishing.

The replication option ‘publish’ of database ‘DatabaseName‘ has been set to false.

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the «Applies to» section.

Resolution

This issue is fixed in the following cumulative updates for SQL Server:

  • Cumulative Update 14 for SQL Server 2017

  • Cumulative Update 6 for SQL Server 2016 SP2

About cumulative updates for SQL Server:

Each new cumulative update for SQL Server contains all the hotfixes and all the security fixes that were included with the previous cumulative update. Check out the latest cumulative updates for SQL Server:

  • Latest cumulative update for SQL Server 2017

  • Latest cumulative update for SQL Server 2016

References

Learn about the terminology that Microsoft uses to describe software updates.

Need more help?

SQL Server 2016 Developer SQL Server 2016 Enterprise SQL Server 2016 Enterprise Core SQL Server 2016 Standard SQL Server 2017 on Windows (all editions) Еще…Меньше

Проблемы

Рассмотрим следующий сценарий.

  • Подразделение » Y»Использование среды публикации репликации транзакций в следующих версиях SQL Server:

    • Версия, предшествующая накопительному обновлению 3 (CU3) для SQL Server 2016 с пакетом обновления 2 (SP2)

    • Версия, предшествующая накопительному обновлению 6 (CU6) для SQL Server 2017

  • Вы настраиваете этот сервер как распространитель и создаете базу данных распространителя.

  • Вы добавляете этот сервер или другой сервер в качестве издателя на этот сервер распространителя, но не создавайте публикацию.

Нужна дополнительная помощь?

  • Remove From My Forums
  • Question

  • I had an error free transactional replication running between MSSQL 2000 (pub) and MSSQL 2008 R2 (sub). Because schema changes were disabled, I needed to delete the subscription and publication to add a new column to one of the replicated tables. I recreated
    the publication and added the subscriber. The snapshot was recreated. Now when the distribution agent runs it fails with error 2812. The Distribution DB is on the 2008 R2 box and the subscribers are pull subscriptions.

    I ran a trace on the subscriber and found that the replcmd that was failing is ‘exec sp_MSins_z2t_Activity;2’. NOTE the ‘;2’.

    I review the snapshot data and the replcmd script has CREATE PROCEDURE sp_MSins_z2t_Activity *without* ‘;2’. Hence the subscriber database as sp_MSins_z2t_Activity.

    I deleted and recreated the pub/sub a couple of times with a *new* INS/DEL/UPD cmds and still get a ‘;2’ when the distribution agent runs. I understand the use of the ‘;2’, but it unnecessary.

    So how can I fix this??

    SteveB.


  • September 24, 2010 at 12:37 pm

    #238776

    I am able to run the stored procedure in management studio.

    when i create a dataset in BIDS, the metadata came up, but when i execute the stored procedure in a dataset, its giving me the following error.

    «Could not find stored procedure. SQL Server error 2812»

    Thanks for your help guys.

    Satish

  • Luke L

    SSC-Dedicated

    Points: 35545

    Make sure the user you are using to connect to the database has permissions to that stored procedure. Also, depending on the version of SQL you are using make sure that you’re using the correct owner/schema to call the stored procedure if it’s needed.

    I.E. in 2000 and the owner is not DBO or the user callign the procedure you must specify the owner Exec owninguser.myprocedure

    in 2005+ make sure you are specifying the schema if it’s not in the default schema of the user attempting to execute the procedure.

    -Luke.

    To help us help you read this[/url]For better help with performance problems please read this[/url]

  • SatishAyyar

    SSCrazy

    Points: 2823

    All the permissions are good.Thanks for the reply.

    I found the soultion. Its really crazy, I do not know why and how but it worked.

    I droped the procedure and recreated and it worked like that.

    Thanks

    Satish

  • Luke L

    SSC-Dedicated

    Points: 35545

    Were you the one that originally created the procedure? IF not, and this is a SQL 2000 instance, you were not the owner, therefor you would have needed to specify the owner. Since you dropped and recreated the procedure, you are now the owner and do not need to specify the owner, but other users will need to.

    -Luke.

    To help us help you read this[/url]For better help with performance problems please read this[/url]

  • SatishAyyar

    SSCrazy

    Points: 2823

    I created the sp first and then I gave exec permissions to other person. so the other person got the error which I pasted. we tried and tried but worked only after I recreated the proc. I was the one who created the proc the first time and the second time also.

  • SatishAyyar

    SSCrazy

    Points: 2823

  • Luke L

    SSC-Dedicated

    Points: 35545

    satishseth143 (9/24/2010)


    Its SQL2008

    Thanks for finally posting the version number. Sorry I assumed this was 2000 as that’s what the largest majority of articles I could find on this error number were dealing with. Glad you got it sorted.

    -Luke.

    To help us help you read this[/url]For better help with performance problems please read this[/url]

Viewing 7 posts — 1 through 6 (of 6 total)

I ran your code using a table from the AdventureWorks2012 database.

create procedure SEL_STUDENT
as
begin
select * from [Person].[Person]
end
go

execute SEL_STUDENT

And it works fine.

Although I have moved GO above execute SEL_STUDENT that is not the issue here as @CoOl points out because you specifically say you execute the stored procedure after your block of code.

The only possible explanation would be that you are querying execute SEL_STUDENT on the wrong database.

Try the following code —

USE [DatabaseName] 
GO

execute SEL_STUDENT

Here, [DatabaseName] is the database where the stored procedure SEL_STUDENT table is stored.

Make sure your table is also stored in the same database or else you would have to modify select * from student to select * from [DatabaseName].[SchemaName].[student]

Additionally, you can use the Object Explorer to identify where your stored procedure has been saved. I am unable to post a snapshot of how to do this as my reputation is below 10.

EDIT : Now that my reputation is in two digits —

enter image description here

Kindly note that [dbo] is the default schema in SQL Server.

  • Remove From My Forums
  • Question

  • I am running sql server 2005 standard edition with sp3.

    I get this error when my scheduled jobs are running:

    NT AUTHORITYSYSTEM. Could not find stored procedure (Error 2812). The step failed

    How do I resolve it.

    thanks

Answers

  • If you are running merge replication it is likely that your merge agent does not have the correct permissions on publication database. Ensure the account your merge agent runs under is in the PAL on the publication.


    looking for a book on SQL Server 2008 Administration? http://www.amazon.com/Microsoft-Server-2008-Management-Administration/dp/067233044X looking for a book on SQL Server 2008 Full-Text Search? http://www.amazon.com/Pro-Full-Text-Search-Server-2008/dp/1430215941

    • Marked as answer by

      Tuesday, November 30, 2010 11:24 AM

  • Remove From My Forums
  • Question

  • I am running sql server 2005 standard edition with sp3.

    I get this error when my scheduled jobs are running:

    NT AUTHORITYSYSTEM. Could not find stored procedure (Error 2812). The step failed

    How do I resolve it.

    thanks

Answers

  • If you are running merge replication it is likely that your merge agent does not have the correct permissions on publication database. Ensure the account your merge agent runs under is in the PAL on the publication.


    looking for a book on SQL Server 2008 Administration? http://www.amazon.com/Microsoft-Server-2008-Management-Administration/dp/067233044X looking for a book on SQL Server 2008 Full-Text Search? http://www.amazon.com/Pro-Full-Text-Search-Server-2008/dp/1430215941

    • Marked as answer by

      Tuesday, November 30, 2010 11:24 AM

Error 2812

Severity Level 16
Message Text

Could not find stored procedure '%.*ls'.

Explanation

An attempt was made to execute a stored procedure that does not exist. If the procedure does exist (it appears when sp_help is run with no parameters), the error might have occurred because you did not fully qualify the procedure name. If the procedure is not owned by the user attempting to execute it, and it is not owned by the database owner (dbo), all references to it must include the owner name. For example, suppose user1 creates a procedure called proc1. Any users must add the owner name before the procedure name, as shown in the following example:

EXECUTE user1.proc1

Naming conventions for database objects are as follows:

[[[server_name.][database_name].][owner_name].]object_name

The default value for database_name is the current database; the default value for owner_name is the current user. If the current user is not the owner, the current user must specify the owner name when using the procedure. Because the owner name is part of the object name, two different users can have procedures with the same object name in the same database (for example user1.proc1 and user2.proc1). For more information about naming conventions, see Transact-SQL Syntax Conventions.

The only exceptions to this naming convention are system procedures, which can be executed from any database. System procedures reside in the master database, are owned by the system administrator, and have names that begin with sp_. System procedures reference the system tables for the current database.

Action

If you do not know who owns the procedure, use sp_help to display the owner. If you run sp_help without any parameters, it displays objects owned by other users. To determine which procedures exist in a database and who owns them, use the following:

USE master
GO
SELECT name,owner = USER_NAME(uid) 
FROM sysobjects
WHERE type = 'P'
GO

If the procedure does not appear in the output of this query, the procedure is either in a different database or does not exist.

If you do not own the procedure in question, you can avoid error 2812 by qualifying the procedure name with the owner name, as shown in the following example:

EXECUTE user1.proc1

For procedures used by many users of a database, it is usually easiest if the dbo creates the procedure. This allows any user to find the procedure without specifying an owner name.

If the procedure is not in the database where it is executed, you can avoid this error by fully qualifying the procedure name with the database name, as shown in the following example:

EXECUTE database_1.user1.proc1 

The owner name is not needed if you or the dbo own the procedure. For example:

EXECUTE database_1..proc1 

Execute permission must be provided so that other users can execute this procedure, but no permissions are required to see the text of the procedure.

If this error occurs on system procedures, it might be resolved by running Instmstr.SQL. This reinstalls all system procedures and initializes various other structures.

See Also

Errors 2000-2999

EXECUTE

sp_configure

sp_help

Сообщение об ошибке: Ошибка 2812: не удалось найти хранимую процедуру sp_password.

Подготовка: скрипт восстановления хранимой процедуры,Пожалуйста, нажмите «Загрузить», чтобы получить его.После загрузки поместите корневой каталог диска C и разархивируйте его.

img_1d8bca6cd12b2d511210b838384b6120.png

Скриншот ошибки

1. Пуск — Все программы — Microsoft SQL Server — дважды щелкните [Enterprise Manager] (рисунок 1-1).

img_9b3cc9824e14ada8837cec99b28bad82.png

Рисунок 1-1

2. Найдите в [Корневой каталог консоли] — [Microsoft] — [Группа SQL Server] — [(локальная) (Windows)] — [База данных] -щелкните [мастер] -нажмите [Инструменты] — [Анализатор запросов SQL ] (Рисунок 1-2).

img_bf572c1570a25e9e8dbdc430d424030b.png

Рисунок 1-2

3. Скопируйте и вставьте следующее содержимое в [Query Analyzer] и нажмите [►], чтобы выполнить запрос. Внизу отображается [Пакетный запрос завершен] и выполнение завершено (рис. 1-3).

sp_configure ‘allow updates’,1

RECONFIGURE WITH OVERRIDE

img_63f145ff15def7c49ebbf2b12ea86fdc.png

Рисунок 1-3

4. Очистите содержимое на предыдущем шаге [Анализатор запросов], затем щелкните [Загрузить сценарий SQL]. Во всплывающем окне [Открыть файл запроса] найдите путь к хранилищу файла C, который нужно упомянуть, и выберите [sp_password.sql] — [Открыть] (Рисунок 1-4).

img_cf4c8a7bbe925cbe7169316471a7a1a8.png

Рисунок 1-4

5. После открытия нажмите [►], чтобы выполнить запрос. Внизу отображается [Пакетный запрос завершен] для завершения выполнения (рисунок 1-5).

img_eaa532a06ed214816639387065c02f72.png

Рисунок 1-5

6. Очистите содержимое на предыдущем шаге [Query Analyzer], затем скопируйте и вставьте следующее содержимое и нажмите [►], чтобы выполнить запрос. Внизу отображается [Пакетный запрос завершен] для завершения выполнения. После завершения выполнения пароль можно изменить обычным образом. Чтобы

sp_configure ‘allow updates’,0

RECONFIGURE WITH OVERRIDE

  • Microsoft sql server ошибка 2571
  • Microsoft sql server ошибка 229
  • Microsoft sql server ошибка 223
  • Microsoft sql server ошибка 22022
  • Microsoft sql server ошибка 18470