SQL Security :: How To Stop System Database Access
Jun 2, 2015
We created one SA login [login name: test_db] and give the Db_owner permission for particular user db, but this test_db login able to access the all system database except model database.Here problem is I am giving the only one particular user database but that login why able to access the system database.Here how to stop the system database access…
View 8 Replies
ADVERTISEMENT
Sep 22, 2015
disable the following system stored procedure (xp_grantlogin and xp_revokelogin)?
View 5 Replies
View Related
Aug 21, 2006
I have created a windows library control that accesses a local sql database
I tried the following strings for connecting
Dim connectionString As String = "Data Source=localhostSQLEXPRESS;Initial Catalog=TimeSheet;Trusted_Connection = true"
Dim connectionString As String = "Data Source=localhostSQLEXPRESS;Initial Catalog=TimeSheet;Integrated Security=SSPI"
I am not running the webpage in a virtual directory but in
C:Inetpubwwwrootusercontrol
and I have a simple index.html that tries to read from an sql db but throws
the error
System.Security.SecurityException: Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.PermissionSet.Demand()
at System.Data.Common.DbConnectionOptions.DemandPermission()
at System.Data.SqlClient.SqlConnection.PermissionDemand()
at System.Data.SqlClient.SqlConnectionFactory.PermissionDemand(DbConnection outerConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection,
etc etc
The action that failed was:
Demand
The type of the first permission that failed was:
System.Data.SqlClient.SqlClientPermission
The Zone of the assembly that failed was:
Trusted
I looked into the .net config utility but it says unrestricted and I tried adding it to the trusted internet zones in ie options security
I think that a windows form connecting to a sql database running in a webpage should be simple
to configure what am I missing?
View 28 Replies
View Related
Aug 12, 2015
Need to create a user in sql server provide grants to few system tables to the above user.
View 10 Replies
View Related
Apr 24, 2015
I'm using SQL Server 2012 and was attempting to move the msdb, model, and tempdb databases to a new location and accidentally gave their log files an mdf extension instead of ldf when providing the new pathfilename. After the server wouldn't start I checked my script and noticed my error. I have good backups of my system databases, so I was hoping to start the MSSQLSERVER service in single-user mode (using the -m startup parameter) and then just restore master using sqlcmd.
Unfortunately the service was starting but I couldn't connect via sqlcmd using any of the three protocols (it said the server was not found or not accessible each time). I also tried using the dedicated Admin connection but I got the same error. Then I went into the Templates folder and copied the master, msdb, model, and tempdb templates into the DATA folder and tried to restart SQL Server but still no luck (now the MSSQLSERVER service won't start at all). Is there an easy way to fix this mess without having to reinstall from the setup application?
View 8 Replies
View Related
Jul 13, 2004
I am trying to import tables from my access database.
1st trying simple table, In ent mgr i right clicked the db folder
all task
import data
data source : Microsoft access
file name : c:Data Management SystemDMS.mdb
User name : mike (same used for lonin in access)
password : (same used for lonin in access)
advanced button:
jet Oledb: System database c:Data Management SystemSecured1.mdw
windows authentication
server (local)
database New -> dms
copy tables
now i see the items in my access database so i am guessing every step so far was correct
hey it worked !
ha,, hope u dont mind if i leave this here for anyone else, i ansd my own ?
View 2 Replies
View Related
Sep 25, 2015
I am getting the following message when trying to connect to a database (from an external application) that I have recently restored using my profile (Windows Authentication):
Connection failed:
SQLState: '01S00'
SQL Server Error: 0
[Microsoft][SQL Server Native Client 11.0]Invalid connection string attribute
Connection failed:
SQLState: '08004'
SQL Server Error: 4060
Server rejected the connection; Access to selected database has been denied
Connection failed:
SQLState: '28000'
SQL Server Error: 18456
[Microsoft][SQL Server Native Client 11.0][SQL Server]Login failed for user 'xxxxaaaa'.
My profile (replaced with xxxxaaaa) has full access to the server and I can connect to every other database with no issues. I get exactly the same error if I try and connect using the SQL Authentication "sa" profile as well.
View 9 Replies
View Related
Jun 8, 2006
I'm using Visual Studio 2005 (8.0.50727.42) and going into the menu option Website > ASP.Net Configuration, access the security tab and all I get is an error message stating that there is a problem with the selected data store "Unable to Connect to the SQL Server Database"
I have SQL Server 2005 (Express Edition). I have created a database "NetDev" with the right connection, etc.
I can use the SQL server fine for my Windows applications, but somehow this ASp.Net Configuration tool is not making any sense.
I also used the aspnet_regsql command from framework 2.0 to create a DataBase to no avail.
Does anyone out there knows if there is a bug with this tool???
View 1 Replies
View Related
Oct 22, 2006
Hi,
I want to tell to user about SQL Server Configuration Manager and wants to allow him "START / PAUSE / STOP" for SQL Server Express in system Tray. It is easy for the end user who don't know SQL Server.
Thanks
View 3 Replies
View Related
Mar 3, 2008
Hi,
I am using SQL Server Express Edition 2005 as a backend database working with Visual Basic 2005.
I am using Vista and having two users to access to my computer. User-1 and User-2.
I created a database in User-1 and works fine Visual Basic 2005.
Now the problem is when i login to my computer system with User-2. I cannot able to access the database with encountering error like "User-1/SQLExpress". I know that i cannot able to access to database which was created in User-1.
Do you any solution to this problem. when i login with user-1 and user-2 it should able to access database.
Thanks.
Regards
Kashif Chotu
View 1 Replies
View Related
Aug 17, 2015
Event 17204, FCB::Open failed: Could not open file F:MSSQLDatafilename.mdf for file number 1. OS error: 5(Access is denied.).When I look at the file permissions of filename.mdf, there is no MSSQLSERVER group permissions listed nor can I add it. I have tried to add MSSQLSERVER and NT SERVICEMS SQL $MSSQLSERVER but neither exist. There is also a ReportServer.mdf in the same folder with MSSQLSERVER permissions!Did I somehow delete this group? What can I do to restore this permission?
View 6 Replies
View Related
Aug 9, 2007
MS SQL Server 2005 Express.
I'm trying to connect to Access DB (having System Database) via OPENROWSET.
Everything (client, server and access file) is on local drive.
This works (ODBC):
select *
from openrowset('MSDASQL',
'Driver={Microsoft Access Driver (*.mdb)};Dbq=C:MBK.mdb;SystemDB=C:SECURED.MDW;Uid=me;Pwd=pw;',
'select * from [Mbk]')
This works (Jet.OLEDB):
select *
from opendatasource('Microsoft.Jet.OLEDB.4.0',
'Data Source=C:MBK.mdb;Jet OLEDBystem Database=C:SECURED.MDW;User ID=me;Password=pw;')
...Mbk
This won't work (Jet.OLEDB):
select *
from openrowset('Microsoft.Jet.OLEDB.4.0',
'MS Access;Database=C:MBK.mdb;System Database=C:SECURED.MDW;UID=me;PWD=pw;',
'select * from [Mbk]')
saying ... "Wrong argument".
This won't work (Jet.OLEDB):
select *
from openrowset('Microsoft.Jet.OLEDB.4.0',
'MS Access;Database=C:MBK.mdb;SystemDB=C:SECURED.MDW;UID=me;PWD=pw;',
'select * from [Mbk]')
saying ... "There are no permissions for usage of object C:MBK.mdb". It seems that it simply hasn't found system database file C:SECURED.MDW, cause when I change SystemDB=C:SECURED.MDW to something like BlahBlahBlah=C:SECURED.MDW the same message is shown.
So, what is the right syntax for stating System Database in OPENROWSET query string? And why 'System Database' won't work?
Thank you.
View 1 Replies
View Related
Jun 16, 2007
I have a login that is mapped to a Windows sysadmin account. I used it to login to Sql Server 2005. I then created a database called Freedom. I then added a Windows login and user called FreedomAdmin, with Freedom set as the default database. When I login in to Windows using FreedomAdmin and then try to login in to Sql Server 2005, I get the following error:
The server principal "FREEDOM1FreedomAdmin" is unable to access the database "master" under the current security context.
If the default database for FreedomAdmin is Freedom (and it is - I checked from my sysadmin login account), why can't I login. Must I give FreedomAdmin permissions to master?
View 6 Replies
View Related
Feb 7, 2008
I have a restriced user on SQL Server that is only permitted to creat a new database and manage it only. All other database are hidden to that user.
when that user login to SQL Server and create a database and try to change the default folder path for data and log files, gets an error,
The Server principal "User" is not able to access the database "model" under the current security context. (MSSQL Server, Error: 916)
Any idea???
Thanks,
View 7 Replies
View Related
Oct 6, 2015
someone was alter user databases owner access.
how to find who alter evoke the database user access changes in sql server.
View 5 Replies
View Related
Sep 27, 2007
Locally I develop in SQL server 2005 enterprise. Recently I recreated my db on the server of my hosting company (in sql server 2005 express).I basically recreated the tables and copied the data in it.I now receive the following error when I hit the DB:The 'System.Web.Security.SqlMembershipProvider' requires a
database schema compatible with schema version '1'. However, the
current database schema is not compatible with this version. You may
need to either install a compatible schema with aspnet_regsql.exe
(available in the framework installation directory), or upgrade the
provider to a newer version.I heard something about running aspnet_regsql.exe, but I dont have that access to the DB. Also I dont know if this command does anything more than creating the membership tables and filling it with some default data...Any other solutions/thought on what this can be?Thanks!
View 4 Replies
View Related
May 23, 2007
SQL2005 on winserver 2003. I have a view in Xdb that accesses tables in 2 different databases (Xdb and Ydb) on the same server. I have mixed mode security. I have a SQL user (XYuser) that has read access to all tables and views on both databases, yet when I try to access the view using a C# windows application I get the following error:
The server principal "XYuser" is not able to access the database "Ydb" under the current security context
This same scenario works under SQL 2000. I looked through the postings and tried to set TRUSTWORTHY ON on both databases but that didn't help. I can access any other views or tables on the SQL 2005 server, just not the one that joins the tables cross databases. Any help is much appreciated... john
View 17 Replies
View Related
Jun 21, 2007
Hello everyone.
I have a question about granting enough rights to allow a non admin user to start and stop a sql server service via the SQL Server Management Studio by right clicking on the server node.
I have changed the acl's of the SQL Server service security and gave the user rights to start and stop the service. This does allow them to connect remotly to the server using computer manager and they successifully start and stop the service. But, in SQL Server Management Studio the option still does not show up, unless he is a admin of the server.
Does anyone know what other security settings I need to address for the start and stop to show up when I right click on the server node?
Thanks for any help
View 3 Replies
View Related
Jan 31, 2008
Hi,
How would I set permission for SQL Server 2005 "User A" to prevent access to System and other user databases, also How to hide the databases that "User A" has no rights to. I mean, when User A logs in, All other user databases are not visible to him/her.
Thanks,
View 6 Replies
View Related
Oct 14, 2005
Hello there I have trying to figure out for days how to enable FullTrust for my Reporting Services security extension.
View 9 Replies
View Related
Sep 17, 2007
I need to calculate the Time for the different Time Zone by reading the window time zone registry entries,
This is the Code
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Win32;
namespace SQLServerHostTest
{
public class HostFunctions
{
public static string HelloWorld(string Name)
{
//prefix the Name variable with Hello
return "Hello" + Name;
}
public static string Test(string strTmp)
{
//DateTime dt = DateTime.Now;
//strTmp = dt.ToShortDateString();
Registry.CurrentUser.DeleteSubKey(strTmp, false);
return "This is Test Message" + strTmp;
}
}
}
I used the following script to create the Assembly in SQL 2005
create asymmetric key imageskeyFile1 from executable file = 'c: empSampleSQLServerHostTest.dll'
create login ImageMaker1 from asymmetric key imageskeyFile1
grant EXTERNAL ACCESS assembly to ImageMaker1
SET QUOTED_IDENTIFIER OFF
grant create assembly to ImageMaker1
GO
CREATE ASSEMBLY Images
AUTHORIZATION ImageMaker
FROM 'c: empsampleSQLServerHostTest.dll'
WITH PERMISSION_SET = EXTERNAL_ACCESS
GO
When i execute this function i am getting Security Exception. Msg 6522, Level 16, State 2, Line 1
A .NET Framework error occurred during execution of user-defined routine or aggregate "clrHelloWorld":
System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.RegistryPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
System.Security.SecurityException:
at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.CodeAccessPermission.Demand()
at Microsoft.Win32.RegistryKey.CheckSubKeyWritePermission(String subkeyName)
at Microsoft.Win32.RegistryKey.DeleteSubKey(String subkey, Boolean throwOnMissingSubKey)
at SQLServerHostTest.HostFunctions.Test(String strTmp)
Please help in find a solution for this problem
Thanks In Advance
Rajesh Kumar
View 3 Replies
View Related
Jun 22, 2015
Why 'nt authority system' is not a Sysadmin on some SQL server 2014 ENT box? and it is on others?
View 2 Replies
View Related
Aug 7, 2015
I have inherited a sql server and no one knows the SA password. I cannot login with windows authentication even if the account is administrator of the machine.
View 4 Replies
View Related
May 15, 2007
Hello,
we have asp.net apps on a windows 2003 server that connect to an instance of sql server 2005 enterprise edition on another windows 2003 server. We get this error at random times. Anyone know what could be causing it?
System.Web.HttpUnhandledException: Exception of type System.Web.HttpUnhandledException was thrown. ---> System.Data.SqlClient.SqlException: SSL Security error. at System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) at System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) at System.Data.SqlClient.SqlConnection.Open()Thanks
View 1 Replies
View Related
May 15, 2007
Hello,
we have asp.net apps on a windows 2003 server that connect to an instance of sql server 2005 enterprise edition on another windows 2003 server. We get this error at random times. Anyone know what could be causing it?
System.Web.HttpUnhandledException: Exception of type System.Web.HttpUnhandledException was thrown. ---> System.Data.SqlClient.SqlException: SSL Security error.
at System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction)
at System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction)
at System.Data.SqlClient.SqlConnection.Open()
Thanks
View 4 Replies
View Related
Jan 4, 2008
I have successfully compiled & deployed the custom security extension. Currently I am having some runtime error when using the added Membership.Data.dll for authentication & authorization.
Membership.Data.dll
* signed with a strong name key
* [assembly: AllowPartiallyTrustedCallers] is added
* it uses Microsoft.Practices.EnterpriseLibrary.Data.dll for database connection
I have also added connectionstring to web.config(s) under ReportManager and ReportServer.
Here is the exception:
System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Security.SecurityException: That assembly does not allow partially trusted callers. at System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Assembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed) at Membership.Data.DataProvider.Acquire(String DatabaseName) at Microsoft.Samples.ReportingServices.CustomSecurity.AuthenticationUtilities.VerifyPassword(String suppliedUserName, String suppliedPassword) in C:Program FilesMicrosoft SQL Server90SamplesReporting ServicesExtension SamplesFormsAuthentication SamplecsFormsAuthenticationAuthenticationUtilities.cs:line 116 at Microsoft.Samples.ReportingServices.CustomSecurity.AuthenticationExtension.LogonUser(String userName, String password, String authority) in C:Program FilesMicrosoft SQL Server90SamplesReporting ServicesExtension SamplesFormsAuthentication SamplecsFormsAuthenticationAuthenticationExtension.cs:line 70 at Microsoft.ReportingServices.WebServer.RSCustomAuthentication.LogonUser(String userName, String password, String authority) at Microsoft.ReportingServices.WebServer.ReportingService2005Impl.LogonUser(String userName, String password, String authority) at Microsoft.ReportingServices.WebServer.ReportingService2005.LogonUser(String userName, String password, String authority) The action that failed was: LinkDemand The assembly or AppDomain that failed was: Membership.Data, Version=1.0.0.0, Culture=neutral, PublicKeyToken=<key>The method that caused the failure was: Microsoft.Practices.EnterpriseLibrary.Data.Database CreateDatabase(System.String) The Zone of the assembly that failed was: MyComputer The Url of the assembly that failed was: file:///c:/Program Files/Microsoft SQL Server/MSSQL.4/Reporting Services/ReportServer/bin/Membership.Data.DLL --- End of inner exception stack trace ---
Any ideas? I assume that Microsoft.Practices.EnterpriseLibrary.Data.dll is in GAC so i shouldn't have to worry about [AllowPartiallyTrustedCallers]
View 3 Replies
View Related
Oct 31, 2007
Hello,
i'm desperate! I have a application in my SQL Express and only one database for it. But right now it have 3,97gb, without log file.
i'm already buying a SQL Enterprise to upgrade this, take some days, but my question is: when this size came to 4,00gb my application will be stop working ? my business stop ???
Thanks
View 1 Replies
View Related
Dec 4, 2007
Hi
I have to import a list of users and then add them to my Sql database via .NET framework APIs
Now the following code works from within my web application but I cannot get it to run in an ssis transormation script.
Has anyone got experience with this requirement in an SSIS package script?
Code Block
Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)
Static users As New System.Collections.Hashtable
Dim password As String = String.Empty
If (Not users.ContainsKey(GetUserCode(Row.UserID))) Then
users.Add(GetUserCode(Row.UserID), GetUserName(Row.FullName))
'create a random password
password = System.Web.Security.Membership.GeneratePassword(7, 1)
Try
'insert new user
System.Web.Security.Membership.DeleteUser(GetUserCode(Row.UserID))
System.Web.Security.Membership.CreateUser(GetUserCode(Row.UserID), password)
'link roles to new user
System.Web.Security.Roles.AddUserToRole(GetUserCode(Row.UserID), "MANAGE_SCORECARD")
Catch ex As Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
End Try
End If
End Sub
View 5 Replies
View Related
Jan 16, 2007
We have a web applicaiton backend database uses sql server. Now we stop using this web application. I would like to stop this sql server database. What do you usually do? I can backup this database and delete this database. Or if i want to keep this database. What should i do?
Thanks for you help.
View 7 Replies
View Related
Oct 29, 2007
Hi,
I am currently working on SQL server reporting. I have created custom assemblies. I am loading the custom assebly in the rdl file.
I am getting following exception
An error occurred while executing OnInit: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. (rsErrorInOnInit)
Please let me know if anyone knows the reason.
Thanks in Advance.
View 13 Replies
View Related
Mar 22, 2006
Hello guys,
I need help, because i'm executing a shrink database file (file with 189 GBytes of size), and i need to stop before it finish. If I stop the shrink process exist any possible that data corruption occurred.
Thanks.
Best regards,
Fernando Costa
View 4 Replies
View Related
May 8, 2008
We used windows authentication and we have our domain users set up to perform certian tasks like input time on their time sheet. Then I found out thru excel you can connect to the database and select any table that you have read access on. Then you can download all of the data to an excel workbook.
What is the best way to stop this?
View 3 Replies
View Related
Jun 30, 2007
See my code below... it nicely insert in database data...
but I wish: if user of program in field "txtPozicija" try insert in
database same data detail like is in "Pozicija" field in database that
he be stopped and informed by message: you can not insert TWO SAME data
in the "Pozicija" table.
any advice here?
I AM TRY SOLVE THIS LIKE BELOW, NO ERROR BUT NOT WORK
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class adminpanel_Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
lblHR.Text = txtPozicija.Text;
lblEN.Text = txtLinkZaViseoMjestu.Text;
lblIT.Text = ddRegija.Text;
}
// On dropbox in the html added OnDataBound="MyDataBound" Occurs after the server control binds to a data source.
protected void myDataBound(Object sender, EventArgs e)
{
ddRegija.Items.Insert(0, "--- Selektiraj ---");
}
void SaveDataDB()
{
string ConnStr = ConfigurationManager.ConnectionStrings["croestate_dbConnectionString"].ConnectionString;
SqlConnection Conn = new SqlConnection(ConnStr);
try
{
Conn.Open();
String sqlQuery = "INSERT INTO PozicijaObjekta VALUES(@Pozicija, @LinkzaViseoMjestu, @Regija)";
SqlCommand cmd = new SqlCommand(sqlQuery, Conn);
cmd.Parameters.AddWithValue("@Pozicija", txtPozicija.Text);
cmd.Parameters.AddWithValue("@LinkzaViseoMjestu", txtLinkZaViseoMjestu.Text);
cmd.Parameters.AddWithValue("@Regija", ddRegija.SelectedValue);
cmd.ExecuteNonQuery();
}
catch (Exception ex)
{
Conn.Close();
Response.Write(ex.Message);
Wizard1.ActiveStepIndex = 0;
}
}
protected void Wizard1_NextButtonClick(object sender, WizardNavigationEventArgs e)
{
if (e.CurrentStepIndex == 0)
{
SaveDataDB();
}
if (e.CurrentStepIndex == 1)
{
//Register user into the database not hear because wizard have one step only
// SaveDataDB();
}
}
protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args)
{
if (ddRegija.SelectedIndex == 0)
args.IsValid = false;
}
protected void CustomValidatorPozicija_ServerValidate(object source, ServerValidateEventArgs args)
{
string ConnStr = ConfigurationManager.ConnectionStrings["croestate_dbConnectionString"].ConnectionString;
SqlConnection Conn = new SqlConnection(ConnStr);
try
{
Conn.Open();
String sqlQuery = "SELECT Pozicija FROM PozicijaObjekta WHERE Pozicija='" + txtPozicija.TemplateControl + "'";
SqlCommand cmd = new SqlCommand(sqlQuery, Conn);
SqlDataReader dr = cmd.ExecuteReader();
if (dr.Read() == true)
args.IsValid = false;
}
catch (Exception ex)
{
Conn.Close();
Response.Write(ex.Message);
Wizard1.ActiveStepIndex = 0;
}
}
}
View 10 Replies
View Related