存储过程
Posted folover
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了存储过程相关的知识,希望对你有一定的参考价值。
USE [GTAQZHPJK] GO /****** Object: StoredProcedure [dbo].[SP_InitWebSite] Script Date: 12/07/2017 10:13:33 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[SP_InitWebSite] @SiteId INT --站点ID AS BEGIN DECLARE @NewColumnId INT; DECLARE @NewModelId INT; BEGIN INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N‘课程介绍‘, NULL, 100,0, @SiteId, 1, 1, 0, GETDATE()); SET @NewColumnId = @@IDENTITY; INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate],[IsIndexShow]) VALUES (N‘专业介绍‘, @NewColumnId, 110, 0, @SiteId, 1, 1, 0, GETDATE(),1); SET @NewModelId = @@IDENTITY; INSERT [WebAreas] ( [Name],[ShowName],[EnglishName],[FrontSettingId],[PageSize],[HasColumnTwo],[Type], [OrderIndex],[ColumnId], [WebSiteId], [IsDeleted], [CreateDate]) VALUES (N‘专业介绍‘,‘专业介绍‘, ‘Professional introduction‘,0,1,0,0,110, @NewModelId, @SiteId, 0, GETDATE()); INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate],[IsIndexShow]) VALUES (N‘课程特色‘, @NewColumnId, 120, 0, @SiteId, 1, 1, 0, GETDATE(),0); SET @NewModelId = @@IDENTITY; INSERT [WebAreas] ( [Name],[ShowName],[EnglishName],[FrontSettingId],[PageSize],[HasColumnTwo],[Type], [OrderIndex],[ColumnId], [WebSiteId], [IsDeleted], [CreateDate]) VALUES (N‘课程特色‘,‘课程特色‘, ‘Course characteristics‘,0,1,0,0,210, @NewModelId, @SiteId, 0, GETDATE()); INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate],[IsIndexShow]) VALUES (N‘课程简介‘, @NewColumnId, 130, 0, @SiteId, 1, 1, 0, GETDATE(),0); SET @NewModelId = @@IDENTITY; INSERT [WebAreas] ( [Name],[ShowName],[EnglishName],[FrontSettingId],[PageSize],[HasColumnTwo],[Type], [OrderIndex],[ColumnId], [WebSiteId], [IsDeleted], [CreateDate]) VALUES (N‘课程简介‘,‘课程简介‘, ‘‘,0,1,0,0,120, @NewModelId, @SiteId, 0, GETDATE()); INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate],[IsIndexShow]) VALUES (N‘教学大纲‘, @NewColumnId, 140, 0, @SiteId, 1, 1, 0, GETDATE(),0); SET @NewModelId = @@IDENTITY; INSERT [WebAreas] ( [Name],[ShowName],[EnglishName],[FrontSettingId],[PageSize],[HasColumnTwo],[Type], [OrderIndex],[ColumnId], [WebSiteId], [IsDeleted], [CreateDate]) VALUES (N‘教学大纲‘,‘教学大纲‘, ‘‘,0,1,0,0,130, @NewModelId, @SiteId, 0, GETDATE()); INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate],[IsIndexShow]) VALUES (N‘课程标准‘, @NewColumnId, 150, 0, @SiteId, 1, 1, 0, GETDATE(),0); SET @NewModelId = @@IDENTITY; INSERT [WebAreas] ( [Name],[ShowName],[EnglishName],[FrontSettingId],[PageSize],[HasColumnTwo],[Type], [OrderIndex],[ColumnId], [WebSiteId], [IsDeleted], [CreateDate]) VALUES (N‘课程标准‘,‘课程标准‘, ‘‘,0,1,0,0,140, @NewModelId, @SiteId, 0, GETDATE()); INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate],[IsIndexShow]) VALUES (N‘教学师资‘, NULL, 200,0, @SiteId, 1, 1, 0, GETDATE(),1); SET @NewColumnId = @@IDENTITY; INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate],[IsIndexShow]) VALUES (N‘课程负责人‘, @NewColumnId, 210, 0, @SiteId, 5, 5, 0, GETDATE(),0); SET @NewModelId = @@IDENTITY; INSERT [WebAreas] ( [Name],[ShowName],[EnglishName],[FrontSettingId],[PageSize],[HasColumnTwo],[Type], [OrderIndex],[ColumnId], [WebSiteId], [IsDeleted], [CreateDate]) VALUES (N‘课程负责人‘,‘课程负责人‘, ‘‘,0,1,0,0,200, @NewModelId, @SiteId, 0, GETDATE()); INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate],[IsIndexShow]) VALUES (N‘教师风采‘, @NewColumnId, 220, 0, @SiteId, 5, 5, 0, GETDATE(),0); INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate],[IsIndexShow]) VALUES (N‘教师简介‘, @NewColumnId, 230, 0, @SiteId, 1, 1, 0, GETDATE(),0); INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate],[IsIndexShow]) VALUES (N‘教学内容‘, NULL, 300,0, @SiteId, 1, 1, 0, GETDATE(),1); SET @NewColumnId = @@IDENTITY; INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate],[IsIndexShow]) VALUES (N‘电子教案‘, @NewColumnId, 310, 0, @SiteId, 1, 2, 0, GETDATE(),0); SET @NewModelId = @@IDENTITY; INSERT [WebAreas] ( [Name],[ShowName],[EnglishName],[FrontSettingId],[PageSize],[HasColumnTwo],[Type], [OrderIndex],[ColumnId], [WebSiteId], [IsDeleted], [CreateDate]) VALUES (N‘电子教案‘,‘电子教案‘, ‘‘,0,1,0,0,150, @NewModelId, @SiteId, 0, GETDATE()); INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate],[IsIndexShow]) VALUES (N‘课堂习题‘, @NewColumnId, 320, 0, @SiteId, 1, 2, 0, GETDATE(),0); SET @NewModelId = @@IDENTITY; INSERT [WebAreas] ( [Name],[ShowName],[EnglishName],[FrontSettingId],[PageSize],[HasColumnTwo],[Type], [OrderIndex],[ColumnId], [WebSiteId], [IsDeleted], [CreateDate]) VALUES (N‘课堂习题‘,‘课堂习题‘, ‘‘,0,1,0,0,160, @NewModelId, @SiteId, 0, GETDATE()); INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate],[IsIndexShow]) VALUES (N‘教学课件‘, @NewColumnId, 330, 0, @SiteId, 1, 3, 0, GETDATE(),0); SET @NewModelId = @@IDENTITY; INSERT [WebAreas] ( [Name],[ShowName],[EnglishName],[FrontSettingId],[PageSize],[HasColumnTwo],[Type], [OrderIndex],[ColumnId], [WebSiteId], [IsDeleted], [CreateDate]) VALUES (N‘教学课件‘,‘教学课件‘, ‘‘,0,1,0,0,170, @NewModelId, @SiteId, 0, GETDATE()); INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N‘教学视频‘, NULL, 400,0, @SiteId, 1, 1, 0, GETDATE()); SET @NewColumnId = @@IDENTITY; INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate],[IsIndexShow]) VALUES (N‘教学动画‘, @NewColumnId, 410, 0, @SiteId, 2, 2, 0, GETDATE(),1); SET @NewModelId = @@IDENTITY; INSERT [WebAreas] ([Name], [ShowName],[FrontSettingId],[PageSize],[HasColumnTwo],[Type], [OrderIndex],[ColumnId], [WebSiteId], [IsDeleted], [CreateDate]) VALUES (N‘教学动画‘, ‘教学动画‘,0,3,0,0,220, @NewModelId, @SiteId, 0, GETDATE()); INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate],[IsIndexShow]) VALUES (N‘教学视频‘, @NewColumnId, 420, 0, @SiteId, 2, 2, 0, GETDATE(),1); SET @NewModelId = @@IDENTITY; INSERT [WebAreas] ([Name], [ShowName],[EnglishName],[FrontSettingId],[PageSize],[HasColumnTwo],[Type], [OrderIndex],[ColumnId], [WebSiteId], [IsDeleted], [CreateDate]) VALUES (N‘教学视频‘, ‘教学视频‘,‘flash‘,0,3,0,0,230, @NewModelId, @SiteId, 0, GETDATE()); INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N‘实践展示‘, NULL, 500,0, @SiteId, 1, 1, 0, GETDATE()); SET @NewColumnId = @@IDENTITY; INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate],[IsIndexShow]) VALUES (N‘实训指导‘, @NewColumnId, 510, 0, @SiteId, 2, 3, 0, GETDATE(),0); SET @NewModelId = @@IDENTITY; INSERT [WebAreas] ([Name], [ShowName],[EnglishName],[FrontSettingId],[PageSize],[HasColumnTwo],[Type], [OrderIndex],[ColumnId], [WebSiteId], [IsDeleted], [CreateDate]) VALUES (N‘实训指导‘, ‘实训指导‘,‘flash‘,0,1,0,0,180, @NewModelId, @SiteId, 0, GETDATE()); INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate],[IsIndexShow]) VALUES (N‘实践展示‘, @NewColumnId, 520, 0, @SiteId, 2, 4, 0, GETDATE(),0); INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N‘教研教改‘, NULL, 600,0, @SiteId, 1, 1, 0, GETDATE()); SET @NewColumnId = @@IDENTITY; INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate],[IsIndexShow]) VALUES (N‘教学方法‘, @NewColumnId, 610, 0, @SiteId, 4, 4, 0, GETDATE(),1); SET @NewModelId = @@IDENTITY; INSERT [WebAreas] ([Name], [ShowName],[EnglishName],[FrontSettingId],[PageSize],[HasColumnTwo],[Type], [OrderIndex],[ColumnId], [WebSiteId], [IsDeleted], [CreateDate]) VALUES (N‘教学方法‘, ‘教学方法‘,‘‘,0,1,0,0,190, @NewModelId, @SiteId, 0, GETDATE()); INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N‘教学展示‘, NULL, 700,0, @SiteId, 1, 1, 0, GETDATE()); SET @NewColumnId = @@IDENTITY; INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate],[IsIndexShow]) VALUES (N‘教学展示‘, @NewColumnId, 710, 0, @SiteId, 2, 4, 0, GETDATE(),1); SET @NewModelId = @@IDENTITY; INSERT [WebAreas] ([Name], [ShowName],[EnglishName],[FrontSettingId],[PageSize],[HasColumnTwo],[Type], [OrderIndex],[ColumnId], [WebSiteId], [IsDeleted], [CreateDate]) VALUES (N‘教学展示‘, ‘教学展示‘,‘‘,0,3,0,0,100, @NewModelId, @SiteId, 0, GETDATE()); INSERT [Columns] ([Name], [ParentId], [OrderIndex], [IsHidden], [WebSiteId], [Type], [DetailType], [IsDeleted], [CreateDate]) VALUES (N‘教学成果‘, @NewColumnId, 720,0, @SiteId, 2, 4, 0, GETDATE()); SET @NewModelId = @@IDENTITY; INSERT [WebAreas] ([Name], [ShowName],[EnglishName],[FrontSettingId],[PageSize],[HasColumnTwo],[Type], [OrderIndex],[ColumnId], [WebSiteId], [IsDeleted], [CreateDate]) VALUES (N‘教学成果‘, ‘教学成果‘,‘Teaching achievements‘,0,100,0,0,240, @NewModelId, @SiteId, 0, GETDATE()); END END
以上是关于存储过程的主要内容,如果未能解决你的问题,请参考以下文章