I am developing a web site with asp.net 2.0 and c#, using Visual Studio 2005 and Microsoft SQL Server 2005 ( I am still learning about these technologies and languages ).
I transferred my web site files to my NEW computer.
The web site worked fine when running inside Visual Studio, however when I tried to run it in its PUBLISHED format it was giving this error message:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Server Error in '/MA' Application.
Cannot open database "SiteData" requested by the login. The login failed.
Login failed for user 'CENTAURUSASPNET'.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I solved the problem by running SQL Server Management Stdio, right clicking “SiteData� database -> properties -> permissions->view server permissions then I chose “CENTAURUSASPNET� and since I DID NOT KNOW what grants are ESSENTIAL for the functioning of the database, I GRANTED EVERYTHING ( I ticked ALL the permissions).
But since, probably, a lot of GRANTS are not only unnecessary but also may compromise the security of the web site, I would like to know what are the ESSENTIAL OR MINIMUM GRANTS NECESSARY for making the database functional to the web site and what GRANTS may compromise security.
I am developing a web site with asp.net 2.0 and c#, using Visual Studio 2005 and Microsoft SQL Server 2005 ( I am still learning about these technologies and languages ).I transferred my web site files to my NEW computer. The web site worked fine when running inside Visual Studio, however when I tried to run it in its PUBLISHED format it was giving this error message:Server Error in '/MA' Application. Cannot open database "SiteData" requested by the login. The login failed.Login failed for user 'CENTAURUSASPNET'.I solved the problem by running SQL Server Management Stdio, right clicking “SiteData� database -> properties -> permissions->view server permissions then I chose “CENTAURUSASPNET� and since I DID NOT KNOW what grants are ESSENTIAL for the functioning of the database, I GRANTED EVERYTHING ( I ticked ALL the permissions). But since, probably, a lot of GRANTS are not only unnecessary but also may compromise the security of the web site, I would like to know what are the ESSENTIAL OR MINIMUM GRANTS NECESSARY for making the database functional to the web site and what grants may represent a security risk.
I have a database with over 450 tables, that until a short while agohas been strictly 3NF. In cases where complicated permutations ofdata are required quickly for certain parts of the system, sometimesit is not possible to write a query fast enough, due to the complexityof deriving many nested levels of data.Therefore for the few instances where this has been needed, I havecreated carefully named summary tables, having one-to-onerelationships to real tables (same primary key), and containing onlythe values which must be computed.This works fine. The question now is when to compute them.Much as I strongly dislike triggers, I have created triggers for thetables in question, which themselves recalculate the summary values,and populate the summary tables.Good news, loading is much faster.Bad news, now that I'm taking the hit on the save, the saves are fartoo slow.The only way I can see that my saves could be sped up, is to perhapsspread the work a bit, such that maybe if I am adding fifty records toa table, that the trigger is somehow disabled before the rows areadded, and re-enabled afterwards, to calculate the lot as a set-basedoperation (rather than calling the trigger 50 times), but I don't seea way to do that.Any help of any nature on this matter would be greatly appreciatedCheersBrian McGee
I know there must be a way to script GRANTS for all users for specific objects(tables, sp's, etc). Can't find much in BOL, etc. Does anyone know how? Any comments would be appreciated.
I'm trying to grant/deny object permissions in a user database using Enterprise Manager and query tool without success (for €˜public€™ role and individual sql logins). I€™m not getting any error messages. Permission changes just don€™t take effect. Although, there are few objects, which already have permissions granted and I'm able to change permissions for these ones.
An error has occurred during report processing. (rsProcessingAborted) Query execution failed for data set 'TestID'. (rsErrorExecutingCommand) For more information about this error navigate to the report server on the local server machine, or enable remote errors
The log file reads:
---> Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Query execution failed for data set 'TestID'. ---> System.Data.SqlClient.SqlException: SELECT permission denied on object 'TableID', database 'Database', schema 'dbo'.
***Background***
General Users got an error message when trying to access any reports we have created. All admin have no problems with the reports. Users (Domain Users) are given rights (Browser) to the reports and the Data Sources (Browser) and yet cannot view the reports.
An error has occurred during report processing. (rsProcessingAborted) Cannot create a connection to data source 'DS2'. (rsErrorOpeningConnection) For more information about this error navigate to the report server on the local server machine, or enable remote errors
I'll add this from the report logs...
w3wp!processing!1!3/20/2007-11:43:25:: e ERROR: Data source €˜DS2€™: An error has occurred. Details: Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Cannot create a connection to data source €˜DS2€™. ---> System.Data.SqlClient.SqlException: Cannot open database €œDatabase€? requested by the login. The login failed. Login failed for user €˜DOMAINUsername€™.
The user has rights via a local group to the report and data source (Browser rights) and the local group has been added as a SQL login.
I gave rights to the databases themselves instead of just to SQL and the error changed (Ah-ha...progress, but why!?!?)
I've been assigned the task of setting up access to our SQL Server 2005 box. A consultant developing for us has accessing to 2 databases and I've set this up fine. It appears however that one of these databases is re-copied over to the server every night to keep data reasonably current.
I'm not interesting in changing this method as I'm not the maintainer (as yet).
Basically I would like to know if I've setup access to this database (it works fine), when the database is updated (with an SSIS package) the account seems to get deleted. Do the original permissions from the source database overwrite those of its destination?
I had thought that I had posted this yesterday but since I cannot findit here we go again.I have searched the archives but either the code I want is not postedor I missed it.I have a user create role in a database that I need to reproduce inanother version of the database. Does anyone out there have the SQLor T-SQL necessary to generate all the grants to a role?-- Mark D Powell --
I am in the reporting services configuration tool. When I am on database setup I get Create a Grants Scripts Right with a red X. Everything else passes. I am using sql server credentials and the user is sa on the database server. Any help would be appreciated.
While I'm trying to configure rs db configuration, I€™m getting "Create a Grants Rights Script" error when I click Apply button in rs configuration UI.
For this setup; I€™m using 32-bit rs on 64-bit windows 2003 server and trying to connect 64-bit sql db instance on a different 64-bit box . both boxes are in same windows domain. I could also able to create rs db from rs configuration UI successfully. I'm using sql sa credentials and installed SQL SP1 on both boxes. Pl let me know how to fix this error.
Complate error message is,
System.Runtime.InteropServices.COMException (0x800706BA): The RPC server is unavailable. (Exception from HRESULT: 0x800706BA) at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo) at System.Management.ManagementScope.InitializeGuts(Object o) at System.Management.ManagementScope.Initialize() at System.Management.ManagementObjectSearcher.Initialize() at System.Management.ManagementObjectSearcher.Get() at Microsoft.ReportingServices.Diagnostics.WebUtil.GetIPAddresses(String machine) at ReportServicesConfigUI.Panels.DatabaseSetupPanel.IsLocalDbServer(String dbServer) at ReportServicesConfigUI.Panels.DatabaseSetupPanel.SetDatabaseConnectionTask(String connectionString, String server, String database, ConfigurationCredentialsType credsType, String account, String password, Boolean upgrade, String dbVersion)
got rid of my error about user login rights, it was all working yesterday. but for some reason i now get this error CREATE DATABASE permission denied in database 'master'. An attempt to attach an auto-named database for file C:InetpubwwwrootsqlSiteApp_DatasiteDB.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: CREATE DATABASE permission denied in database 'master'. An attempt to attach an auto-named database for file C:InetpubwwwrootsqlSiteApp_DatasiteDB.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SqlException (0x80131904): CREATE DATABASE permission denied in database 'master'. An attempt to attach an auto-named database for file C:InetpubwwwrootsqlSiteApp_DatasiteDB.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +734995 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1838 System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +33 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +628 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +170 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +359 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66 System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +496 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105 System.Data.SqlClient.SqlConnection.Open() +111 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +121 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +137 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +83 System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1770 System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +17 System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70 System.Web.UI.WebControls.GridView.DataBind() +4 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82 System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +69 System.Web.UI.Control.EnsureChildControls() +87 System.Web.UI.Control.PreRenderRecursiveInternal() +41 System.Web.UI.Control.PreRenderRecursiveInternal() +161 System.Web.UI.Control.PreRenderRecursiveInternal() +161 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360 i have this in my web.config file <connectionStrings> <add name="ConnectionStringTest" connectionString="Data Source=.SQLEXPRESS;AttachDbFilename=C:InetpubwwwrootsqlSiteApp_DatasiteDB.mdf;Integrated Security=SSPI;Connect Timeout=30;User Instance=False" providerName="System.Data.SqlClient" /> </connectionStrings> <appSettings /> <system.web> <!-- Set compilation debug="true" to insert debugging symbols into the compiled page. Because this affects performance, set this value to true only during development. --> <compilation debug="true" /> <identity impersonate="true"/> and my asp connection string is <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionStringTest %>" SelectCommand="SELECT [entryID], [compID], [emailAddy], [answer] FROM [entry]"></asp:SqlDataSource> if i set user instance to true i get a user permission error. it says on sql server management that i have dbo rights on my database, but it wont let me put datareader or write on this login. any ideas? its driving me insane
I need to grant select, insert, update, and delete permission to an object residing in Database "X" from a store procedure in database "Y". I have already tried USE database statement. Any suggestion. Thanks Maroof Khan
I have installed new SQLServer2012 instance and my domain user have sysadmin privileges on this instance. I have a restore procedure and it will execute WITH EXECUTE AS 'domainmy username', for all the developers have exec permissions to this procedure. But newly installed server this procedure was failing with the following message. But the same procedure executing fine on other servers.
Msg 262, Level 14, State 1, Line 1 CREATE DATABASE permission denied in database 'master'. Msg 3013, Level 16, State 1, Line 1 RESTORE DATABASE is terminating abnormally.
I want a database user to be able to alter login, database user and database role from my application. so, i assigned that user to sccurityadmin server role, db_accessadmin and db_securityadmin database roles....By now, the user can add or remove login and database user. However, the user cannot add or remove any database role membership. What am I missing here?? What should I do so that the user can create, and alter database roles in the database??
What are the differences between the database permissions, which can be granted in the database properties permissions tab (create table, create procedure etc.) and the predefined role db_ddladmin? It seems that the database properties permissions tab includes more permissions than the predefined role db_ddladmin.
Does anybody know the difference in terms of permission?
I'm using Visual Studio 2005 Pro and SQLExpress that comes with it.
I have my program running fine in XP Pro OS using a window user "Glen" (Computer administrator) with Administrator rights. This means that I installed VS 2005 using this window user "Glen"
I created another windows user "TestUser" (Limited account) in the same physical PC.
I tried to run the program and on the part that I need to access SQL table, I got the error [CREATE DATABASE permission denied in database 'master']
At the same time while using "TestUser" and running sqlcmd (to check if I can connect to SQL), I also got error HResult 0x2, Level 16, State 1.
I read alot on MSDN discussions and related links but it seems that I can't get the solution that I need.
SO HERE ARE MY QUESTIONS :
1. Am I allowed to run my program using user "TestUser" since SQL is installed using "Glen" windows user?
2. Do I need to add access rights to "TestUser" to allow the user to have CREATE rights? (Note : for security reason, I can add other access rights except Administrator)
I installed IIS Manager to my Vista PC and then SQL Server 2005 Express and SQL Server Management Studio Express using Windows Authentication. I could successfully connect to SQL Server. However, when I tried to create a new database, I got the error:
CREATE DATABASE permission denied in database ‘master’
I searched mant forums thru web about this error but could not find a resolution. I have BUILTINUsers and sa in the Logins under Security. But BUILTINUsers is not in any Server Roles. I tried to add it to public or dbcreator but was not allowed to do so, while sa is only in sysadmin.
I installed IIS Manager to my Vista PC and then SQL Server 2005 Express and SQL Server Management Studio Express using Windows Authentication. I could successfully connect to SQL Server. However, when I tried to create a new database, I got the error:
CREATE DATABASE permission denied in database ‘master’
I searched mant forums thru web about this error but could not find a resolution. I have BUILTINUsers and sa in the Logins under Security. But BUILTINUsers is not in any Server Roles. I tried to add it to public or dbcreator but was not allowed to do so, while sa is only in sysadmin.
I have an application that uses Integrated Windows authentication. My Web.config looks like below <add key="dbconnection" value=" server=XXX;Initial Catalog=XXX;persist security info=False;Integrated Security=SSPI;Pooling=true" /> When users try to access my application, they get the below error: Execute permission denied on object 'SprocName', database 'DBNAME',Owner,'dbo' The Only way I could get rid off the error is if I set DBO permissions for the user group on the databse. Can someone suggest how to set up a security group with the ‘necessary’ permissions on SQL SERVER (ie read,write execute Sproc etc) and not too many extra ones, like DBO. Thanks,
Could someone please tell me how I can trap permission errors invb.net on a stored procedure:ie. Execute permission denied on object 'sel_mytable', database'mydatabase', owner 'dbo'I would like to print a message likeresponse.write("You don't have permission to select on this table") asopposed to the cryptic message I am receiving.Thanks in advanceJulie Barnet
I need to do a security setup in SQL server 2000. the scenario is as follows:
In a team, only one person(Team Leader) should access the particular DB (through Enterprise Manager and rest of the persons in the Team(developers) should access through code.
Andy,I am new to SQL. It was hard just to figure out how to install it.I know I am logged in as a Admin. in Windows.I have the little server box with the round circle on it in the bottom rightcorner(toolbar). The SQL Server Service Manager.I tried to search for the sp_helpsrvrolemember command on my drive. It'snot on the server.Any ideas?Do anyone have any suggestions?Thanks for your help,T"Andy Svendsen" <andymcdba1@NOMORESPAM.yahoo.com> wrote in messagenews:#3883ky6DHA.2628@TK2MSFTNGP10.phx.gbl...[color=blue]> Are you connecting with a trusted connection or as sa. It sounds like you> do not have the access required to create a database. Make sure you are> connecting in as a member of the Administrators group on that machine so[/color]you[color=blue]> become part of the sysadmin (aka System Administrators) role. At a[/color]minimum[color=blue]> you need the dbcreator role level access. Running>> sp_helpsrvrolemember 'sysadmin'> -- or --> sp_helpsrvrolemember 'dbcreator'>> will tell you who belongs to these roles. Looking at the Query window[/color]title[color=blue]> bar will tell you who you are logged in as.>> <servername>.<database name>.<loginname> or <DOMAIN><username> (for Win[/color]NT[color=blue]> authentication)>>> Reboot and sharing the folder will not help. You might want to check the[/color]NT[color=blue]> permissions though.>> --> ************************************************** *****************> Andy S.> MCSE NT/2000, MCDBA SQL 7/2000> Join Bytes!>> Please remove NOMORESPAM before replying.>> Always keep your antivirus and Microsoft software> up to date with the latest definitions and product updates.> Be suspicious of every email attachment, I will never send> or post anything other than the text of a http:// link nor> post the link directly to a file for downloading.>> This posting is provided "as is" with no warranties> and confers no rights.>> ************************************************** *****************> "Taishi" <taishi_bak@hotmail.com> wrote in message> news:%23ZocZIy6DHA.2568@TK2MSFTNGP10.phx.gbl...[color=green]> > Windows Pro> >> > Receiving the following error:> >> > CREATE DATABASE permission denied in database 'master'. Could not attach> > database 'pubs' to file 'D:Program FilesMicrosoft SQL> > ServerMSSQL$NETSDKDatapubs.mdf'.> >> > Here are some things done to try to resolve the problem:> >> > Reboot 4-5 times> > Shared out the folder> > Web shared the folder> >> >> > Thanks for your help,> > T.> >> >> >[/color]>>[/color]
SQL Server 2005 anomoly? In SQL Server Management Studio I granted specific permissions to user "A" to do Select, Insert, Update, Delete on Table "B" - When I logged on as User "A" and attempted the Insert imto table "B" I got the following error: "Insert Permission Denied on Table B, Database C, Schema dbo" Is this a problem with the dbo schema?
Then I went back and created a stored proccedure "D" with the exact same Insert statement inside the procedure. I granted User "A" execute permission on the stored procedure "D". I then logged on as User A and executed Stored Procedure "D". No Problem - stored procedure executed fine with the Insert. I attempted the Insert statement again - straight SQL - as User "A" and got the same error as above ("Insert Permission Denied.....") Strange behavior - cannot do a SQL. Insert even though user has permissions but can execute a store procedure with the same Insert statement. What gives?
Hi all, I have my asp.net application with crystal reports which is using OLE DB connection , when I published the application on my test server every thing was ok and I was able to view,print and exprot my reprot (test server is not a domain controller), BUT when I published the application on the production server which is a domain controller it is giving me this error: Failed to open a rowset. Details: ADO Error Code: 0x Source: Microsoft OLE DB Provider for SQL Server Description: The SELECT permission was denied on the object 'MyTable', database 'MyDatabase', schema 'dbo'. SQL State: 42000 Native Error: Failed to open a rowset. Error in File C:WINDOWSTEMPMyreport {C4BCF4E0-469D-4425-8556-A3D2A17059B8}.rpt: Failed to open a rowset
I tried to give the IIS user all the permisions on the database, no result I tried also to make the authentication mode in IIS to Integrated windows authentication (Disable the user IISER_---) but it still give me the same error
i'm using SQLCacheDependency in my code. I have ran following lines to enable SQL notification.
ALTER DATABASE [DataBaseName] SET SINGLE_USER WITH ROLLBACK IMMEDIATE ALTER DATABASE [DataBaseName] SET ENABLE_BROKER ALTER DATABASE [DataBaseName] SET ARITHABORT ON ALTER DATABASE [DataBaseName] SET MULTI_USER WITH ROLLBACK IMMEDIATE In Global.asax file, i have protected void Application_Start(object sender, EventArgs e) { SqlDependency.Start(CONNECTION_STRING); } but whenever my application starts i get error saying "CREATE PROCEDURE permission denied in database", if i give dbo owner permission to SQL user then it works fine, but ofcource i dont want to give dbo owner permission to sql user defined in connection string
What is the correct way to create a security group that allows the group members to Select (Read) the content of a database?
1. Create a security group in AD 2. Add the required members to the group 3. Add the security group as a login on the SQL server (Under Security>Logins) 4. Add the security group to the specific database with Grant in Connect and Select
Database Connection - Don't have permission to open file
I'm trying to establish a connection to a database file (c: empMine.mdf) through visual studio c# express 2005 edition. I'm using the database explorer/add connection wizard. On the add connection dialog window when i browse and select the db file to connect to i'm getting the message "You don't have permission to open this file. Contact the file owner or an administrator to obtain permission"
I have SQL Server Express 2005 and SQL Server Management Studio Express installed. Within the management studio at the server security level i'm mapped to the db file (Mine.mdf) and have db_owner and public ticked and have also set the default database as Mine At the database security level under usersproperties i have also ticked db_owner. Also when i select properties for the db file itself it's telling me that i'm the owner.
I'm also using vista home premium edition and using windows authentication instead of sql server authentication.
I'm fairly new to all this so there may be something glaringly obvious i've missed!