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)
);
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Get the database version

A

Select @@version

How well did you know this?
1
Not at all
2
3
4
5
Perfectly