-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScript.sql
More file actions
54 lines (41 loc) · 811 Bytes
/
Script.sql
File metadata and controls
54 lines (41 loc) · 811 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
CREATE PROCEDURE ExcluirTimePorId
(
@TimeId int
)
as
begin
Delete from Times where TimeId = @TimeId
end
exec ExcluirTimePorId @TimeId = 2
end
CREATE PROCEDURE AtualizarTime
(
@TimeId Int,
@Time nvarchar(100),
@Estado char(2),
@Cores varchar(50)
)
as
begin
Update Times set Time = @Time,
Estado = @Estado, Cores = @Cores
where TimeId = @TimeId
end
exec AtualizarTime @TimeId = 1, @Time = ' a' , @Estado = 'JH' , @Cores = ' Cor'
select * from Times
CREATE PROCEDURE IncluirTime
(
@Time nvarchar(100),
@Estado char(2),
@Cores varchar(50)
)
as
begin
Insert into Times values (@Time, @Estado, @Cores)
end
exec IncluirTime @Time = 'time J' , @Estado = 'IJ', @cores = 'rubro'
CREATE PROCEDURE ObterTimes
as
begin
Select TimeId, Time, Estado, Cores from Times
end