hytos / ID2.Manager / MarkusSQL / InsertAss.SQL @ 67cfe4dc
이력 | 보기 | 이력해설 | 다운로드 (3.42 KB)
1 | 40ac2242 | taeseongkim |
|
---|---|---|---|
2 | USE markus_SEC; |
||
3 | GO |
||
4 | 2581c7b6 | taeseongkim | exec sp_configure |
5 | |||
6 | exec sp_configure 'clr enabled',1 |
||
7 | reconfigure with override |
||
8 | |||
9 | |||
10 | exec sp_configure 'show advanced options',1 |
||
11 | reconfigure with override |
||
12 | |||
13 | |||
14 | exec sp_configure 'clr strict security',0; |
||
15 | reconfigure with override |
||
16 | |||
17 | 40ac2242 | taeseongkim | ALTER DATABASE markus_SEC |
18 | SET TRUSTWORTHY ON; |
||
19 | |||
20 | 2581c7b6 | taeseongkim | |
21 | |||
22 | 40ac2242 | taeseongkim | IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MarkupDataCompress]')) |
23 | drop FUNCTION [dbo].[MarkupDataCompress] |
||
24 | |||
25 | IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MarkupDataDeCompress]')) |
||
26 | drop FUNCTION [dbo].[MarkupDataDecompress] |
||
27 | |||
28 | |||
29 | IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MarkupDataText]')) |
||
30 | drop FUNCTION [dbo].[MarkupDataText] |
||
31 | |||
32 | IF EXISTS (select * from sys.assemblies where name = 'MarkupDataParse') |
||
33 | drop ASSEMBLY MarkupDataParse
|
||
34 | |||
35 | IF EXISTS (select * from sys.assemblies where name = 'System.Runtime.Serialization') |
||
36 | drop ASSEMBLY [System.Runtime.Serialization]
|
||
37 | |||
38 | CREATE ASSEMBLY [System.Runtime.Serialization]
|
||
39 | FROM 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Runtime.Serialization.dll' |
||
40 | WITH PERMISSION_SET = UNSAFE; |
||
41 | |||
42 | create ASSEMBLY MarkupDataParse
|
||
43 | 2581c7b6 | taeseongkim | FROM 'D:\Markus_V3\dbFunctions\MarkupDataParse.dll' |
44 | 40ac2242 | taeseongkim | WITH PERMISSION_SET = UNSAFE; |
45 | 2581c7b6 | taeseongkim | |
46 | 40ac2242 | taeseongkim | go |
47 | 2581c7b6 | taeseongkim | |
48 | select * from sys.assemblies |
||
49 | |||
50 | |||
51 | 40ac2242 | taeseongkim | /****** Object: UserDefinedTableType [dbo].[VARCHAR_TABLE] Script Date: 2023-05-30 오전 10:22:07 ******/
|
52 | IF NOT EXISTS (SELECT * FROM sys.types st JOIN sys.schemas ss ON st.schema_id = ss.schema_id WHERE st.name = N'VARCHAR_TABLE' AND ss.name = N'dbo') |
||
53 | CREATE TYPE [dbo].[VARCHAR_TABLE] AS TABLE( |
||
54 | [ITEM] [varchar](max) NULL |
||
55 | ) |
||
56 | GO |
||
57 | /****** Object: UserDefinedFunction [dbo].[MarkupDataCompress] Script Date: 2023-05-30 오전 10:22:07 ******/
|
||
58 | SET ANSI_NULLS OFF
|
||
59 | GO |
||
60 | SET QUOTED_IDENTIFIER OFF
|
||
61 | GO |
||
62 | IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MarkupDataCompress]') AND type in (N'FN', N'IF', N'TF', N'FS', N'FT')) |
||
63 | BEGIN
|
||
64 | execute dbo.sp_executesql @statement = N'CREATE FUNCTION [dbo].[MarkupDataCompress](@inputString [nvarchar](max)) |
||
65 | RETURNS [nvarchar](max) WITH EXECUTE AS CALLER
|
||
66 | AS
|
||
67 | EXTERNAL NAME [MarkupDataParse].[MarkupDataParse.MarkupDataFunctions].[CompressString]'
|
||
68 | END
|
||
69 | GO |
||
70 | /****** Object: UserDefinedFunction [dbo].[MarkupDataDecompress] Script Date: 2023-05-30 오전 10:22:07 ******/
|
||
71 | SET ANSI_NULLS OFF
|
||
72 | GO |
||
73 | SET QUOTED_IDENTIFIER OFF
|
||
74 | GO |
||
75 | IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MarkupDataDecompress]') AND type in (N'FN', N'IF', N'TF', N'FS', N'FT')) |
||
76 | BEGIN
|
||
77 | execute dbo.sp_executesql @statement = N'CREATE FUNCTION [dbo].[MarkupDataDecompress](@inputString [nvarchar](max)) |
||
78 | RETURNS [nvarchar](max) WITH EXECUTE AS CALLER
|
||
79 | AS
|
||
80 | EXTERNAL NAME [MarkupDataParse].[MarkupDataParse.MarkupDataFunctions].[DecompressString]'
|
||
81 | END
|
||
82 | GO |
||
83 | /****** Object: UserDefinedFunction [dbo].[MarkupDataText] Script Date: 2023-05-30 오전 10:22:07 ******/
|
||
84 | SET ANSI_NULLS OFF
|
||
85 | GO |
||
86 | SET QUOTED_IDENTIFIER OFF
|
||
87 | GO |
||
88 | IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MarkupDataText]') AND type in (N'FN', N'IF', N'TF', N'FS', N'FT')) |
||
89 | BEGIN
|
||
90 | execute dbo.sp_executesql @statement = N'CREATE FUNCTION [dbo].[MarkupDataText](@inputString [nvarchar](max)) |
||
91 | RETURNS [nvarchar](max) WITH EXECUTE AS CALLER
|
||
92 | AS
|
||
93 | EXTERNAL NAME [MarkupDataParse].[MarkupDataParse.MarkupDataFunctions].[GetMarkupText]'
|
||
94 | END
|
||
95 | GO |
||
96 | /****** Object: Table [dbo].[ControlType] Script Date: 2023-05-30 오전 10:22:07 ******/
|
||
97 | SET ANSI_NULLS ON |
||
98 | GO |
||
99 | SET QUOTED_IDENTIFIER ON |