Sql Intermediate Flashcards
1
Q
Create a user defined table type BasicUTD
A
Create Type Dbo.BasicUDT as Table ( FirstName Varchar(50), LastName Varchar(50) );
2
Q
Add procedure using BasicUDT to add people in Person table.
A
Create Procedure dbo.InsertPeople @MyPeople BasicUDT readonly AS Begin Insert into person (firstname, lastname) Select firstname,lastname from @MyPeople End
3
Q
Restore a database backup
A
Put the backup .bak in MSSQL\backup folder, in ms sql server management studio, right click on database->restore database-> from device and choose the path of the backup
4
Q
Get the database version
A
Select @@version