Read Only Access To All Databases On A Server

Jan 18, 2008

Hi,
How can I provide a user read only access to all the databases on the server. I have 15 databases on the server. I know I can give db_datareader access in each database individually but that is time consuming and I have 10 servers for this to be done.

thanks in advance.

View 3 Replies


ADVERTISEMENT

Access For Users To SQL Server Read Only

Jan 29, 2001

I have SQL Server 7 database & I need to create some interface between users & database to let users see what is in the database, but not let them change or destroy data. Do I need to create some other database in-between users & the original database? Users can't program & want access to all data.management doesn't want to create a replication of the database. They want to let users have access through MS Word or Access. What could you advise me?

View 1 Replies View Related

SQL Server Express, ODBC, Microsoft Access Sees Data Read-Only

Feb 13, 2006

Hi there,

I have successfully installed SQL Server Express.

I have copied NorthWind to SQL Server.

I have created an ODBC to the SQL NorthWind.

But my problem is, I open the data but I cannot edit or insert records

to the Customer table.

I have gone into SQL Management Studio and modified Permissions

on NorthWind and the Customer table with Alter, Insert, Update.

But no luck.

Has anyone experienced this?

Email me at justintoronto@hotmail.com if you have a solution.

I will try to check back here also.

Thanks,

Justin

View 1 Replies View Related

Read Only Databases

Mar 26, 2007

ok when i upload my databases that i created in VS2005, they are read only.
 so i though something was just funny, so i installed sql managment studio on the server and attached the databases, and when i attached them there grey with (READ-ONLY) displayed... how can i get my DB's out of read only! i tryied going through the properties of the DB through MSSQL managenet studio but that only generates an error...
 any ideas!

View 3 Replies View Related

Databases In Read-only

Jun 25, 2007

We have a client with several databases in read-only mode. When we try and take the dbs out of read-only, we get the path to the mdf files may be incorrect, which they are not. SQL 2000, SP3a. Has anybody seen this? The files themselves are not read-only, I gave the network services account full control and still nothing. The issue started when the client lost power, lasst week, the dbs came up suspect. Detach/Attach brought them back up in single user.

Any hep is appreciated.

View 3 Replies View Related

SQL Server 2008 :: Create Authentication Account With Read-write Access To Only 1 Table?

Apr 7, 2015

How can I create a SQL authentication account with read-write access to only 1 table in a SQL database.

View 1 Replies View Related

SQL Server Admin 2014 :: Grant User Read Access To Secondary Replica?

Sep 15, 2015

I have 3 servers taking part in an AlwaysOn AG.

I want to grant a user READ access to only one replica, and certainly not to the principle.

How do I go about doing this?

View 4 Replies View Related

Importing Access Databases Into SQL Server

Jul 23, 2005

Hi there,I have a situation where an application needs to import data fromnumber of access mdb files on a daily bases. The file names changeevery day. The data import is very straight forward:insert into sql_table select * from acess_tableThere are up to 8 tables in each access file and some access files willhave less. So the process needs to figure out which tables exist inAccess mdb file and import them whole into sql staging tables.Any recommendations are appreciated.Thanks

View 2 Replies View Related

How To Backup Read-Only Databases

Jul 23, 2005

Hello,Can anyone tell me how to backup read-only databases? I want to backupthe secondary databases in my log shipping pairs.Thanks,TGru*** Sent via Developersdex http://www.developersdex.com ***Don't just participate in USENET...get rewarded for it!

View 6 Replies View Related

Lost Server Registration! Cannot Access Databases!

Jun 13, 2002

I have a test server where I was experiencing security/rights anomalies. I tried disabling the BUILTINAdministrators account, closed SEM, and when I reopened it, I could not access my Server (all databases,etc.are on local machine). I thought I could just use the SQL accounts (sa, etc.) to connect, but they all fail?? I tried creating a new registration, and that didn't work either. Since I deleted the old registration, and I cannot reconnect, what are my options(short of restoring image)? If I re-install SQL will all my databases still be there? Is there another way to get access back?? Any help would be appreciated.

rob

View 3 Replies View Related

SQL Server 2008 :: Grant Access To All Databases

Nov 18, 2010

I have around 600 databases in my server, a user need select access of all the databases. will i have to go one by one in all the dbs and create that user and give datareader role to him. or is thr any shorter way to do so????

View 8 Replies View Related

SQL Script To Add A SQL Server Login That Can Access All Databases

Mar 8, 2008


Dear all,

I wrote the below script to add a SQL server login account that is the db_datareader, db_datawriter, and granted permission on all stored procs, functions, and views on all databases within a server.



Code Snippet
USE master
GO
SET NOCOUNT ON
DECLARE @database_name sysname
DECLARE @object_name sysname
DECLARE @object_type char(2)
CREATE TABLE #databases (DATABASE_NAME sysname, DATABASE_SIZE int, REMARKS varchar(254))
INSERT #databases EXEC sp_databases
-- ++++++++++++++++++ add SQL Server Login ++++++++++++++++++
IF EXISTS (
SELECT 1 FROM master.dbo.syslogins
WHERE [name] = 'WEB_USER2'
) BEGIN
DECLARE db_cur CURSOR LOCAL FAST_FORWARD FOR
SELECT DATABASE_NAME FROM #databases
OPEN db_cur
WHILE 1 = 1
BEGIN
FETCH db_cur INTO @database_name
IF (@@FETCH_STATUS <> 0) BREAK
EXEC ('USE ' + @database_name +';
IF EXISTS (
SELECT 1 FROM sysusers
WHERE [name] = ''WEB_USER2''
) BEGIN
EXEC sp_revokedbaccess ''WEB_USER2''
END
')
END
CLOSE db_cur
DEALLOCATE db_cur
EXEC sp_droplogin 'WEB_USER2'
END
EXEC sp_addlogin
@loginame = 'WEB_USER2',
@passwd = 'password'
-- ++++++++++++++++++ loop thro' all User-Databases ++++++++++++++++++
DECLARE db_cur CURSOR LOCAL FAST_FORWARD FOR
SELECT DATABASE_NAME FROM #databases
WHERE DATABASE_NAME NOT IN ('master', 'model', 'tempdb', 'msdb', 'distribution', 'ASPState')
OPEN db_cur
WHILE 1 = 1
BEGIN
FETCH db_cur INTO @database_name
IF (@@FETCH_STATUS <> 0) BREAK
PRINT ''
PRINT 'Current database=' + @database_name
-- add user to databases
EXEC ('USE ' + @database_name +';
IF EXISTS (
SELECT 1 FROM sysusers
WHERE [name] = ''WEB_USER2''
) BEGIN
EXEC sp_revokedbaccess ''WEB_USER2''
END
')
EXEC ('USE ' + @database_name +'; EXEC sp_grantdbaccess ''WEB_USER2''; ')
-- add user to db_datareader
EXEC ('USE ' + @database_name +'; EXEC sp_addrolemember ''db_datareader'', ''WEB_USER2''; ')
-- add user to db_datawriter
EXEC ('USE ' + @database_name +'; EXEC sp_addrolemember ''db_datawriter'', ''WEB_USER2''; ')
-- grant permission on Stored proc, Scalar function, Inlined table-function, Table function, View
-- !! coz EXEC is a self-contained batch, so must use GLOBAL
EXEC('USE ' + @database_name +';
DECLARE obj_cur CURSOR GLOBAL FAST_FORWARD FOR
SELECT [name], [type] FROM sysobjects
WHERE [type] IN (''P'', ''FN'', ''IF'', ''TF'', ''V'')
')
OPEN obj_cur
WHILE 1 = 1
BEGIN
FETCH obj_cur INTO @object_name, @object_type
IF (@@FETCH_STATUS <> 0) BREAK
-- PRINT 'object=' + @object_name + '; type=' + @object_type
IF LTRIM(RTRIM(@object_type)) = 'P' OR @object_type = 'FN'
BEGIN
-- EXEC on Stored proc, Scalar function
EXEC('USE ' + @database_name +'; GRANT EXEC ON dbo.' + @object_name + ' TO WEB_USER2 ')
END
ELSE
BEGIN
-- SELECT ON table function, View
EXEC('USE ' + @database_name +'; GRANT SELECT ON dbo.' + @object_name + ' TO WEB_USER2 ')
END
END
CLOSE obj_cur
DEALLOCATE obj_cur
END
CLOSE db_cur
DEALLOCATE db_cur

DROP TABLE #databases





plz revise it if you have better idea! Thx!

View 4 Replies View Related

Is SQL Server Express A Replacement To MS Access Databases?

Feb 27, 2008

I have a small client installable web application which used to work great on 32 bit machines. Well now clients are starting to use x64 Windows 2003 servers and things have begun to unravel. W2K3 x64 does not have any of the JET database drivers needed to communicate to the Access databases and it doesn't look like they're coming anytime soon.

Is SQL Server Express the new replacement for Access databases on x64 machines. Does Microsoft intend on moving some of the JET drivers over from 32 bit servers. I know that you can run IIS in 32 bit mode and everything is fine, but I can't ask everyone to do that.

Is SQL Server Express something that I can expect people to have installed, it sure doesn't sounds like it. After reading some posts, it sounds like it's a bit of a hastle to install.

Thanks in advance for your time.

-Mark

View 3 Replies View Related

Databases Starting Up In Read-only Mode.

Jul 25, 2000

Hi,

About a month ago, a couple of our databases started up in read-only mode for some reason. I am the new DBA on the job, and the error logs from a month ago are not present.

I was wondering if anyone has had a problem where a SQLServer 7.0 database did this to them? We restart our DBs each day using scripts, so it is odd that this happens only intermittently (no one has seen a pattern at this point).

Any information would be muc appreciated!

Thanks,

Joe

View 4 Replies View Related

Denormalization, 2 Databases , 1 Read 1 Write Db

May 28, 2008

Hi,
I was reading that many of these high traffic websites actually have 2 databases, 1 database is used ONLY for reads, while the other is for writes.

How does one go about creating such a setup? How does the database where writes are allowed replicated the data to the read only database server?

View 1 Replies View Related

Cant Restore SQL Server Databases: Exclusive Access Could Not Be Obtained

Jul 7, 2007



Hi everyone,



Hope somebody can help me on this.



I did a full BACKUP for two SQL databases using SQL Server Managament Studio. When trying to RESTORE the DBs, I get the following error:



"System.Data.SqlClient.SqlError: Exclusive access could not be obtained because the database is in use. (Microsoft.SqlServer.Smo)"



There are NO users using the application. These are DBs for the Portfolio Server 2007 application.



After exploring a little bit, I found that there are several "SLEEPING" processes with an "AWATING COMMAND" flag. The processes come from the Portfolio Server Application, maybe from previous sessions.



Can they be deleted? if so, would there be any serious consequences?



Thank you for your help on this.



Oscar E.

View 4 Replies View Related

Recovery :: How To Manage Data Latency On Read-only AlwaysOn Databases

Aug 27, 2015

We have several read-only nodes in our AlwaysOn cluster, which are set to use Synchronous-commit mode, which ensures that the logs are updated on the read-only nodes before any update statements complete.  Even with this option, if we query a read-only node before the logs have been processed, we can read old data.  I would like to know a strategy to ensure that a read-only query will definitely return up to date information.  I had an idea that if I just used a different transaction type, like Serializable, that it might block the read-only query from actually getting the data until after the log file was processed, but I have not tried it, yet.

I would like to move more queries to the read-only nodes, in an effort to offload CPU utilization from the primary node.

View 2 Replies View Related

Transact SQL :: Making Server Database Read / Write From Read Only

Jan 12, 2012

i attached adventure works in sql server 2008 and it showing as read only ,make it read write or remove read only tag from database.

View 11 Replies View Related

Read Text File From SQL Server, Read Its Content, And Load It In RichTextBox (Related Component: Context.Response.BinaryWrite(), And StreamReader)

Nov 26, 2007

OBJECTIVE: I would like to read a text file from SQL Server 2000, read the text file content, and load its conntents in a RichTextBoxTHINGS I'VE DONE AND HAVE WORKING:1) I've successfully load a text file (ex: textFile.txt) in sql server database table column (with datatype Image) 2) I've also able to load the file using a Handler as below: using System;using System.Web;using System.Data.SqlClient;public class HandlerImage : IHttpHandler {string connectionString;public void ProcessRequest (HttpContext context) {connectionString = System.Configuration.ConfigurationManager.ConnectionStrings["NWS_ScheduleSQL2000"].ConnectionString;int ImageID = Convert.ToInt32(context.Request.QueryString["id"]);SqlConnection myConnection = new SqlConnection(connectionString);string Command = "SELECT [Image], Image_Type FROM Images WHERE Image_Id=@Image_Id";SqlCommand cmd = new SqlCommand(Command, myConnection);cmd.Parameters.Add("@Image_Id", System.Data.SqlDbType.Int).Value = ImageID;SqlDataReader dr;myConnection.Open(); cmd.Prepare(); dr = cmd.ExecuteReader();if (dr.Read()){ //WRITE IMAGE TO THE BROWSERcontext.Response.ContentType = dr["Image_Type"].ToString();context.Response.BinaryWrite((byte[])dr["Image"]);}myConnection.Close();}public bool IsReusable {get {return false;}}}'>'>
<a href='<%# "HandlerDocument.ashx?id=" + Eval("Doc_ID") %>'>File
</a>- Click on this link, I'll be able to download or view the file WHAT I WANT TO DO, BUT HAVE PROBLEM:- I would like to be able to read CONTENT of this file and load it in a string as belowStreamReader SR = new StreamReader()SR = File.Open("File.txt");String contentText = SR.Readline();txtBox.text = contentText;BUT THIS ONLY WORK FOR files in the server.I would like to be able to read FILE CONTENTS from SQL Server.PLEASE HELP. I really appreciate it.

View 1 Replies View Related

MS SQL Read MS Access Database

Aug 29, 2006

I have an existing MS SQL 2005 server which is used to maintain data that has been collected from various sources around a plant. A new system has been added on our network where the data is provided in a daily MS Access database. The name of the MS Access database changes every day.

I would like to use the job manager to run a Stored Proc every night to extract the daily data from the MS Access database. Is there any way to do this.

Regards, Eric

View 1 Replies View Related

How To Fix The Can't Access Database Because Its Read Only Problem

May 31, 2007

The error comes up like this -

System.Data.SqlClient.SqlException .... because the database is read-only

( I'm putting this here so searches can find it easier)



I got this idea from a related thread, but they used a NETWORK user that is obsolete in 2007.



I found that you have to edit the actual file properties on the ASPNETDB.MDF and ASPNETDB.LDF files so that the ASPUSER has full access. i.e. on the file properties, security tab, hit the Add button and type in ASP.NET then return. Back at the security properties, click on the 'Full Control' checkbox at the top. That took care of it for me.


This was after checking the IIS control panel for the properties on the folder that contained my application and App_Data folders to be sure that the "Write" checkbox was already checked, it was

Of course this assumes that you have installed the express version of SQL from Microsoft

View 2 Replies View Related

How Can I Create Account With Read Only Access?

Feb 5, 2008



Hello,
We have SQL Server 2005 with 300+ databases in it. It was set up by the conractor. How can I create new account with read-only access to all databases? Is there any "quick" method of doing it (like in Sybase, it is very easy). I've created new login, but I do not see where can I set up the permissions properly. Thanks

View 8 Replies View Related

Import Data From MS Access Databases To SQL Server 2000 Using The DTS Import/Export

Oct 16, 2006

I am attempting to import data from Microsoft Access databases to SQL Server 2000 using the DTS Import/Export Wizard. I have a few errors.

Error at Destination for Row number 1. Errors encountered so far in this task: 1.
Insert error column 152 ('ViewMentalTime', DBTYPE_DBTIMESTAMP), status 6: Data overflow.
Insert error column 150 ('VRptTime', DBTYPE_DBTIMESTAMP), status 6: Data overflow.
Insert error column 147 ('ViewAppTime', DBTYPE_DBTIMESTAMP), status 6: Data overflow.
Insert error column 144 ('VPreTime', DBTYPE_DBTIMESTAMP), status 6: Data overflow.
Insert error column 15 ('Time', DBTYPE_DBTIMESTAMP), status 6: Data overflow.
Invalid character value for cast specification.
Invalid character value for cast specification.
Invalid character value for cast specification.
Invalid character value for cast specification.
Invalid character value for cast specification.

Could you please look into this and guide me
Thanks in advance
venkatesh
imtesh@gmail.com

View 4 Replies View Related

Read Only Access / DB List In Enterprise Manager

Mar 31, 2008

Hi guys,
I want to give someone read only permission to our SQL server so they can log in and look at the database structure and query a few tables. I've set up the user but the problem is that when I connect in SQL server remotley, it shows all the other DB's on the server even though it is restricting access to them. Can these other DB's be hidden so that only the DB the user has access to shows up?

Cheers for your help!

View 9 Replies View Related

Strange Issue With SQL Table Read Only In Access

Apr 21, 2006

I have a data file that I converted from Access to SQL Server using theupsizing wizard. I then attached the tables to the Access front end using anODBC connection. I have one table that is read only for some reason. I'mnot sure how that happened, it went through the same procedures as the othertables in terms of upsizing and connecting. The original table was not readonly or hidden or anything else, it had full permissions.I've tried disconnecting and reconnecting the table but still the samething. In SQL Server, the permissions are the same as all the other tables.I can't seem to figure out what's making this one read only.I'm using SQL Server 2005 Express and Access 2003. Any ideas would begreatly appreciated.Thanks!

View 11 Replies View Related

How A Storied Procedure Can Read A Table In MS Access?

Sep 5, 2007

Hi,
We currently use an access database to manipulate data in tables on a SQL server. The end user copies a list of ProjNo from a spreadsheet into an Access table. The Access table is used as the criteria for 5 Access queries. It is common that one of the queries does not get run.

I figured I would create a Storied Procedure on the SQL server, call the storied procedure from MS Access using the MS Access table as the criteria to run the Storied Procedure. I do not know how to provide the Storied Procedure the ProjNo in the MS Access table. The number of ProjNo records in that table can vary.

I've found info on how to add one record at a time but I need a more of a batch process approach.

Can you point me in the right direction?

Thanks,
Mary

View 5 Replies View Related

Access Read Only Variables In Script Component In A Dataflow

Dec 6, 2006

I have a set of comma separated variables in a Script Component list. I want to access them in Script code and use them to build string in the code.

View 9 Replies View Related

Giving Someone Read-only Access To A Database -- Beginner Question

Jun 29, 2007

Sorry for the simple question, but I'm not having any luck getting this to work: I need to give someone read-only access to everything in a database.



If someone could help me by giving me (or linking me to) a step-by-step, idiot-proof recipe for giving Bob in my office read-only access to the whole database, I'd be very grateful. And remember: I'm good at db programming, but completely ignorant on the subject of db admin.

View 3 Replies View Related

Access Or SQL Databases

Jun 2, 2004

I've read afew articles about .Net and they mentioned not using Access when developing with VS.Net, but the articles didn't go into why. Between the two, is one better/easier to use than the other? Is there a cost difference? Or does it depend on what you are doing?

Any input would be appreciated. Thanks.

View 26 Replies View Related

Access Databases Using ADO.Net

Sep 20, 2005

Hi I am using Visual Studio.Net 2003 and SQL 2000 Web applications run using the ASPNET user account.
I have to set up this account and grant it permissions before my Web application will have access to a SQL database. How do I grant permissions ?.

View 1 Replies View Related

Analysis :: SSAS - Roles With Read Definition Access Are Not Able To See Data In Cube

Nov 25, 2015

I am facing a very weird issue in our SSAS database. We have several roles with 'Read definition' access. None of these roles are able to see data in the cubes. I have checked these roles over and over and there is no problem with the definition. Each of the roles have been given read access to Data Source, Cube and Dimensions.

The users are able to access the definition and structure of the cube i.e. they can see the measures & dimensions available but when they drag measures and dimension attributes in the browser (SSMS) OR execute an MDX - they get null values. The roles with 'Full Control (administrator)' access are able to see all the data without any issues.
 
I have tried the following:

1. Deleted all roles and re-created.
2. Created roles directly on SSAS DB.
3. Deployed all objects and processed the DB.
 
Each time only the admins are able to see the data.

View 7 Replies View Related

SQL 2012 :: Grant Read-only Access To Windows Logins On Remote Standby Database

Mar 23, 2015

We log ship our production database tansaction logs to a secondary database on a separate remote domain.

Incidentally, this was not set up via the "Ship Transaction Logs" wizard, but instead we had to use the various system stored procedures after restoring a copy of the database on the remote domain in standby mode.

We now have an issue where users are unable to access the remote secondary database without having sysadmin privileges. Clearly we want to avoid this!

We want to be able to use Windows Authentication mode on the server of the secondary database. But since the two domains differ, is it possible to even achieve this?

How can we set up read-only access for users on the secondary database without giving them sysadmin privileges?

View 3 Replies View Related

Script Component As Source: The Collection Of Variables Locked For Read Access Is Not Available At This Point.

Jan 17, 2008

Hello, I am trying to configure a Script Component as a data source. Although this should be a simple exercise, I am running into a problem.

My control flow contains a Foreach Loop with a file iterator. The Directory Expression of the Foreach Loop Editor is supplied by an expression mapped to a package level variable called inputdirectory. The FileNameRetrieval Expression is mapped to a package scoped variable called filename.

My data flow is encapsulated by the Foreach Loop, and contains a Script Component as Source for the Data Flow Source, and a Flat File for the Data Flow Destination. The contents of the Script Designer are as follows:




Code Block
Imports System
Imports System.Data
Imports System.Math
Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
Imports Microsoft.SqlServer.Dts.Runtime.Wrapper
Imports System.IO
Public Class ScriptMain

Inherits UserComponent
Dim thisFileDate As Date
Dim thisFileName As String
Dim thisFilePath As String
Public Overrides Sub CreateNewOutputRows()

thisFileName = ReadOnlyVariables("filename").Value.ToString()
thisFilePath = ReadOnlyVariables("inputdirectory").Value.ToString()
thisFileDate = File.GetCreationTime(thisFilePath & "" & thisFileName)
FileSpecBuffer.AddRow()
FileSpecBuffer.FileName = thisFileName
FileSpecBuffer.FullPath = thisFilePath & "" & thisFileName
FileSpecBuffer.CreateDate = thisFileDate
End Sub
End Class






When I debug the package, I get the following error:

The collection of variables locked for read access is not available at this point.

at Microsoft.SqlServer.Dts.Pipeline.ScriptComponent.get_ReadOnlyVariables()

at ScriptComponent_67311120e6eb4162a3ea1f70847f04de.ScriptMain.CreateNewOutputRows()

at ScriptComponent_67311120e6eb4162a3ea1f70847f04de.UserComponent.PrimeOutput(Int32 Outputs, Int32[] OutputIDs, PipelineBuffer[] Buffers)

at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.PrimeOutput(Int32 outputs, Int32[] outputIDs, PipelineBuffer[] buffers)

My googlefu fails me at reconciling this. I have read various posts about changing the line ReadOnlyVariables("filename").Value to ReadWriteVariables("filename").Value, and handling the buffer assignment in PostExecute. The problem is that all examples shown are either for Script Component as Destination or Script Component as Transformation. I have tried playing with the Custom Properties in the Script Commponent set the ReadOnlyVariables and ReadWriteVariables, using a PreExecute method, a PostExecute method, all with different errors returning. I'm at a loss here. Could anybody provide me with a simple working example so that I can correctly populate my output buffer in the context of Script Component as Source?


I fully understand that I could just run a Script Task Using System.IO.Directory, and System.IO.File, but I really want to make this package work in the manner I've described. Any help would be appreciated.

Thanks,

John T

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved