Firstly I know nothing about SQL server,I downloaded SQL express to evaluate an EAM software for work because the access version of the program was buggy.
The software came with 4 scripts to set up the database,the schema script ran fine but when I run the create user script I get a bunch of errors and have no clue how to proceed.
Here is the script followed by the error messages:
--MSSQL
-- Create Login
Use master
Go
if not exists (select * from master..syslogins where name = N'PMAINT70')
I am trying to create a program that user inputs the sa password and it creates a user in SQL Express 2005 installation. Is this possible? If so can someone point me in the right direction?
In SQL 2005, I want to create a RO_user with read only access rights to some of my databases. I wrote the folloiwng code but get an error in USE @db_name.
Is there an easier way to create the user id and grant the RO access right to it? I have about 500 databases.
USE [Master] GO
DECLARE @db_name nvarchar(50)
DECLARE db_cursor CURSOR FOR SELECT master.dbo.[name] FROM sysdatabases WHERE Substring(name,1,4) in ('DB06', 'AC06', 'RE07')
OPEN db_cursor
FETCH NEXT FROM db_cursor INTO @db_name
WHILE @@FETCH_STATUS = 0 BEGIN
USE @db_name CREATE USER [RO_user] FOR LOGIN [RO_user] EXEC sp_addrolemember N'db_datareader', N'RO_user'
FETCH NEXT FROM db_cursor INTO @db_name END CLOSE db_cursor DEALLOCATE db_cursor
Hello,How can I create a new user with password for the MS SQL - Server 2000(and the MSDE) with a SQL - Statement? I use Borland Delphi 5 with theADO - Components!Thanks.best regards.Stephan Jahrling
i'm using SQL server 2005 and I need to create new login/user. Previously I used MySQL where user management is much simplier, so I need a help with SQL server. I run following script:
EXEC sp_addsrvrolemember 'uzivatele', 'sysadmin' GO
GRANT CONNECT SQL TO [uzivatele] GO
CREATE USER [jirka] FOR LOGIN [uzivatele] GO
But when I try to connect o database "master" as user "jirka" with password "xyz", it fails with message "Login failed for user 'jirka'". What do I wrong?
Can i create user forms for user to select options and then present them with data based on their selection.i want to be able to use check boxs and combo box.thanks in advance
I have just managed to have JDBC working, but I am getting an error that the user does not exist. I have read in the MSDN help that I need to set the sqlExpress to accept SQL server authentication and not windows authentication. So when I am trying to create a new User using Microsoft SQL server management studio express I get the following error.
TITLE: Microsoft SQL Server Management Studio Express ------------------------------
Create failed for Login 'adam'. (Microsoft.SqlServer.Express.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Create+Login&LinkId=20476
Can i create user forms for user to select options and then present them with data based on their selection.i want to be able to use check boxs and combo box.thanks in advance
I was wondering if I could have a query like this: CREATE USER 'Firstname Lastname' FOR LOGIN 'DOMAINuser' WITH DEFAULT_SCHEMA=[dbo] The combination of firstname and lastname does not seem to work.
I have been using: sp_grantdbaccess 'DOMAINuser', 'Firstname Lastname' but i cannot specify DEFAULT_SCHEMA with that sp.
Hello, After creating a new SSMSExpress Login username account, I use it as the Database User of the attached database (aspnetdb.mdf), but I receive this error.... Additional information: ->An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.Express.ConnectionInfo) ->The login already has an account under a different user name. (Microsoft SQL Server,Error: 15063)...
I am sure such username account is not yet members of that database (aspnetdb.mdf) for this are the users present-dbo-guest-INFORMATION_SCHEMA-sys-COMPUTERNAMEASPNET-CONPUTERNAMEIUSR_COMPUTERNAME cheers,imperialx
I need to be able to have users run a query under the 'sa' account that will create another account that will just be used for reading and writing to a specific database. Is there a way to do this with just a sql script or can you only set up logins and accounts from the enterprise manager?
I wonder if anyone can help. I'm trying to create a new user/login to a sql server 2000 box which will automatically have access to all the user databases on the instance. The user can't be a SA or anything however. It seems this can be done as the application which uses all these database has created such a user, however I need another which I will then make read-only.
This is the error message i keep getting when following the SQL Server tutorial on how to make a new user;
TITLE: Microsoft SQL Server Management Studio Express ------------------------------
Create failed for Login 'employee'. (Microsoft.SqlServer.Express.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.2047.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Create+Login&LinkId=20476
Hello... Is there any way to create a new database directly as a user instance. I guess this means creating a new mdf/ldf pair which is detached from the server after its created. Thank you...
I have a database for which I need the permissions to execute stored procedures, perform CRUD operations on tables, execute functions and SQL jobs. What should be the SQL command if I am to create a user for this database who will have the most minimum privileges to carry out these activities?
I'm trying to create a user (from certificate): USE master GO CREATE CERTIFICATE UnsafeSample_Certificate ENCRYPTION BY PASSWORD = 'All you need is love' WITH SUBJECT = 'Certificate for example_sp', START_DATE = '20070201', EXPIRY_DATE = '21000101'; BACKUP CERTIFICATE UnsafeSample_Certificate TO FILE = 'C:Documents and SettingsAll UsersDocumentshunterSampleCert.cer' WITH PRIVATE KEY (FILE = 'C:Documents and SettingsAll UsersDocumentshunterSampleCert.pvk', ENCRYPTION BY PASSWORD = 'Tomorrow never knows', DECRYPTION BY PASSWORD = 'All you need is love'); CREATE USER UnsafeSample_Login FROM CERTIFICATE UnsafeSample_Certificate; GRANT EXTERNAL ACCESS ASSEMBLY TO UnsafeSample_Login;
But I'm getting error: "Cannot find the login 'UnsafeSample_Login4', because it does not exist or you do not have permission."
Where i should change rights? User (which i'm using to connect to server) has "sysadmin" server role...
I made a Windows forms app using vb.net (VS2005) and SQL server 2005 Express Edition (to which I'm new). During the creation of the app I used windows authentication in the connection string. Now I want to secure the app, meaning I want the SQL Server database not to be accessed without a username/password. I guess the logical thing is to create a login form, providing the username and password so it can be used for connecting to the database. I thought this would be a standard (thus easy) thing to do, but no forum or article yet showed me a way to accomplish this in an understandable way. I also want to deploy this app using click once technology. I need to distribute this app on a cd/dvd.
If possible, can anyone give me a step by step scenario for this? Many thanks in advance
(ps: please let me know if this should be in another thread)
I have a Java application (APP) that use SQL Server 2008 - 20014. In the SQL server there can be more than my database. During setup of the database the first user (ex:ADM) is created using MS SQL Server Management Studio (SMS). ADM can then launch the APP with proper credentials and connect to the database.ADM can then, in the APP, create new users for the APP and database. After some testing for proper CREATE and GRANTS I use the following code to create a new Create, Read, Update, Delete (CRUD) user for the APP and database: CREATE LOGIN testuser WITH PASSWORD='password', DEFAULT_DATABASE = testdb
USE testdb CREATE USER testuser FOR LOGIN testuser GRANT AUTHENTICATE TO testuser WITH GRANT OPTION GRANT CONNECT TO testuser WITH GRANT OPTION GRANT ALTER ANY USER TO testuser WITH GRANT OPTION GRANT CONNECT SQL TO testuser WITH GRANT OPTION GRANT INSERT,SELECT,UPDATE, EXECUTE, DELETE TO testuser WITH GRANT OPTION
USE master GRANT CONTROL SERVER TO testuser
USE testdb..When I the use the SMS and look at security the "testuser" is only added to testdb. To test I create a second database "testdb2" --> launch the APP to connect to testdb2 and can login with "testuser".I don't know if I give to much grants or missing one...proper TSQL so new users only have CRUD access to "testdb" and no other database on the SQL server.
Hi I am using sql express to automatically generate users and logins from t-sql. I seem to be having a problem when it comes to restricting their access though. I only want them to be able to select on views and execute stored procedures. at the moment I have created a new database role, schema, login, and user, then added the user to the role but how do I restrict access to the above areas? do the restrictions go on the role, schema, or user? I must confess I find the whole schema and role issue a little confusing and just when I think I've got it, it turns out I haven't :( thanks
I have installed Visual Web Developer Express 2005 with Sql Server Express, I can login with window authentication, but I want to create different user and password that I can use to access a database I have created, can anybody help me how to do this ? Thanks.
Respected Members, I have a question, when our aspx page is trying to access the SQL Server 2000 database than before this do we have to creaete a user with the name of ASPNET in SQL Server 2000, or without creating this paticular user(its the default user of ASP.NET account) our aspx pages can also access the SQL Server 2000,I have already SQL Server 2000 running in "SQL Server Authentication Mode" so while creating the user do I have to create it in "Windows Authentication" or "SQL Server Authentication", can you provide some link where I could find complete steps for craeting the ASPNET user or if some one can tell all the steps in details here.