做數據倉庫的同學們一定會用到DW(Data Warehouse)的代碼,有時候我們需要將DW代碼保存成HTML格式,以便于查看或者分享給其他同學。下面介紹一下如何將DW代碼保存為HTML文件。
首先,我們需要將DW代碼復制到一個文本編輯器中,例如NotePad、Sublime Text等。然后,在編輯器中選擇“另存為”功能,將文件類型改成HTML格式。
代碼部分可以使用pre標簽進行呈現,這樣會保留代碼的原始格式和排版,更加方便查看。
```
/*這里是DW代碼*/ CREATE TABLE [dbo].[DimDate]( [DateKey] [int] NOT NULL, [FullDate] [datetime] NOT NULL, [Day] [tinyint] NOT NULL, [Weekday] [tinyint] NOT NULL, [Month] [tinyint] NOT NULL, [Quarter] [tinyint] NOT NULL, [Year] [smallint] NOT NULL, [TheDate] [date] NOT NULL, CONSTRAINT [PK_DimDate] PRIMARY KEY CLUSTERED ( [DateKey] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY], ) ON [PRIMARY]``` 最后在HTML文件中使用p標簽包裹起來: ```
/*這里是DW代碼*/ CREATE TABLE [dbo].[DimDate]( [DateKey] [int] NOT NULL, [FullDate] [datetime] NOT NULL, [Day] [tinyint] NOT NULL, [Weekday] [tinyint] NOT NULL, [Month] [tinyint] NOT NULL, [Quarter] [tinyint] NOT NULL, [Year] [smallint] NOT NULL, [TheDate] [date] NOT NULL, CONSTRAINT [PK_DimDate] PRIMARY KEY CLUSTERED ( [DateKey] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY], ) ON [PRIMARY]``` 保存完畢后,用瀏覽器打開HTML文件,就可以看到DW代碼已經呈現出來。在查看的過程中,如果還想修改代碼,可以將HTML文件再次打開到編輯器中進行修改。
上一篇asp加vue
下一篇mysql命令行控制臺