Query to insert into a Sqlserver table

Asked

Viewed 28 times

1

Sqlserver, given a table with the fields: id (int), name (nvarchar) and birth (smallDateTime)

How can I write a query to insert into this table and then query this data from all table records.

Id: 000015 Name: José Birth: 2001

  • using the command INSERT INTO

  • here is the documentation explaining and some examples that will help: https://docs.microsoft.com/pt-br/sql/t-sql/statements/insert-transact-sql?view=sql-server-ver15

1 answer

2


To enter a specific data use the INSERT:

INSERT INTO nome_da_tabela (id,nome,nascimento)
VALUES (000015,'José',2001)

To view all data from a table use the SELECT:

SELECT * FROM nome_da_tabela

Browser other questions tagged

You are not signed in. Login or sign up in order to post.