- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstar_database.sql
More file actions
Latest commit
58 lines (50 loc) · 1.35 KB
/
Copy pathstar_database.sql
File metadata and controls
58 lines (50 loc) · 1.35 KB
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
55
56
57
58
/*
Description
Create star (*) database to investigate obscure naming in SQL Server custom elements.
*/
USE [tempdb];
/** cleanup **
DROP DATABASE [*];
*/
SELECT
SERVERPROPERTY ('InstanceDefaultDataPath') AS [InstanceDefaultDataPath],
SERVERPROPERTY ('InstanceDefaultLogPath') AS [InstanceDefaultLogPath];
-- Take the full directory names and insert in the statement below.
CREATEDATABASE [*]
ONPRIMARY ( NAME=N'star_data', FILENAME=N'L:\SSDB2019\Data\star_data.mdf', SIZE = 8MB, FILEGROWTH = 8MB )
LOGON ( NAME=N'star_log', FILENAME=N'L:\SSDB2019\TransLog\star_log.ldf', SIZE = 8MB, FILEGROWTH = 8MB );
GO
ALTER AUTHORIZATION ONDATABASE::[*] TO [sa];
GO
USE [*];
GO
CREATESCHEMA [*] AUTHORIZATION [dbo];
GO
-- DROP TABLE [*].[*];
CREATETABLE [*].[*]
(
[*] bigintNOTNULLIDENTITY (0, 2),
[%] nvarchar(42) NULL,
[<] intnull,
[>] intnull
);
GO
ALTERTABLE [*].[*] ADDCONSTRAINT
[PK_star] PRIMARYKEYCLUSTERED
([*]) ON [PRIMARY];
GO
--TRUNCATE TABLE [*].[*];
USE [*];
INSERTINTO [*].[*] ([%],[<],[>])
VALUES
(N'række0', 1000, -1000),
(N'rÆkke1', 10, -100),
(N'räkke2', 237, 7);
GO
USE [*];
SELECT [*] FROM [*].[*];
SELECT*FROM [*].[*];
SELECTCOUNT(*) AS [**] FROM [*].[*];
SELECT*FROM [*].[*] WHERE [%] LIKE'%ä%';
SELECT*FROM [*].[*] WHERE [<]<500;
SELECT*FROM [*].[*] WHERE [>]<0;