locked
How to remove SQL data? RRS feed

  • Question

  • Hello.

    In my SQL DB some username and password for users are created but how can I remove them? I mean is my website use SQL Server for create and store users account.

    Thank you.

    Saturday, April 29, 2017 2:25 PM

Answers


  • I know the usernames. Can you show me a SQL query for find tables and...based on username?

    If that is the case below link should help you

    How to find any value in SQL Server


    Cheers,

    Shashank

    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it

    My TechNet Wiki Articles

    MVP

    Tuesday, May 16, 2017 4:16 AM
  • That's a search function, so it will not delete anything. Using the one on the top, is probably the best bet.

    Sunday, May 21, 2017 3:47 PM
  • Here's the way to remove SQL Server Login accounts with T-SQL script:

    -- windows account removal sp_revokelogin [AD\your_domain_account]; -- SQL account removal sp_droplogin 'your_SQL_account'


    Hope that helps,


    Phil Streiff, MCDBA, MCITP, MCSA

    Saturday, April 29, 2017 2:49 PM
    Answerer
  • You can log into SQL Server and expand it. Look for security and then expand it and you would find logins expand that as well and you will see list of logins right click on all you want to disable

    Cheers,

    Shashank

    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it

    My TechNet Wiki Articles

    MVP

    Saturday, April 29, 2017 2:51 PM
  • In my SQL DB some username and password for users are created but how can I remove them

    The data is stored in some tables of your database, which structure we don't know. But it's just some data, delete it using a DELETE (Transact-SQL) command.

    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    Sunday, April 30, 2017 4:59 AM

All replies

  • Here's the way to remove SQL Server Login accounts with T-SQL script:

    -- windows account removal sp_revokelogin [AD\your_domain_account]; -- SQL account removal sp_droplogin 'your_SQL_account'


    Hope that helps,


    Phil Streiff, MCDBA, MCITP, MCSA

    Saturday, April 29, 2017 2:49 PM
    Answerer
  • You can log into SQL Server and expand it. Look for security and then expand it and you would find logins expand that as well and you will see list of logins right click on all you want to disable

    Cheers,

    Shashank

    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it

    My TechNet Wiki Articles

    MVP

    Saturday, April 29, 2017 2:51 PM
  • In my SQL DB some username and password for users are created but how can I remove them

    The data is stored in some tables of your database, which structure we don't know. But it's just some data, delete it using a DELETE (Transact-SQL) command.

    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    Sunday, April 30, 2017 4:59 AM
  • In my SQL DB some username and password for users are created but how can I remove them

    The data is stored in some tables of your database, which structure we don't know. But it's just some data, delete it using a DELETE (Transact-SQL) command.

    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    Thank you so much.

    I'm afraid of remove anything. It is a website and it may make problems for users. In below photo you can see my SQL Server database. Any idea for find specific users and remove them?

    Saturday, May 6, 2017 5:35 AM
  • Are you talking about users or logins, users are just people connecting login is what they used to connect so I guess you are talking about login.

    You can expand the security just below Xtran and you would see logins. Right click on it select properties and then select radio button disable


    Cheers,

    Shashank

    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it

    My TechNet Wiki Articles

    MVP

    Saturday, May 6, 2017 5:40 AM
  • Are you talking about users or logins, users are just people connecting login is what they used to connect so I guess you are talking about login.

    You can expand the security just below Xtran and you would see logins. Right click on it select properties and then select radio button disable


    Cheers,

    Shashank

    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it

    My TechNet Wiki Articles

    MVP

    I mean is "usernames" that used by users for login to the website.
    Saturday, May 6, 2017 5:52 AM
  • I mean is "usernames" that used by users for login to the website.
    I think again that is login but if you have custom user name and passwords saved that would be in certain table in database and you haveto find out and use delete command to delete the rows

    Cheers,

    Shashank

    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it

    My TechNet Wiki Articles

    MVP

    Saturday, May 6, 2017 6:13 AM
  • you need to apply encryption on the password like  MD2, MD4, MD5, SHA, SHA1, or SHA2 

    you can do this using the hashbytesfunction. Now your password becomes unreadable

    try the following query below.

    DECLARE @HashThis nvarchar(4000);  
    SET @HashThis = CONVERT(nvarchar(4000),'hello word');  
    SELECT HASHBYTES('SHA1', @HashThis);  

    When the user logs in apply the same function to the password before allowing it to travel to the wire

    when it reach sql server you should be comparing the password hash not the password

    if the hash matches allow him to login.

    In summary you will need to fixes.

    1. apply hash on the password in the database save it on a column and delete the plain text password

    2. hash the password before it travels through the wire


    <a href="https://www.aware-it.org">AWARE-IT.ORG </a><br/> Your source of free IT training

    • Proposed as answer by Enric Vives Monday, May 15, 2017 2:32 PM
    Saturday, May 6, 2017 6:37 AM
  • I mean is "usernames" that used by users for login to the website.
    -----

    We still don't know. From what you have said, it can be anything of:

    1) A login on the server level, combined with a user on database level. This is the normal way.
    2) The database is a contained database, and users authenticate directly to the database. This is a bit exotic.
    3) The application logs into an SQL Server login, and then the application has its own user tables. This is not uncommon with web sites, and I sometimes see people ask about something call ASP.NET Membership which appears to be a framework of this kind that ships with ASP .NET.

    So if you don't know how your website is set up, you will have to live with these users.

    Saturday, May 6, 2017 10:08 AM
  • I mean is "usernames" that used by users for login to the website.

    I think again that is login but if you have custom user name and passwords saved that would be in certain table in database and you haveto find out and use delete command to delete the rows

    Cheers,

    Shashank

    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it

    My TechNet Wiki Articles

    MVP

    I hope you can understand I mean. consider a portal that using SQL Server and users create username and password for longing to the portal. I like to remove some users.
    Sunday, May 7, 2017 5:34 AM
  • I mean is "usernames" that used by users for login to the website.
    -----

    We still don't know. From what you have said, it can be anything of:

    1) A login on the server level, combined with a user on database level. This is the normal way.
    2) The database is a contained database, and users authenticate directly to the database. This is a bit exotic.
    3) The application logs into an SQL Server login, and then the application has its own user tables. This is not uncommon with web sites, and I sometimes see people ask about something call ASP.NET Membership which appears to be a framework of this kind that ships with ASP .NET.

    So if you don't know how your website is set up, you will have to live with these users.

    Website using ASP.NET.
    Sunday, May 7, 2017 5:39 AM
  • XTrans are:

    Sunday, May 7, 2017 5:40 AM
  • I hope you can understand I mean. consider a portal that using SQL Server and users create username and password for longing to the portal. I like to remove some users.

    I understand what you want to do. But I don't know enough about your web site to be able to answer. As I explained in my previous post, there is more than one to define users. Since you say it is a web portal, I could guess that it is #3 on my list, because I still don't know your tables.

    Sunday, May 7, 2017 10:32 AM
  • I hope you can understand I mean. consider a portal that using SQL Server and users create username and password for longing to the portal. I like to remove some users.

    I understand what you want to do. But I don't know enough about your web site to be able to answer. As I explained in my previous post, there is more than one to define users. Since you say it is a web portal, I could guess that it is #3 on my list, because I still don't know your tables.

    No, You wrong. It is for SQL not for website.

    Let me to clear it more. Consider "hotmail.com", when you create an email then your email is a username in DB and my web portal is like that. some users create usernames and I like to remove them. Can you show me a MS-SQL command for query a specific name? I guess after it we can find more useful information. 

    Monday, May 15, 2017 6:24 AM

  • Let me to clear it more. Consider "hotmail.com", when you create an email then your email is a username in DB and my web portal is like that. some users create usernames and I like to remove them. Can you show me a MS-SQL command for query a specific name? I guess after it we can find more useful information. 

    I got what you are saying but the information, username, would be stored in some table and we dont know which table is that so it would be difficult to tell

    Cheers,

    Shashank

    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it

    My TechNet Wiki Articles

    MVP

    Monday, May 15, 2017 7:03 AM
  • No, You wrong. It is for SQL not for website.

    You see, I am awfully bad at guessing.

    The analogy to Hotmail is not helpful, becaues I don't know hotmail is implemented.

    For the screenshot you display, the command is simply DROP LOGIN, but that will only remove the login from the SQL Server level, not from the database to that end you would use DROP USER. ...but if the user is actually stored in an application-specific table it is still not going to help.

    Monday, May 15, 2017 8:13 AM

  • Let me to clear it more. Consider "hotmail.com", when you create an email then your email is a username in DB and my web portal is like that. some users create usernames and I like to remove them. Can you show me a MS-SQL command for query a specific name? I guess after it we can find more useful information. 

    I got what you are saying but the information, username, would be stored in some table and we dont know which table is that so it would be difficult to tell

    Cheers,

    Shashank

    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it

    My TechNet Wiki Articles

    MVP

    I know the usernames. Can you show me a SQL query for find tables and...based on username?
    Monday, May 15, 2017 12:11 PM

  • I know the usernames. Can you show me a SQL query for find tables and...based on username?

    If that is the case below link should help you

    How to find any value in SQL Server


    Cheers,

    Shashank

    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it

    My TechNet Wiki Articles

    MVP

    Tuesday, May 16, 2017 4:16 AM

  • I know the usernames. Can you show me a SQL query for find tables and...based on username?

    If that is the case below link should help you

    How to find any value in SQL Server


    Cheers,

    Shashank

    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it

    My TechNet Wiki Articles

    MVP

    Thank you, But in this page I see some SQL commands, Which one is OK? I don't like my DB removed or...
    Sunday, May 21, 2017 5:57 AM
  • That's a search function, so it will not delete anything. Using the one on the top, is probably the best bet.

    Sunday, May 21, 2017 3:47 PM