DotText資料庫分析(2)

來源:互聯網
上載者:User
(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)
)

as

Declare @Flag int
Set @Flag = 55
if(@IsHashed = 1)
Set @Flag = 63

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())

exec blog_InsertBlogProfile @@Identity,@City


GO

值得注意的一點是:傳入預存程序的參數Password已經加密過了。
再看blog_InsertBlogProfileCREATE Proc blog_InsertBlogProfile
(
    @BlogID int,
    @City nvarchar(150)
)

as

 Insert blog_Profile ( BlogID,City)
 values (@BlogID, @City)






GO

在blog_Profile表中添加blog所在城市資訊。
先看看blog_profile表結構

一般來說,City欄位應該放在blog_config表中,為什麼把它令外放在一個表裡?等以後再研究。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.