How do you create a row in a table without using the VALUES key word in T-SQL

170 views Asked by At

I got asked an interview question that I haven't a clue how to answer and was curious how you would write a script for something like this.

"Write a statement that creates a row representing you in the Employees table without using the VALUES key word."

How would you create a new row in a table and then add your name to the row without using the VALUES() keyword?

This is the only what that I know how to do something like this but it involves using the VALUES keyword.

INSERT INTO Employees (FirstName, LastName)
VALUES ('John', 'Johnson');
1

There are 1 answers

0
juergen d On BEST ANSWER
insert into Employees (FirstName, LastName)
select 'John', 'Johnson'

That way you can easily insert records from other tables or even use joins.