(2) blog_config table-related stored procedures
Blog_config stores the registered user information, and adds a new blog through the Stored Procedure blog_utility_addblog. The Code is as follows: 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
It is worth noting that the password parameter for passing in the stored procedure has been encrypted.
See blog_insertblogprofilecreate proc blog_insertblogprofile.
(
@ Blogid int,
@ City nvarchar (150)
)
As
Insert blog_profile (blogid, city)
Values (@ blogid, @ City)
Go
Add the city information of the blog in the blog_profile table.
First, let's look at the structure of the blog_profile table.
In general, the City field should be placed in the blog_config table. Why is it placed out of the table? Wait for further research.