Create a database user using “CREATE USER” statement

Simply creating a login will not guarentee access to the sql server database. A login gives access to an instance of SQL Server, but does not have permission to access the databases. To grant a userid to have access to a database, we need to switch to the database, and then use the CREATE USER […]
Continue reading…

Enjoyed this post? Share it!

 
 

Access control to the database engine using “CREATE LOGIN” statement

To access the Microsoft sql server, users require a login. The login can be a windows account, windows group memner account or a sql server login. To grant a user access to a database we need to create a login for the user. The login lets the user connect to the SQL Server. This login […]
Continue reading…

Enjoyed this post? Share it!

 
 

Read data from table using “SELECT” statement

The SELECT statement is the most common Transact-SQL statement. To read the data in a table – Type and execute the following statements to read the data in the Items table. — The basic syntax for reading data from a single table SELECT ItemID, ItemName, Price, ItemDescription FROM dbo.Items GO An asterisk is used to […]
Continue reading…

Enjoyed this post? Share it!

 
 

Create new table in Mssql database with “CREATE TABLE” statement

To create a table we can use the Query Editor window of the SQL Server management studio. We must provide the name of the table and names,datatypes of each column in the table. Its useful to indicate whether null values are allowed in each column. Before we create a table, we must indicate the database […]
Continue reading…

Enjoyed this post? Share it!

 
 

Create new Mssql databases with “CREATE DATABASE” statement

Transact-SQL statements can be used to access the database engine directly.To create a database we can use the Query Editor window of the SQL Server management studio. The command to create a database is CREATE DATABASE TestDB GO Additional help information can be obtained on the complete syntax of the CREATE DATABASE by highlighting the […]
Continue reading…

Enjoyed this post? Share it!