DotText数据库分析(2)
(2)blog_config表单相关存储过程
blog_config存储注册用户信息,由存储过程blog_UTILITY_AddBlog实现添加新Blog。代码如下:
CREATE Proc blog_UTILITY_AddBlog
(
@UserName nvarchar(50),
@Password nvarchar(50),
@Email nvarchar(50),
@Host nvarchar(50),
@Application nvarchar(50),
@Author nvarchar(50),
@Title nvarchar(100),
@SubTitle nvarchar(250),
@IsHashed bit,
@Skin nvarchar(50)='AnotherEon001',
@City nvarchar(50)
)
![](/Images/OutliningIndicators/None.gif)
as
![](/Images/OutliningIndicators/None.gif)
Declare @Flag int
Set @Flag = 55
if(@IsHashed = 1)
Set @Flag = 63
![](/Images/OutliningIndicators/None.gif)
Insert blog_Config (LastUpdated, UserName, Password, Email, Title, SubTitle, Skin, SkinCssFile,Application, Host, Author, TimeZone, Language, ItemCount, Flag,RegisterTime)
Values (getdate(),@UserName, @Password, @Email, @Title,@SubTitle, @Skin,null,@Application, @Host,@Author,8,'zh-CHS',10,@Flag,getdate())
![](/Images/OutliningIndicators/None.gif)
exec blog_InsertBlogProfile @@Identity,@City
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
GO
值得注意的一点是:传入存储过程的参数Password已经加密过了。
再看blog_InsertBlogProfile
CREATE Proc blog_InsertBlogProfile
(
@BlogID int,
@City nvarchar(150)
)
![](/Images/OutliningIndicators/None.gif)
as
![](/Images/OutliningIndicators/None.gif)
Insert blog_Profile ( BlogID,City)
values (@BlogID, @City)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
GO在blog_Profile表中添加blog所在城市信息。
先看看blog_profile表结构
![](/images/cnblogs_com/sooloo/blog_profile.jpg)
一般来说,City字段应该放在blog_config表中,为什么把它令外放在一个表里?等以后再研究。
blog_config存储注册用户信息,由存储过程blog_UTILITY_AddBlog实现添加新Blog。代码如下:
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
值得注意的一点是:传入存储过程的参数Password已经加密过了。
再看blog_InsertBlogProfile
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
先看看blog_profile表结构
![](/images/cnblogs_com/sooloo/blog_profile.jpg)
一般来说,City字段应该放在blog_config表中,为什么把它令外放在一个表里?等以后再研究。