Showing posts with label delete. Show all posts
Showing posts with label delete. Show all posts

Wednesday, March 28, 2012

Incorrect user login information showing in Enterprise Manager

When I check properties for database user x the login name says domain1\x .
If I delete that login from the server then look at the user x's properties
again it still says domain1\x in the login name!
How can this be fixed?Eric,
Since you say Enterprise Manager, I assume that you are using SQL Server
2000.
If I delete a login in SQL Server 2000 EM, it goes through and deletes the
users.
If I "sp_revokelogin 'domain1\x'" it still leaves the 'x' user behind, and I
can still see 'domain1\x' in EM if I was looking at it earlier. But, once I
refresh the EM user view I still see user 'x' but with a blank login.
EM does have some latency in refreshing (refresh a couple of times may be
necessary). Could that be your problem?
If not, have you done anything out of the ordinary, such as restoring a
database from another server, or even another domain?
RLF
"EricW" <ewientzek@.hotmail.com> wrote in message
news:OA8zHbd1HHA.4672@.TK2MSFTNGP05.phx.gbl...
> When I check properties for database user x the login name says domain1\x
> . If I delete that login from the server then look at the user x's
> properties again it still says domain1\x in the login name!
> How can this be fixed?
>
>|||I'm speaking about Managemenst Studio in SQL 2005.
"Russell Fields" <russellfields@.nomail.com> wrote in message
news:eQrTdlg1HHA.4500@.TK2MSFTNGP02.phx.gbl...
> Eric,
> Since you say Enterprise Manager, I assume that you are using SQL Server
> 2000.
> If I delete a login in SQL Server 2000 EM, it goes through and deletes the
> users.
> If I "sp_revokelogin 'domain1\x'" it still leaves the 'x' user behind, and
> I can still see 'domain1\x' in EM if I was looking at it earlier. But,
> once I refresh the EM user view I still see user 'x' but with a blank
> login.
> EM does have some latency in refreshing (refresh a couple of times may be
> necessary). Could that be your problem?
> If not, have you done anything out of the ordinary, such as restoring a
> database from another server, or even another domain?
> RLF
> "EricW" <ewientzek@.hotmail.com> wrote in message
> news:OA8zHbd1HHA.4672@.TK2MSFTNGP05.phx.gbl...
>|||Eric W,
OK, you are using SQL 2005.
When using SSMS you delete a login, you will get this message: "Deleting
server logins does not delete the database users associated with the logins.
To complete the process, delete the users in each database. It may be
necessary to first transfer the ownership of schemas to new users."
But your question is" "Why does the user entry still know the login name?"
The answer is that it records the SID in the user. If you:
select * from sys.database_principals
you will see the SIDs of the logins used to create the users. In fact, if
you copy the SID for a deleted Windows login and paste it into:
SELECT SUSER_SNAME(0x0...9)
it will still return the name of the Windows Login. (In SQL Server 2000,
sysusers maintained the login's SID, but since the rows were usually deleted
automatically, you never saw this behavior manifested.)
To get rid of this, you must also drop the user yourself. Which may mean
that you must first drop that user's schema.
RLF
"EricW" <ewientzek@.hotmail.com> wrote in message
news:OaZe5gP2HHA.4476@.TK2MSFTNGP06.phx.gbl...
> I'm speaking about Managemenst Studio in SQL 2005.
>
> "Russell Fields" <russellfields@.nomail.com> wrote in message
> news:eQrTdlg1HHA.4500@.TK2MSFTNGP02.phx.gbl...
>

Wednesday, March 21, 2012

Incorrect settings Arithabort

INSERT [DELETE] failed because the following SET options have incorrect settings: 'ARITHABORT'. Verify that SET options are correct for use with indexed views and/or indexes on computed columns and/or query notifications and/or xml data type methods.

On local dev machine with SQL Express DB everything works fine. Once moved to shared hosting environment (with adjustments to web.config), insert and delete stored procedures produce the above error.

Made sure that stored proceduresSETARITHABORTON at the beginning and OFF at the end, without success. Even SET ARITHABORT ON at DB level without success.

Suggestions appreciated

Have a look at

http://msdn2.microsoft.com/en-us/library/aa259212(SQL.80).aspx|||

Thanks for the reply. After the original post, I continued rummaging for a solution. Found a comment that related the error to the connection string. Remember that the problem only occured when the app moved to a shared hosting environment. So I added the SqlCommand below after opening the connection.

public override bool DeleteCategory(int categoryID) {using (SqlConnection cn =new SqlConnection(this.ConnectionString)) { SqlCommand cmd =new SqlCommand("Directory_DeleteCategory", cn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@.CategoryID", SqlDbType.Int).Value = categoryID; cn.Open();//adding next 2 lines eliminated the error SqlCommand arithabortCmd =new SqlCommand("SET ARITHABORT ON", cn); arithabortCmd.ExecuteNonQuery();int ret = ExecuteNonQuery(cmd);return (ret == 1); } }
The stored procedure is very simple typical delete.
Added those to lines to all INSERTS, UPDATES and DELETES. It works, although I still don't understand why turning ARITHABORT on at the stored procedure and database level does not.
Again thanks,