All the famous SA username in SQLSERVER: can it be used in different ways?

In my last project year, I am doing what I call - SeeQuaL, and this is one interface for accessing the 3 most famous types of databases - SQLite, SQL Server and MySql . I am sure that I can succeed with SQLite and MySql. But SQL Server, meh! Will definitely give me problems.

Now let's look at the case when SQL Server Express 2005 is installed on my system, but I do not have a management studio. To access my databases, I will need to log in using SQL Server Authentication ModeAKA via the all famous login - SA.

So here is my question:

How to enable this account (sa) and set up authentication of the server "SQL Server and Windows Authentication" WITHOUT using the management studio

I have no idea how to do this :( So please help me guys! Is there a table that I need to access the Windows authentication mode with which I can do this job?

+3
source share
3 answers

If you are writing something that claims to be a replacement for Management Studio, find out what Management Studio does first.

, Management Studio Script "Script " , "".

SQL, Management Studio :

USE [master]
GO
EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'LoginMode', REG_DWORD, 2
GO

- Profiler. Developer Edition.

+5

, , .

SQL Server Windows , , M $ .

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\MSSQLServer

REG_DWORD LoginMode, 1 Windows, 2, Windows + SQL. , 1 2 SQLEXPRESS.

, , sa , .

SQL-, SQLEXPRESS

sqlcmd -S localhost\SQLEXPRESS

exeucte

1> ALTER LOGIN sa ENABLE ;
2> ALTER LOGIN sa WITH PASSWORD = 'mypassword' ;
3> GO

.

URL-:

+4

-, Windows? , ? , Windows 7, Vista​​p >

You can test by closing and reopening SMSE without administrator rights and try connecting to your SA information.

0
source

Source: https://habr.com/ru/post/1732634/


All Articles