Last post Oct 21, 2019 09:10 AM by Yang Shen
Oct 18, 2019 01:24 PM|Gowtham Jaisankar|LINK
What is the T-SQL Query to create a new user and how to give access in T-SQL
Oct 18, 2019 05:12 PM|PatriceSc|LINK
Seems you are looking for https://docs.microsoft.com/en-us/sql/t-sql/statements/create-user-transact-sql?view=sql-server-ver15
You could then add this user to the db_datareader/db_datawriter roles:
You create a user so that your web app can read and write to the application db ? Some more context could perhaps help to better understand which level of information you need.
Oct 21, 2019 09:10 AM|Yang Shen|LINK
What is the T-SQL Query to create a new user
You can refer to SQL Server Script to create a new user, the query should be like below:
CREATE LOGIN NewUserName WITH PASSWORD = 'password'
how to give access in T-SQL
Maybe you could try the GRANT method in sql server which you can refer to Granting
table level permissions in SQL Server for how to use it.
GRANT SELECT ON "dbo"."DatabaseName" TO "UserName"`
Hope this could help.