T-SQL stored procedure: Analyze permission storage and page correspondence

Source: Internet
Author: User
Create procedure w_function_getparams
As
Declare
@ Functionname_cn nvarchar (64 ),
@ Actionname nvarchar (32 ),
@ Pagename nvarchar (128 ),
@ Cache_fn nvarchiar (256 ),
@ Lenfn int,
@ Index_a int,
@ Index_ B int
Begin
Create Table # temp_tab
(
Id int identity (1, 1 ),
FN nvarchar (64 ),
An nvarchar (32 ),
Pn nvarchar (128)
)

Declare fn_cursor cursor
Select functionname from admin_functionlist where groupid = 0

Open fn_cursor;
Fetch next from fn_cursor into @ cache_fn;

While @ fetch_status = 0
Begin
Set @ lenfn = Len (@ cache_fn );
Set @ index_a = charindex ('|', @ cache_fn );
Set @ index_ B = charindex (':', @ cache_fn );

Set @ functionname_cn = substring (@ cache_fn, 0, @ index_a );
Set @ actionname = substring (@ cache_fn, @ index_a + 1, @ index_ B-@ Index_A-1 );
Set @ pagename = substring (@ cache_fn, @ index_ B + 1, @ lenfn-@ index_ B );

-- Print (@ functionname_cn );
-- Print (@ actionname );
-- Print (@ pagename );

Insert into # temp_tab values (@ functionname_cn, @ actionname, @ pagename)

Fetch next from fn_cursor into @ cache_fn;
End

Close fn_cursor;
Deallocate fn_cursor;

Select FN, An, PN from # temp_tab group by PN, An, FN

End

Data format:

Edit product information | EDIT: w_product_edit.aspx

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.