Accessing Database Users
Feb 8, 2007Hi,
I would like to know if there is any way of Accessing database users from frontend and changing their persmissions.
Thanks
Niranjana.
Hi,
I would like to know if there is any way of Accessing database users from frontend and changing their persmissions.
Thanks
Niranjana.
Hi,
I need a way to automatically generate a daily report of user names, time of access, and type of access (login, select, insert, update, delete, etc.) to a database.
We need to audit all accesses from all accounts to find out who is accessing the payroll system. We have already defined the security to be as tight as possible - however we need to monitor all Administrator accounts to ensure they are not being used to obtain sensitive information.
I have looked for some software to read the live SQL Transaction Logs, but none of the tools I have seen can do exactly what we require. For example, I've tried Lumigent Log Explorer (http://www.lumigent.com/products/le_sql.html), but it's not automated and the report output is just garble to our payroll staff.
I have looked up all Microsoft SQL Server partners but their software is all about data recovery and data reporting. We need Security Reporting.
I have created a general SQL Profiler trace that may suffice if everything else fails, but I still have no way of automating it - it relies on Real-Time monitoring which I can't trust (admin can turn this off, do their stuff, turn it back on). Also this is dependant on someone turning it off, save the log, turn it back on, every day - this person would be the Administrator - what admin would monitor themselves?
- SQL Trace seems like a good idea, how do I read the trace log file? How do I automate a trace?
- Can we automate the SQL Profiler to read the transaction log to find all accesses to a database?
- Does anyone know what we can do to automatically audit accesses to a database? What format can the report come in (pdf, xls, dbf, html etc.)
- Recommended software to try?
- Ideas for alternatives to try?
- Any companies/developers out there who know of a tool or are developing a tool to provide this sort of report?
- Is there a spec somewhere to let us write our own software to query the live transaction log?
Thanks, I appreciate any help.
Kind Regards
James Payne
IT Administrator
Is
there a way to find a list of Windows User accounts that are directly
or indirectly (through Windows Group membership) assigned to a database
role?
I could put work in to CLR programming or using a Linked Server to
Active Directory, but if there is a sys.* view available that can
provide me this
information directly it would be much easier.
I'll be looking into this further myself anyway and posting an answer
if I can find one, but if anyone has suggestions... well, thanks!
All,
I would like a report to display the number of users and the reports accessed for a certain duration of time[being able to go back and check for previous years as well].
I read on the msdn that 60 days worth of report log is kept,and the rest gets wipped off.Any suggestions on how I would be able to get user access list for the past year as well.
In SQL Server 2000 we had a view that would show the user credentials and the password hash. The reason we need this is that we use SQL Server authentication on the database. To test users, we have a login with little access, and it should be able to see the view and compare the password supplied against what is in the database, and then let the code handle a graceful exit if the password is invalid. I am trying to do this with SQL Server 2005, and I am running into trouble. I am trying to do this with a function, since there I can set the EXECUTE AS clause (in theory) and leverage the privlidges of a specific user in the database. Here is an example function:
CREATE FUNCTION check_acct.fn_allusers (@test int)
RETURNS @users table (username varchar(50), passwd varbinary(256))
WITH EXECUTE AS caller
AS
BEGIN
INSERT @users
select name, password_hash from sys.sql_logins
RETURN
END
GO
GRANT SELECT ON fn_allusers TO user_acct
I cannot get to all rows in the sys.sql_logins table unless I first:
GRANT VIEW ANY DEFINITION TO CHECK_ACCT
then when I call this function from CHECK_ACCT, I am able to see the data. If I change the WITH EXECUTE AS 'CHECK_ACCT' and execute thsi function from USER_ACCT, I do not get the same results. Do functions not inherit VIEW DEFINITION proivlidges? Any suggestions on how to do this but limit access to these secure objects to this one function?
Based on our database infrastructure, we need to secure our SQL databases. The security issue concerns on allowing a limited number of Domain Admin users to access the SQL databases.
We tried certain ways, based on the documents in the Microsoft web site, but we couldn€™t reach to the point of preventing the Domain Admin users accessing the SQL databases.
Thanks in advance.
Hi,
I'm trying to extract all the users and their membership to groups, and the membership of groups to groups from active directory though a link to server.
I can get the users. I can get the groups.... individually.
I can't get the info of what user is a member of or who are members of a group.
Anyone know how to do this or am I going to have to right a vb app? (Anyone already got the code...)
I want to load this data into tables for reporting in my Data Warehouse.
Cheers
Chris
I have had this issue just pop up. I have local users who can connect fine, but my users that require connection by VPN cannot connect. I get the server not available or access denied error. I did confirm that the VPN'ers are connected to the network correctly and can see that their shares and mappings are correct. Any ideas? Thanking you all in advance!!
View 6 Replies View RelatedHi Team,
In SQL Enterprise Manager, when we expand "Database -->Users", we see the
users there. When we expand "Security --> logins" we see the same users there.
Can you differentiate these two.
Thanks
Santhosh
I have an MVC asp.net application that stores many records in a table on sql server, in its own system. Â used the system for 2 months, worked fine accessing, changing data.
Now that other users are logging in? there is cross coupling going on. Â one user gets the data from another users sql search.
In the mvc app it had used the get async method to read the ID record from the db, i set that to synchronous. Â no effect; Â the user makes their own login id but that does nt matter either.
Hi,
In a stored procedure is there a way of accessing a table presend in another database.
Please provide pointers on how i can do this.
Thanks,
Raj
Hello,
I just switched to a host that allows database connections so that I can now upload my database to their server.
When I test my site on my personal PC it works great. I upload everything to the server and nothing. I know that I need to load the database to the server. I have Microsoft SQL Server 2005 Express and can make the connection but how do i load my database from my personal PC to the host computer?
I would be greatful if someone was able to walk me thou the steps on how to transfer the database. I am really very new with the database thing and ASP.
Thank You
Chris
Anybody figure a way around this:
In a development server you take a backup and you want to move the entire database to a production server. The production server does not contain the database, users, or logins in master.
When you restore the backup to production in 7.0, the users get moved to DBO because the logins do not exist and then you cannot delete them.
We are having to drop the users from the database on development, back up the database and restore it to production, then recreate the users on production.
This is bogus and did not happen in 6.5 because of the aliases.
Anybody come up with a better way?
Hello Everyone,
Is it possible to write a query that can access data in differnt database so I have "trainee" and "training" databases. In want to access one training table in trainee database through a query. How can I do this.
Thanks.
Hay there,I have an asp.net project website with an sql Database. I need to access this same database from another project (a class library that needs to access this database). In fact i want to be able to use the tableadapters that I have implemented for my database in this new class library.. I guess it has to do something with making my database not part of the website but and independemt entitiy that can be seen by others..... I cannot seem to find a way to do that can anyone help meee ????Thanks for your time!
View 6 Replies View RelatedHello friends when I am working in VWD and accessing sql data this error came?I am using asp.net visual web developer edition and sql server 2005 expressedition. plz check it out and help me.The log scan number (588:85:1) passed to log scan in database
'D:GCAPAPP_DATAGRIET_IT.MDF' is not valid. This error may indicate data
corruption or that the log file (.ldf) does not match the data file (.mdf). If
this error occurred during replication, re-create the publication. Otherwise,
restore from backup if the problem results in a failure during startup.
Could not open new database 'D:GCAPAPP_DATAGRIET_IT.MDF'. CREATE DATABASE
is aborted.An attempt to attach an auto-named database for file
D:GCAPApp_DataGRIET_IT.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: The log scan number (588:85:1) passed to
log scan in database 'D:GCAPAPP_DATAGRIET_IT.MDF' is not valid. This error
may indicate data corruption or that the log file (.ldf) does not match the data
file (.mdf). If this error occurred during replication, re-create the
publication. Otherwise, restore from backup if the problem results in a failure
during startup. Could not open new database 'D:GCAPAPP_DATAGRIET_IT.MDF'.
CREATE DATABASE is aborted.An attempt to attach an auto-named database for
file D:GCAPApp_DataGRIET_IT.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): The log scan number (588:85:1) passed to log scan in database 'D:GCAPAPP_DATAGRIET_IT.MDF' is not valid. This error may indicate data corruption or that the log file (.ldf) does not match the data file (.mdf). If this error occurred during replication, re-create the publication. Otherwise, restore from backup if the problem results in a failure during startup. Could not open new database 'D:GCAPAPP_DATAGRIET_IT.MDF'. CREATE DATABASE is aborted.An attempt to attach an auto-named database for file D:GCAPApp_DataGRIET_IT.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) +171 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +199 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2406 System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +34 System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +223 System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +371 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +184 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +193 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +501 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +429 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +70 System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +510 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +85 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +89 System.Data.SqlClient.SqlConnection.Open() +159 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +118 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +139 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +82 System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1653 System.Web.UI.WebControls.ListControl.OnDataBinding(EventArgs e) +82 System.Web.UI.WebControls.ListControl.PerformSelect() +18 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +68 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +61 System.Web.UI.WebControls.ListControl.OnPreRender(EventArgs e) +26 System.Web.UI.Control.PreRenderRecursiveInternal() +88 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5684
Version Information: Microsoft .NET Framework Version:2.0.50727.832;
ASP.NET Version:2.0.50727.832
Hi There !!
CAn you please help me to solve my probelm and i will appreciate it if you help me. I installed SQL server on my machine and i installed tables in a database called "otters" when i run the application, i got an error message on the browser as shown below although in the application it says that it recognise the source of the dastabase. CAn you please help me to sort out tis problem and please try to look back to this thread after givingf me the soultion as it might not work and i need more assistant. I really, appreciate your help and thank you in advance. Please read the error message below
**************************************************
Server Error in '/Otters' Application.
--------------------------------------------------------------------------------
SQL Server does not exist or access denied.
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: SQL Server does not exist or access denied.
Source Error:
Line 403: Dim conn As New SqlConnection(connStr)
Line 404: cmd.Connection = conn
Line 405: conn.Open()
Line 406:
Line 407: ' Allocate an empty array list to hold the performance objects found
Source File: C:CSE506TheaterPerformance.vb Line: 405
Stack Trace:
[SqlException: SQL Server does not exist or access denied.]
System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction)
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction)
System.Data.SqlClient.SqlConnection.Open()
Theater.Performance.Find(SqlCommand cmd) in C:CSE506TheaterPerformance.vb:405
Theater.Performance.FindByDateRange(DateTime st, DateTime et) in C:CSE506TheaterPerformance.vb:369
Otters.admin.Page_Load(Object sender, EventArgs e) in C:InetpubwwwrootOtterssecureadmin.aspx.vb:67
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET
--------------------------------------------------------------------------------
I'm developing a VB app to manipulate data in a table. I've created an SQL server (local) and have successfully connected to and manipulated data in a database that I created. I would like to be able to run the app on another machine and connect to the same server. I'm having trouble determining what the server name is. Tried a few things but get the "server does not exist" message. Server is set to authenticate SQL server and windows.
Is this happening because my server is (local)? If so how do I change it to permit remote access?
Any assistance would be appreciated.
hey!Im looking for a db tutoral which covers accessing a Microsoft SQL databaseon windows. I will be using VC++ if it matters. NO details just a basicintroduction!Oracle DB access using C++ is also of interest!Thanks!-- Majk
View 1 Replies View RelatedI have a MSSQL database from a pre-existing app. The data files do not have an MDF exension, they have a .dat extension. I can however use Microsoft SQL Server Management Studio Express to run queries against the files, but I can not get VB 2005 to connect. When I attemp to add it as a project data source, I get the following error:
"An attempt to attach an auto-named database for file c:dataMSSQL$DATA_SQL....dat* failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share."
*Database names = company names are omitted to 'protect the innocent'.
Does anyone have any ideas? Since Microsoft SQL Server Management Studio Express worked so cleanly with the database I was expecting to easily get to the same data using VB.
Hi,
I have an sql express server which contains a single database. Three users access this database using a C# application I have writen. I use Integrated Security for these three users.
The problem is that one of my users wishes to use my application from home.
What are my options in letting this user use my application from home?
Thanks for your help,
Barry.
Hi,
I'm a hobby C# programmer, and when at university there are a few machines that have SQL Server 2005 installed on them (i think it's standard ed).
From looking around at sql 2005 free edition and DNN (dot net nuke) it's apparently possible to have the database file in the execution directory of your application.
My question is this, if i have a C# win app, is in possible for me to store the database files, in the executable directory of that app, and not in the default sql database store of C:prog filessql server90 data etc...?
Ie, what i want to do, is for the C# win application on start up to "mount" the database, use it normally like any other sql database, and then "unmount" it at the end.
The reason for "mounting" and "unmounting" is that i don't want the database to be accessible or even visible to sql server when the c# app isnt running.
I hope I've explained myself clearly, and thanks a lot in advance.
pro-logic
Let's assume we have 2 databases db1 & db2
and we have a table named "MyTable" which is located in db2 database
in the db1 database I create a stored procedure by using following code:
<<
use db1
create procedure myproc
as begin
select * from db2.dbo.MyTable
end;
>>
this code does not execute successfuly and I face an error which says << invalid object db2.dbo.MyTable>>
and as you know we are not allowed to use USE database key word in stored procedures
I can's access a table which is located in another database, whithin a stored procedure which is located in different data base but on the same server
thanks
hi there,
After replicating a database, the stored procedures in that same database are not able to edit by other users than service account (sys admin users), When the normal users try to edit any of the stored procedures, sql server 2005 is throwing the following error...
Msg 21050, Level 16, State 1, Procedure sp_MSmerge_ddldispatcher, Line 12Only members of the sysadmin fixed server role or db_owner fixed database role can perform this operation. Contact an administrator with sufficient permissions to perform this operation.
any suggessions are most welcome.
by
CHINNASAMY
After I uploaded my web page and my sql database to my server I get the following error: Exception Details: System.Data.SqlClient.SqlException:
Could not open new database
'dsyfa.dnh.sk_0254bfa0-5525-4634-bee7-1b99fd021b34'. CREATE
DATABASE is aborted.Could not attach file
'I:DataWebdnh.skdsyfa_78676f0b-4b12-4502-8792-5141335ef179wwwApp_DataGamesDB.mdf'
as database 'dsyfa_0254bfa0-5525-4634-bee7-1b99fd021b34'.File
activation failure. The physical file name "F:My StuffSoftware
DevelopmentC#ATLASProjectsGameSiteApp_DataGamesDB_log.LDF" may be
incorrect.The log cannot be rebuilt when the primary file is read-only.Why is it referring to F:My StuffSoftware
DevelopmentC#ATLASProjectsGameSiteApp_DataGamesDB_log.LDF?? This location exists in my PC. How do I change it? I uploaded my mdf file using FileZilla FTP client. Where am I going wrong?? I'm using the connection string given me to me by the hosting service. Here's the code:<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|GamesDB.mdf;Integrated Security=True;User Instance=True" SelectCommand="SELECT [GameId], [GameTitle], [Rating], [Genre], [Location] FROM [Games]"></asp:SqlDataSource> <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False" DataKeyNames="GameId" DataSourceID="SqlDataSource1"> <Columns> <asp:BoundField DataField="GameId" HeaderText="GameId" InsertVisible="False" ReadOnly="True" SortExpression="GameId" /> <asp:BoundField DataField="GameTitle" HeaderText="GameTitle" SortExpression="GameTitle" /> <asp:BoundField DataField="Rating" HeaderText="Rating" SortExpression="Rating" /> <asp:BoundField DataField="Genre" HeaderText="Genre" SortExpression="Genre" /> <asp:BoundField DataField="Location" HeaderText="Location" SortExpression="Location" /> </Columns> </asp:GridView> Any help would be appreciated.
I have not been able to find a code example anywhere. Someone please post the code to do this. I would be forever grateful.
I would like the code to be in C#. I want to connect to a database and then select all from a table.
thanks
I'm writing an web app in VS2005.
I've created a product.mdf database through VS2005's Server Explorer (to my knowledge, I'm not using Sql Express). (Side question. The .mdf files are a stand alone xml structure used as a database, correct?).
When I execute locally, everything works great. But when I moved my code to where it is being hosted (remote computer). It's throwing the following error:
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
This is my connection string:<add name="MyConnectionString1" connectionString="Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|Product.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
What is my problem?
I was wondering if you guys know of a good site that talks about programmatically accessing and displaying data from a sql server 05 database in ASP.NET 2.0.I want to have a data adapter in a dataset, but I would like to create my own class file and pull the data from the adapter through code into the class. Is this the best way? Im wondering about the best practices while learning this new technology. Any articles provided would be appreciated. Thanks!
View 2 Replies View RelatedI have written 5 content-management systems and am getting a little bored writing a lot of the same functionality and tweaking it for different datamodels. Is there a way within .NET to have visibility of a database's structure (ie, data type, column names, foreign keys etc)? I'd like to write up a dynamically generated form for any given table, displaying appropriate form controls based on data type and foreign keys.
View 7 Replies View RelatedI've downloaded a copy of Microsoft SQL Server Management Studio Express from MS. Can this product be used to query an SQL database at a web site.
Conversely, is there a command line utility for running SELECT statement queries on my remote web site database?
Hi. I have a database online. I have to run some scripts, and check out my database. The ISP i have, has currently changed the IP address for the database, now I can not hook up with it via Enterprise Manager. Can someone help me. I am using Microsoft ME as the platform.
View 1 Replies View Relatedhi guys. can you please provide tutorial/link how to access two database in one view. i was thinking about LINK TABLE like what i do in ms access but i find solution in sql server.
thnx.
hi
i have stored procedure and i need to access another database in my stored procedure
I'm going to query a table which is located in another database
as you know it is impossible to use the USE database keyword in stored procedures
so what should I do?
thanks.