FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
SQLonLinuxGettingStarted/InMemoryOLTP/NativelyCompiled.sql at master · DC-AC/SQLonLinuxGettingStarted · GitHub
DC-AC
/
SQLonLinuxGettingStarted
Public
Notifications
You must be signed in to change notification settings
Fork
2
Star
2
Code
Issues
1
Pull requests
0
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
SQLonLinuxGettingStarted
/
InMemoryOLTP
/
NativelyCompiled.sql
Copy path
More file actions
More file actions
Latest commit
History
History
History
28 lines (26 loc) · 780 Bytes
Breadcrumbs
SQLonLinuxGettingStarted
/
InMemoryOLTP
/
NativelyCompiled.sql
Copy path
File metadata and controls
28 lines (26 loc) · 780 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
CREATE OR ALTER
PROCEDURE
InMemory
.
Insert500ThousandVehicleLocations
WITH
NATIVE_COMPILATION
,
SCHEMABINDING
AS
BEGIN
ATOMIC
WITH
(
TRANSACTION
ISOLATION
LEVEL
=
SNAPSHOT
,
LANGUAGE
=
N
'
English'
)
DECLARE
@Counter
int
=
0
;
WHILE
@Counter
<
500000
BEGIN
INSERT
InMemory
.
VehicleLocations
(RegistrationNumber, TrackedWhen, Longitude, Latitude)
VALUES
(
N
'
EA-232-JB'
,
SYSDATETIME
(),
125
.
4
,
132
.
7
);
SET
@Counter
+
=
1
;
END
;
RETURN
0
;
END
;
GO
--
Rerun with Natively Compiled Stored Procedure
declare
@start
datetime2
set
@start
=
SYSDATETIME
()
EXECUTE
InMemory
.
Insert500ThousandVehicleLocations
select
datediff
(ms,@start,
sysdatetime
())
as
'
insert into memory-optimized table using native compilation (in ms)'
GO
Back
|
FazBrowse Home
|
New Git URL