Ms sql server error 15247

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

Проблемы

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

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

  • Пользователь, который не является системным администратором, пытается использовать этот тип данных для создания временной таблицы в базе данных модели.

В этом случае пользователь получит следующее сообщение об ошибке:
 

Msg 15247, Level 16, State 4, Server <Server name>, Line 1

У пользователя нет разрешения на выполнение этого действия.

Причина

В разделе Разрешения раздела Книги Online для create TABLE есть следующая заметка:

Если какие-либо столбцы в заявлении CREATE TABLE имеют определенный пользователем тип CLR, требуется либо владение типом, либо разрешение REFERENCES на него. 

Эта заметка относится не только к типам данных CLR, но и к пользовательским типам данных. Обратитесь к разделу»Использованиепользовательских типов в разных базах данных» книги SQL Server Online, в которой рассматривается поведение типов данных CLR. 

ПРИМЕЧАНИЕ. Эта проблема возникает только при явном создании таблиц, а не при неявном создании таблиц с помощью выражений SELECT INTO. 

Решение

Предоставить разрешения для определенного пользователем типа данных соответствующим пользователям, как предложено в разделе Причина. Чтобы решить эту проблему, можно также использовать один из следующих способов:    

Способ 1.Предоставление разрешений REFERENCES для общего пользователя в базе данных модели.

Пример:

CREATE TYPE dbo.udt_money FROM varchar(11) NOT NULL;
перейти
GRANT REFERENCES ON TYPE::d bo.udt_money TO public

ПРИМЕЧАНИЕ.Перед использованием этого метода тщательно оцените последствия для системы безопасности, так как это разрешение будет перенаться в каждую новую базу данных. 

Способ 2.Если вы не хотите, чтобы каждая новая база данных сохраняла определение и разрешения для этого пользовательского типа данных, вы можете использовать хранимую процедуру запуска для создания и назначения соответствующих разрешений только в базе данных TEMPDB.

Пример:     

ИСПОЛЬЗОВАТЬ мастер

Пойти

CREATE PROCEDURE setup_udt_in_tempdb

Как

EXEC ( ‘USE tempdb;

CREATE TYPE dbo.udt_money FROM varchar(11) NOT NULL;

GRANT REFERENCES ON TYPE::d bo.udt_money TO public;’)

Пойти

ExEC sp_procoption ‘setup_udt_in_tempdb’, ‘startup’ , ‘on’

Пойти

Способ 3.

Вместо использования временных таблиц можно использовать переменные таблиц, если вам нужно со ссылкой на пользовательские типы данных для временного хранения. Для ссылок на пользовательские типы данных с переменными таблицы не требуется явно предоставлять разрешения для пользовательского типа данных.

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

Содержание

  1. Ссылка на определенный пользователем тип данных, определенный в базе данных модели в TEMPDB, не может быть
  2. Проблемы
  3. Причина
  4. Решение
  5. Microsoft sql server error 15247
  6. Answered by:
  7. Question
  8. Answers
  9. All replies
  10. Microsoft sql server error 15247
  11. Answered by:
  12. Question
  13. Answers
  14. All replies

Ссылка на определенный пользователем тип данных, определенный в базе данных модели в TEMPDB, не может быть

Проблемы

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

В базе данных модели создается пользовательский тип данных.

Пользователь, который не является системным администратором, пытается использовать этот тип данных для создания временной таблицы в базе данных модели.

В этом случае пользователь получит следующее сообщение об ошибке:

Msg 15247, Level 16, State 4, Server , Line 1

У пользователя нет разрешения на выполнение этого действия.

Причина

В разделе Разрешения раздела Книги Online для create TABLE есть следующая заметка:

Если какие-либо столбцы в заявлении CREATE TABLE имеют определенный пользователем тип CLR, требуется либо владение типом, либо разрешение REFERENCES на него.

Эта заметка относится не только к типам данных CLR, но и к пользовательским типам данных. Обратитесь к разделу»Использованиепользовательских типов в разных базах данных» книги SQL Server Online, в которой рассматривается поведение типов данных CLR.

ПРИМЕЧАНИЕ. Эта проблема возникает только при явном создании таблиц, а не при неявном создании таблиц с помощью выражений SELECT INTO.

Решение

Предоставить разрешения для определенного пользователем типа данных соответствующим пользователям, как предложено в разделе Причина. Чтобы решить эту проблему, можно также использовать один из следующих способов:

Способ 1.Предоставление разрешений REFERENCES для общего пользователя в базе данных модели.

CREATE TYPE dbo.udt_money FROM varchar(11) NOT NULL;
перейти
GRANT REFERENCES ON TYPE::d bo.udt_money TO public

ПРИМЕЧАНИЕ.Перед использованием этого метода тщательно оцените последствия для системы безопасности, так как это разрешение будет перенаться в каждую новую базу данных.

Способ 2.Если вы не хотите, чтобы каждая новая база данных сохраняла определение и разрешения для этого пользовательского типа данных, вы можете использовать хранимую процедуру запуска для создания и назначения соответствующих разрешений только в базе данных TEMPDB.

CREATE PROCEDURE setup_udt_in_tempdb

EXEC ( ‘USE tempdb;

CREATE TYPE dbo.udt_money FROM varchar(11) NOT NULL;

GRANT REFERENCES ON TYPE::d bo.udt_money TO public;’)

ExEC sp_procoption ‘setup_udt_in_tempdb’, ‘startup’ , ‘on’

Вместо использования временных таблиц можно использовать переменные таблиц, если вам нужно со ссылкой на пользовательские типы данных для временного хранения. Для ссылок на пользовательские типы данных с переменными таблицы не требуется явно предоставлять разрешения для пользовательского типа данных.

Источник

Microsoft sql server error 15247

This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.

Answered by:

Question

I was able to do my work with ease on my Database server, until sometime Friday evening. Don’t exactly know what transpired, only that I can now no longer run queries or even create new databases. Here is a sample of what happens when I try to create a database

Create Database PetitionSample

Msg 262, Level 14, State 1, Line 1

CREATE DATABASE permission denied in database ‘master’.

I used to be able to create databases, create new users and so on. My Server is installed on a Vista machine and I am running Developer version and using Management studio 2008 to access it. Anyone have any idea what could be going on?

Answers

  • Proposed as answer by Raul Garcia — MS Microsoft employee Friday, January 16, 2009 6:42 AM
  • Marked as answer by Mangal Pardeshi Monday, January 26, 2009 4:30 AM

  • Proposed as answer by Raul Garcia — MS Microsoft employee Friday, January 16, 2009 6:42 AM
  • Marked as answer by Mangal Pardeshi Monday, January 26, 2009 4:30 AM

I tried the examples of the page and got the same error each time

An Error Occured while executing a Transact-SQL Statement or batch
User does not have permission to perform this action( Microsoft SQL Server, Error:15247) None

No, You don’t need to install again, you just need to give rights to your login by logging in with sysadmin user. If server is running on mixed mode, log in with sa user and give your login required permissions.

First try to log in with sa, if sa is not enable, tell us, I will guide you accordingly. Mangal Pardeshi. You can turn off the SUN, but I’m still gonna shine. 😉

Did you guys solve this thing in the end?

I’m currently trying to do the same — having a similar issue getting the correct permission in SSME 2008 — right clicking so I can work as system admin — still no luck — final explaination confused me — being a newbie.

If your sa account is disabled , login with windows authentication and make sure you have your authentication mode set to MIXED mode and now you can enable your sa login using

ALTER LOGIN [sa] ENABLE

Thanks for responding. Appreciated.

Alas, in following your instructions I have a problem when I attempt to change authentication mode to mixed.

The message being:

TITLE: Microsoft SQL Server Management Studio
——————————

Alter failed for Server ‘PMC-PCsqlexpress’. (Microsoft.SqlServer.Smo)

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

xp_regread() returned error 5, ‘Access is denied.’
xp_regread() returned error 5, ‘Access is denied.’
xp_regread() returned error 5, ‘Access is denied.’ (Microsoft SQL Server, Error: 22001)

Needless to say, at this stage I have no idea what the resolution to all this is, so any more thoughts would be extremely appreciated!

When you change some server level settings with respect to SQL server , that has to be updated in the windows registry.

This kind of server level changes like authentication modes are to be done by a login that has sysadmin privilege in the SQL server . By default sysadmin logins has got privileges to execute xp_regwrite

Stored procs . If you are using windows vista , try starting the SSMS with run as administrator option.

Bottom line : this is a permission issue so perform this action with sysadmin account and you will succeed , remember to restart SQL services once the authentication mode is changed.

I’m having the same problem on Windows 7. Sql doesn’t recognize Windows 7 Administrative privileges so it denies permission to grant any changes to Sql Server. Can’t add users, can’t change permissions for users. Can’t use sa ID because don’t know the password set up by the system. It’s not my Windows admin password. It’s a viscious circle — want to add user with admin level permission but have to have admin level permission to do so.

Thanks for any help.

I am stuck in this same scenario. I am a local administrator on the box, in the administrators group. I cannot login as sa because the account is disabled and because mixed-mode authentication is off. It will not let me enable the user, or enable mixed mode authentication (the xp_regread() error). I cannot add «sysadmin» rights to any logins because «User does not have permission to perform this action.» I even tried changing the service to run as me instead of Network Service. I tried running as the user named «Administrator»

It is a bit strange that I can modify any single bit on the entire hard drive, delete, overwrite, and modify files. Yet I can’t change the permissions on something. This has to be a bug of some kind. FYI: This is SQL Server 2008 Express x64 w/ SP2 on Windows 7 x64.

I found a solution. Basically, run SQL server in Single-user maintenance mode, and you will get access to the server again. You must be an administrative user for this to work.

NOTE: In all of the examples below, you may have to change parameters or command-lines based on your server name and instance name.

I. Force SQL server to support mixed-mode authentication.
1. Run REGEDIT
2. Go to HKEY_LOCAL_MACHINESOFTWAREMicrosoftMicrosoft SQL ServerMSSQL10.SQLEXPRESSMSSQLServer
NOTE: This key may vary slightly based on the installed version and instance name.
3. Set «LoginMode» to 2.
4. Restart SQL Server.
(Source: http://support.microsoft.com/kb/285097 )

II. Force SQL server to let you in temporarily
1. Go to services.
2. Stop SQL Server.
3. Grab the SQL server command-line (right click the service — properties). Mine is:
«C:Program FilesMicrosoft SQL ServerMSSQL10.SQLEXPRESSMSSQLBinnsqlservr.exe» -sSQLEXPRESS
4. Open an administrative command prompt.
5. Run the command-line from step 3, but add -m -c for single-user maintenance mode command-line.
6. Open another administrative command prompt.
7. Run «sqlcmd -S localhostSQLEXPRESS» from that same directory (replace with your server and instance name)
8. Now you can do all the stuff everyone told you to do that didn’t work. For example, to create a hero user with administrative accss:

9. QUIT and close the command-prompt
10. Go to the SQL Server command-line window and hit ctrl+C. It will prompt «Do you wish to shutdown SQL Server (Y/N)?» and enter Y.
11. Close the command-prompt
(Source: http://msdn.microsoft.com/en-us/library/dd207004.aspx )

III. Finally, login using your hero:
1. Restart the SQL Server service
2. Login using SQL Server authentication as the user «hero» with password «123»
3. *BAM* now you are in. Now give yourself sysadmin access and delete the temporary user.

Источник

Microsoft sql server error 15247

This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.

Answered by:

Question

I was able to do my work with ease on my Database server, until sometime Friday evening. Don’t exactly know what transpired, only that I can now no longer run queries or even create new databases. Here is a sample of what happens when I try to create a database

Create Database PetitionSample

Msg 262, Level 14, State 1, Line 1

CREATE DATABASE permission denied in database ‘master’.

I used to be able to create databases, create new users and so on. My Server is installed on a Vista machine and I am running Developer version and using Management studio 2008 to access it. Anyone have any idea what could be going on?

Answers

  • Proposed as answer by Raul Garcia — MS Microsoft employee Friday, January 16, 2009 6:42 AM
  • Marked as answer by Mangal Pardeshi Monday, January 26, 2009 4:30 AM

  • Proposed as answer by Raul Garcia — MS Microsoft employee Friday, January 16, 2009 6:42 AM
  • Marked as answer by Mangal Pardeshi Monday, January 26, 2009 4:30 AM

I tried the examples of the page and got the same error each time

An Error Occured while executing a Transact-SQL Statement or batch
User does not have permission to perform this action( Microsoft SQL Server, Error:15247) None

No, You don’t need to install again, you just need to give rights to your login by logging in with sysadmin user. If server is running on mixed mode, log in with sa user and give your login required permissions.

First try to log in with sa, if sa is not enable, tell us, I will guide you accordingly. Mangal Pardeshi. You can turn off the SUN, but I’m still gonna shine. 😉

Did you guys solve this thing in the end?

I’m currently trying to do the same — having a similar issue getting the correct permission in SSME 2008 — right clicking so I can work as system admin — still no luck — final explaination confused me — being a newbie.

If your sa account is disabled , login with windows authentication and make sure you have your authentication mode set to MIXED mode and now you can enable your sa login using

ALTER LOGIN [sa] ENABLE

Thanks for responding. Appreciated.

Alas, in following your instructions I have a problem when I attempt to change authentication mode to mixed.

The message being:

TITLE: Microsoft SQL Server Management Studio
——————————

Alter failed for Server ‘PMC-PCsqlexpress’. (Microsoft.SqlServer.Smo)

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

xp_regread() returned error 5, ‘Access is denied.’
xp_regread() returned error 5, ‘Access is denied.’
xp_regread() returned error 5, ‘Access is denied.’ (Microsoft SQL Server, Error: 22001)

Needless to say, at this stage I have no idea what the resolution to all this is, so any more thoughts would be extremely appreciated!

When you change some server level settings with respect to SQL server , that has to be updated in the windows registry.

This kind of server level changes like authentication modes are to be done by a login that has sysadmin privilege in the SQL server . By default sysadmin logins has got privileges to execute xp_regwrite

Stored procs . If you are using windows vista , try starting the SSMS with run as administrator option.

Bottom line : this is a permission issue so perform this action with sysadmin account and you will succeed , remember to restart SQL services once the authentication mode is changed.

I’m having the same problem on Windows 7. Sql doesn’t recognize Windows 7 Administrative privileges so it denies permission to grant any changes to Sql Server. Can’t add users, can’t change permissions for users. Can’t use sa ID because don’t know the password set up by the system. It’s not my Windows admin password. It’s a viscious circle — want to add user with admin level permission but have to have admin level permission to do so.

Thanks for any help.

I am stuck in this same scenario. I am a local administrator on the box, in the administrators group. I cannot login as sa because the account is disabled and because mixed-mode authentication is off. It will not let me enable the user, or enable mixed mode authentication (the xp_regread() error). I cannot add «sysadmin» rights to any logins because «User does not have permission to perform this action.» I even tried changing the service to run as me instead of Network Service. I tried running as the user named «Administrator»

It is a bit strange that I can modify any single bit on the entire hard drive, delete, overwrite, and modify files. Yet I can’t change the permissions on something. This has to be a bug of some kind. FYI: This is SQL Server 2008 Express x64 w/ SP2 on Windows 7 x64.

I found a solution. Basically, run SQL server in Single-user maintenance mode, and you will get access to the server again. You must be an administrative user for this to work.

NOTE: In all of the examples below, you may have to change parameters or command-lines based on your server name and instance name.

I. Force SQL server to support mixed-mode authentication.
1. Run REGEDIT
2. Go to HKEY_LOCAL_MACHINESOFTWAREMicrosoftMicrosoft SQL ServerMSSQL10.SQLEXPRESSMSSQLServer
NOTE: This key may vary slightly based on the installed version and instance name.
3. Set «LoginMode» to 2.
4. Restart SQL Server.
(Source: http://support.microsoft.com/kb/285097 )

II. Force SQL server to let you in temporarily
1. Go to services.
2. Stop SQL Server.
3. Grab the SQL server command-line (right click the service — properties). Mine is:
«C:Program FilesMicrosoft SQL ServerMSSQL10.SQLEXPRESSMSSQLBinnsqlservr.exe» -sSQLEXPRESS
4. Open an administrative command prompt.
5. Run the command-line from step 3, but add -m -c for single-user maintenance mode command-line.
6. Open another administrative command prompt.
7. Run «sqlcmd -S localhostSQLEXPRESS» from that same directory (replace with your server and instance name)
8. Now you can do all the stuff everyone told you to do that didn’t work. For example, to create a hero user with administrative accss:

9. QUIT and close the command-prompt
10. Go to the SQL Server command-line window and hit ctrl+C. It will prompt «Do you wish to shutdown SQL Server (Y/N)?» and enter Y.
11. Close the command-prompt
(Source: http://msdn.microsoft.com/en-us/library/dd207004.aspx )

III. Finally, login using your hero:
1. Restart the SQL Server service
2. Login using SQL Server authentication as the user «hero» with password «123»
3. *BAM* now you are in. Now give yourself sysadmin access and delete the temporary user.

Источник

Please Sign up or sign in
to vote.

1.00/5 (1 vote)

See more:

SQL

hi,
i was trying to create a new user longin in sql server 2008 (express version)
and when i clicked on «accept», then a message popped up with this error (15247)

Posted 27-May-13 11:12am

appleduardo

Add a Solution


2 solutions

  • Top Rated

  • Most Recent

Please Sign up or sign in
to vote.

Solution 1

Follow the instructions:
1. http://www.pc-library.com/errors/error-code/15247-0x3B8F/[^]
2. http://www.mobydisk.com/softdev/techinfo/sqlserver.html[^]

Permalink

Share this answer

Posted 27-May-13 12:57pm

Maciej Los

Please Sign up or sign in
to vote.

Solution 2

Because You don’t have permission to create new user login. you can created by administrator login.

check this site

http://social.msdn.microsoft.com/Forums/en-US/sqlsecurity/thread/60b888bf-30dc-4eaf-bea8-5fd55181f8e5[^]

Permalink

Share this answer

Posted 27-May-13 18:55pm

Arun Vasu

Add a Solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

2010-05-16, 17:17 / Argon

При наличии у пользователя прав локального администратора в операционной системе, в которой установлен Microsoft SQL Server (я предполагаю версию 2008), может случиться ситуация, что прав на подключение или управление сервером SQL у такого пользователя нет. Случиться такое может по разным причинам, от саботажа до банальной установки SQL Server’а доменным пользователем, которого уже удалили. Однако, есть возможность без переустановки SQL Server’а получить административные права любому пользователю, обладающим локальными административными правами на уровне ОС. Для этого нужно проделать следующие действия…

  1. зайти в систему от имени пользователя с правами локального администратора
  2. запустить командную строку с правами администратора (начиная с Windows Server 2008 по умолчанию включен UAC, поэтому для полных прав в системе все программы нужно запускать правым кликом → запуск от админа)
  3. выполнить остановку службы SQL Server
    net stop MSSQLSERVER
  4. выполнить запуск службы SQL Server в однопользовательском режиме
    net start MSSQLSERVER /m
  5. подключиться к командному процессору управления SQL Server с правами текущего пользователя
    sqlcmd -E
  6. добавить объект безопасности Windows (локального или доменного пользователя или группу) в базу данных пользователей SQL Server
    CREATE LOGIN [builtinадминистраторы] FROM WINDOWS;
    GO;
  7. назначить этому пользователю права администратора SQL Server’a
    EXEC sp_addsrvrolemember 'builtinадминистраторы', 'sysadmin';
    GO;
  8. выйти из sqlcmd ;)
    exit
  9. запустить службу SQL Server в обычном режиме
    net start MSSQLSERVER
  10. теперь можно подключаться с помощью Management Studio к вашему SQL серверу и выполнять необходимые действия
Рубрика Tips and Tricks
Метки security, безопасность, sql server, windows server, восстановление, recovery
Опубликовано 2010-05-16, 17:17; обновлено 2011-01-09, 17:01
Комментарии 17 комментариев » | Лента комментариев RSS
Ссылки Постоянная ссылка |
Обратная ссылка

Понравилась статья? Поделить с друзьями:
  • Ms sql error converting data type varchar to float
  • Ms sql error converting data type nvarchar to float
  • Ms sql error 547
  • Ms sql error 2627
  • Ms sql error 207