I have inserted a new NT user via the Security Manager applet into a group associated with two databases. Now when I select 'Logins' from the Server Manager window and then double-click the newly added user, I receive this message 'Error 21770: The name '<NT username>' was not found in the Users collection.'
Can anyone please explain the above error message.
I am trying to add a new user (SQL Server 6.5) from an application program (Delphi 4.0). I was hoping I could do this in a stored procedure that basically acts a a wrapper around the SQL Server stored procedures.
It partially works - here is my procedure:
create procedure AddUserToSQLServer(@loginame varchar(30), @Password varchar(30) ) as begin
-- Add User to SQL Server Database exec mydb.dbo.sp_addlogin @loginame,@Password,'mydb'
exec mydb.dbo.sp_adduser @loginame
end
The sp_addlogin adds the login and sets the default database as mydb. This is OK, except the user still can not login to the application. So I added the sp_adduser. This gives the user access to the application, but I still have a problem. When I go into Executive Manager, and go to the Manage Logins screen by double-clicking on the newly added user, I get the message "Error 21770: The name 'loginame' was not found in the users collection" where loginame is the users login. I click OK to this message, and the user is displayed on the manage logins screen. Their default database is mydb, a check is in the Permit box and their username is in the User column. Alias and Group are blank. When I try to drop the user, I get the same error again (2 times), then error "Error 15175: [SQL Server] login 'loginame' is aliased or mapped to a user in one or more database(s), drop user or alias before dropping login".
The only thing I found that works is to go to SQL and issue sp_dropuser loginame, then I can drop the user.
Anybody see what's wrong? Or know of a FAQ that addresses this situation?
The current setup is as follows: SQL 2005 64bit v9.0.3054 Windows 2003 SP2
Problem: When trying to add an AD user to SQL, I receive error 15401
Background: The user's last name was recently changed and so all relevant AD fields were appropriately changed: Lastname, Displayname, E-mail, UserLogonname, UserLogonname (pre-Windows 2000). The user's previous email account has not been changed except for additional email addresses to account for the new name and old name. Also note, the uses Exchange alias is still the previous account name.
When I enter the user's new account name into the Login Name field in SQL I recieve the 15401 error. When I do a search for the user's new account name SQL finds the previous account name and not the new one. I have reviewed KN 324321 and that article does not resolve this error. The user account can be found be only using the original account name and not the new one.
On the same SQL server, I opened the security settings for a folder and added the new user's account name and it was found. I then had it search for the user's old login name and it could not find it.
We have been working on an application that will be using a forms-authenticated report server (RS2005) as a reporting back-end. Using the reporting services web service I have been able to assign permissions to objects in reporting services no problem. The issue is that each user needs to be added to the System User role to be able to use the report builder properly. I can't seem to find a way to do this programmatically. Any idea?
I try to add a db_role or a user to all my databases with one script. Although parsing doesn't report any problem I get a Syntax error during execution. I first select the database names into a #temp table which has two columns, ID and dbname. After that I use the following code:
Had a user created from a local NT account called joe. Used mixed mode athentication. Things are fine.
Later, we needed to add all users from primary domain account (domain2joe), and not have users on all the local servers (joe). Instead central athentication. So I removed the SQL user bill(that was there from local NT account), then went ahead and added the same username, but from a different domain (domain2joe). (same SQL username!) Now when I go into database access to grant user joe access to database1, SQL complains saying that the user already exists. I check the database1 and the user isn't there. BUT, the user bill exists on the SQL role "public" of that database.
I can I add this user and grant access to database1 when SQL thinks the user already exists? How do I remove user from public role?
i'm trying to add a new user to a certain database directly through the users section in this database, but i was given an error that i can't and nothin was added, so i tried adding this user from the Logins section, a pop up message showed saying that this user already exists knowing that it doesn't when i try to create a user from the Logins in a different username it worked but the problem is i can't change the user i must stick with the username that is not working. how can i fix it??
Hi, I'm able to connect to my db using ASP.NET, but now I need to connect with ASP. I need to add a user like <computer name>ASP( I already have <computer name>ASPNET) using windows authentication to the db. I cannot seem find the way to do this in SQL Server management Studio, because it tells me that it doesn't find that group. Where can I add this user?Thanks a lot.
I am trying to add a user in every database. So far I have tried using a cursor - Wont work because you cannot issue Use @database_name within the cursor. I have also tried master.dbo.sp_MsForeachdb "exec sp_grantdbaccess 'user'" this does not work either as it addes the user to the first database then doesnt cycle through. I also tried fully qualifying the sp_grantdbaccess with master.dbo.sp_grantdbaccess.
If you have a way of doing this i would appreciate some help.
Hi All,I am having a serious problem of removing and adding again an user in adatabase.Microsoft SQL Server 2000 - 8.00.760 (Intel X86)Dec 17 2002 14:22:05Copyright (c) 1988-2003 Microsoft CorporationEnterprise Edition on Windows NT 5.2 (Build 3790: Service PackSomehow, the user was created earlier but was not able to run queryassigned to him. As a result I wanted to drop and recreate the user.I have done many possible things to create the users again with thesame user id but failed.1. I tried to delete this user from the enterprsie manager security-->logins-->user1It deletes but when I try to add again, it gives me error message(Error 15023: user or role u'user1' already exist).2. Then I tried in the db:delete sysusers where name='user1'it deletes the user1.3. Again tried adding, got the message in 1.4. Then I trieduse db1EXEC sp_change_users_login 'Update_One', 'user1', 'user1'Server: Msg 15291, Level 16, State 1, Procedure sp_change_users_login,Line 88Terminating this procedure. The User name 'user1' is absent or invalid.I also tried master database and ran the following.EXEC sp_droplogin 'user1'The login 'user1' does not exist.But If I try to add the login user1, get the error message.Error 15023: user or role u'user1' already existI also ran the following when I got Ad hoc error messageexecute sp_configure "allow updates",1goreconfigure with overridegoCould you please tell me how I can solve this problem.I do highly appreciate your help.Thanks a million in advance.best regards,mamun
In Ms SQL 2000, I want to be able to share my database with another user butI only want them to be able to look at the database and not be able tochange anything.Does anyone know how I go about doing this?
I currently have a sql server 2000 sp4 instance with a read-only db on it. We get tlogs shipped from an outside vendor and keep a copy of the production database in house for reporting purposes. The database is in read-only mode because we apply new tlogs daily. Recently we did a full recover and applied 2 tlogs.
The issue: There is a user YYY in the database and at the server level, but they aren't linked. So I do what I usually do and run the following command:
Server: Msg 3906, Level 16, State 1, Procedure sp_change_users_login, Line 109 Could not run BEGIN TRANSACTION in database 'ZZZ' because the database is read-only.
Now this error makes sense and I understand why, so my question is how do I fix the users not being linked?
This is driving me crazy! The SQL Statement refenced is shown at the end of this email.
When I try and run the statement, an error is raised saying that Undrawn_GT5MIL_LE365Days is invalid (likewise for Undrawn_LE5MIL_LE365Days). From what I can gather, it is saying that I cannot include a User Defined variable in another argument. This is unlike Access. Any suggestions?
SQL View.......
SELECT TOP 100 PERCENT QRY_FacNew_Term.Category, QRY_FacNew_Term.Fac_No, QRY_FacNew_Term.Client_Number, QRY_FacNew_Term.Client_Name,
Undrawn_GT5MIL_LE365Days = CASE WHEN Undrawn_CDN >= 5000000 AND Term <= 365 THEN Undrawn_CDN ELSE 0 END,
Undrawn_GT5MIL_GT365Days = CASE WHEN (Undrawn_CDN >= 5000000 AND Term > 365) OR
(Cr_Limit_CDN IN (0, 1)) THEN Undrawn_CDN ELSE 0 END, [Undrawn_GT5MIL_LE365Days]+[Undrawn_GT5MIL_GT365Days] AS Total
I have an ASP.NET 2 external application that is using and mix of the web services and tables/sps available from my 2005 SSRS.
I want to add an authenticated user from the external application. I don't see a web service that will do this. I have been through the SP's and can create roles, authenticated users, policies etc. But I think I need to update the XmlDescription field in the SecData table.
Do I need to build this XML string from scratch or is there a function / sp / web service that will do this. XML is a long ways from my strong suit.
Or am I just crazy and I should redirect my users to the Security tab!
I've created an rdl report in reporting services 2005. Report is working fine. I've deployed this report on SQL Server 2005. The problem is this that to access the reports from client, I need to add client's login ID in Administrator user's group os server. If I dont add them in that group, it shows following error:
"The permissions granted to user 'loginname' are insufficient for performing this operation. (rsAccessDenied)".
This solution works fine in development but in actual environment, I can't add users in that group. Can anyone tell me how to view reports without adding user in administrator group. Its urgent.
Hi, Apologies in advance if you get confused by reading this.... I am trying to create an additional step in the Create Wizard User Control that is provided by ASP.net. The additional step that I want to add will come after a user will create their username, password, email etc. The information which I want to save in the extra step are details such as firstname, lastname, address, height, weight etc. (I am creating an online weight management system for dieticians).When I run through the application, the username, password etc save perfectly to the database, but nothing happens with the other "personal information". There are no errors thrown so I don't know where the problem is coming from.I have included the code below as I have it:The code behind the Register.aspx file is as follows: <asp:SqlDataSource ID="InsertExtraInfo" runat="server" ConnectionString="<%$ ConnectionStrings:ASPNETDBConnectionString1 %>" InsertCommand="INSERT INTO [aspnet_UserInformation] ([first_name], [surname], [address1], [address2], [city], [country], [number], [height], [weight]) VALUES (@txtFirstName, @txtSurname, @txtAddress1, @txtAddress2, @txtCity, @txtCountry, @txtNumber, @txtHeight, @txtWeight)" ProviderName="<%$ ConnectionStrings:ASPNETDBConnectionString1.ProviderName %>"> <InsertParameters> <asp:ControlParameter Name="txtFirstName" Type="String" ControlID="txtFirstName" PropertyName="Text" /> <asp:ControlParameter Name="txtSurname" Type="String" ControlID="txtSurname" PropertyName="Text" /> <asp:ControlParameter Name="txtAddress1" Type="String" ControlID="txtAddress1" PropertyName="Text" /> <asp:ControlParameter Name="txtAddress2" Type="String" ControlID="txtAddress2" PropertyName="Text" /> <asp:ControlParameter Name="txtCity" Type="String" ControlID="txtCity" PropertyName="Text" /> <asp:ControlParameter Name="txtCountry" Type="String" ControlID="txtCountry" PropertyName="Text" /> <asp:ControlParameter Name="txtNumber" Type="String" ControlID="txtNumber" PropertyName="Text" /> <asp:ControlParameter Name="txtHeight" Type="String" ControlID="txtHeight" PropertyName="Text" /> <asp:ControlParameter Name="txtWeight" Type="String" ControlID="txtWeight" PropertyName="Text" /> </InsertParameters> </asp:SqlDataSource> Then the code I have behind the Register.aspx.cs page is: protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e) { TextBox UserName = (TextBox)CreateUserWizard1.FindControl("UserName"); SqlDataSource DataSource = (SqlDataSource)CreateUserWizard1.FindControl("InsertExtraInfo"); MembershipUser User = Membership.GetUser(UserName.Text); //object UserGUID = User.ProviderUserKey; DataSource.InsertParameters.Add("UserId", UserGUID.ToString()); DataSource.Insert(); } I know there is a problem with the code on the aspx.cs page but I cant figure it out. I need the username / password information to relate to the personal details information. I know I have to create a foreign key in the asp_UserInformation table that will link to the username in the asp_Membership (where all the username / password info is stored) Any help will do, I'm almost in tears here!!!The Spud
This is a pretty simple query that tracks 'yesterdays' apply clicks on our website.
SELECT MIN(A.hitDate) AS minDate, D.AffiliateName, B.ProdType, COUNT(DISTINCT A.ipAddress) AS TOTAL FROM ArchiveApplyTracking A LEFT OUTER JOIN Configuration.dbo.Affiliates D ON A.affiliateID = D.AffiliateID LEFT OUTER JOIN Incoming C ON A.campaignID = C.ID LEFT OUTER JOIN Configuration.dbo.ProductType B ON A.productTypeID = B.ProdNo WHERE (A.hitDate >= DATEADD(d, DATEDIFF(d, 0, GETDATE() - 1), 0)) AND (A.hitDate < DATEADD(d, DATEDIFF(d, 0, GETDATE()), 0)) AND (A.deal = 1) AND (A.ipAddress NOT IN (SELECT ipAddress FROM [Tracking].[dbo].ipTracking)) AND (B.ProdType NOT LIKE 'refused%') AND (D.AffiliateName LIKE 'ARROW%') AND (B.ProdType NOT LIKE '%prequalify%') GROUP BY D.AffiliateName, B.ProdType ORDER BY D.AffiliateName
No problem there, that's fine.
But how can i put a simple date range interface on my published report so users can say "get me the stats from 04/09/2005 to 20/09/2005, which then runs the query?
Deleting a Login from a server instance and adding it back did not show that the login was still mapped to databases. In SQL Server 2008, adding a Windows Login did not permit access to end user databases until the Windows Login was mapped to various databases. In SQL Server 2012, once a Windows Login is added to SQL Server Security, it may access ANY end user databaseWe use the following to circumvent this problem, Windows Login by Windows Login: DENY VIEW ANY DATABASE TO [TESTTest1]
I am trying to create an ASPNET Login for a SQL Server express Database (As Installed via Visual Studio) so my ASP Web Applications can invoke the Database. But SQLServer Managemnt Tool is not recognising any ASPNET user names I try. I am trying to add via Microsoft SQL Server Management Studio Express, but get an error " An Object (User or Built-in Security principal) with the following name cannot be found "mycomputerASPNET". "
Any obvious reason why ASPNET is not being recognised as a Login object object
Unfortunately I am on VISTA and IIS7 ( I have enabled, and checked that ASP Applications Run.)
- The process works OK on my other XP machine, ASP.NET via IIS 5.1, which seems more straightforward to set up.
I have several reports for users to view on our Intranet. After installation of SQL 2005 SP2 patch, I cannot delete user or user's authority from Report in Properties Tab. An error message was shown on the status bar. It indicated that JavaScript Error: 'Return' statement outside of function. Seems something wrong with the 'Delete' funciton in SQL 2005 after update. The other functions worked fine. Could you point me out how to fix it or need to install any updates / hotfix. Thanks a lot!
All the research I found dealing with this problem is that the solution is to set SQLserver to mix mode. I have SQL server already set to mix mode. I am not sure what else to do. Has anybody run into this problem? my connection string: <connectionStrings> <add name="ConnectionString" connectionString="Data Source= server name ; Initial Catalog=FILESHAREDB.MDF; Integrated Security=false;"providerName="System.Data.SqlClient"/> </connectionStrings>
Server Error in '/SendItNow' Application.
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: Login failed for user ''. The user is not associated with a trusted SQL Server connection.Source Error:
Line 41: Line 42: 'open the connection and execute the stored procedure Line 43: mConnection.Open() Line 44: mResourceID = mCommand.ExecuteScalar() Line 45: mConnection.Close()Source File: H:MIS DepartmentIntranetSendItNowApp_CodeDalResourceDB.vb Line: 43 Stack Trace:
I was wondering whether there is a way to show the user an error when the user did not select a specific parameter.
In my case, I have two optional parameters. The user has to select either one to view the report. If the user does not select either one, I would like to show some sort of an error page indicating so. However, all i am getting is a complete blank with no report in sight. I as a developer know this is an error as a result of missing parameters, but i was wondering whether I could produce a page or direct it to a page so that the user doesn't go all horrified at an empty page ?
I received the above error yesterday and haven't been able to trace it to any job or process running. We haven't implemented any changes to the server in the past few months, and it doesn't look to be a user-established connection, since the Client IP Address of the SSPI handshake error is from the server itself.
I logged this set of messages in SQL AgentServer error log:
Date 10.03.2008 6:15:19 PM Log SQL Server (Current - 11.03.2008 2:32:00 PM) Source Logon Message SSPI handshake failed with error code 0x80090304 while establishing a connection with integrated security; the connection has been closed. [CLIENT: <IP Address>]
On MS-SQL 2k I have a created user. Security for the SQL instance isset to mixed.When I attempt to connect to SQL using Enterprise client on anothermachine on the local network using Windows Auth I get the error: DBName-Login Failed for user ('null')- Reason: Not associated with atrusted SQL Server Connection.What am I over looking?TIA
i'm using the Enterpirse library logger to write logs into a database. When choosing connection string i choose the database i want in the "connection properties" dialog box and push 'Test connection' button. everything goes well.
then i open the SQL Server Management studio express and connect to the databse to check some things, from that point on , when i push the 'Test Connection' button in the Enterprise library i get the error:
"cannot open user default database. Login failed. login failed for user My'server/MyuserName'"
even when i close the sql server manager , it is still stuck - the connection test doesn't work anymore.... it only work when i restart the computer.
Hi guys, I am facing a confusing problem, whenever i select the add new item tab and choose add sql database, it reads an error stating 'Connections to sql server files require SQL server 2005 to be functioning properly, please verify the installation of the component or download it' The thing is, I have sql server 2005 properly installed on my pc and at the same time, whenever I choose to create a new connection from the server connection or in setting up a connection to the existing databases, I do not face any problem, so why is this issue occuring over here, I have no idea, thanks to anyone willin to resolve!
Login Failed for user , the user is not associated with a trusted sql server connection. (microsoft SQL Server,Error:18452)
hi , i am getting the above error message once in a while maybe two or 3 times a week , and then it goes away in 10 to 15 minutes or 5 minutes ,
our mode is set to mixed and we are able to connect and use both sql and windows , but once in a while , it will give us the above message when we try connecting throught sql server management studio client (using sql 05) using windows login , although it lets us connect using sql login while the windows login is denied, and after a while it lets us connect with both.
occurs randomly on some days , we run our servers on VM ware virtual machines using windows 2003 r2 enterprise 64 bit with sp2 with esx 301 virtual machine.