Procedure is undoubtedly a major topic ..
I have no experience in operating SQL-server for Custom procedure, but I am familiar with writing procedure. Thank you ..
Below is a previous Program Used prodecure, which includes input and output parameter settings.
/**/ /** *** Object: Stored Procedure DBO. pro_checkadminlogin script Date: 16:37:25 ******/
Create Procedure Pro_checkadminlogin
(
@ Username Nvarchar ( 20 ),
@ Password Char ( 32 ),
@ Lastloginip Char ( 15 ),
@ Output Int Output
)
As
If Exists ( Select ID From Admin Where Username = @ Username And Password = @ Password )
Begin
Update Admin Set Lastloginip = @ Lastloginip , Lastlogintime = Getdate () Where Username = @ Username
Set @ Output = 0 -- Verification passed
End
Else
Begin
Set @ Output =- 1 -- Incorrect account password
End
Go
-- ---------
//
// Alter
Alter Procedure Pro_procedurename
As
[ SQL statements ]
// Drop
Drop Procedure Pro_procedurename
After reading this article, I learned that the procedure of MS-sqlserver can be encrypted.
ExampleCreate ProcedureP_xxx
WithEncryption
As
[SQL statements]
Go
Benefits of procedure:
The system has pre-compiled once, which greatly improves the efficiency.
Some business rules can be completed in procedure for convenient modification (you do not need to change the source Background Program)
Of course, I still know about encryption-improved securityEncryption
SQL-server also provides system procedure (SP _) and extended procedure (XP _)
Example of Adding users using the system stored procedure:
Exec sp_addlogin 'lala _ connectname', 'pwd', 'db _ name'
Go
----
You can also understand that you can use extended procedure to operate the Windows Command Line interpreter after you have the SA permission,
Use master [<-- master database is the SQL-Server database for storing procedure in the system]
Go
Exec xp_cmdshell 'dir c: \ *. EXE'
This xp_cmdshell is the method for Executing command lines in the sqlserver system.
It is estimated that most of the SQL injected statements with the most hack in the previous period will be used to discuss the next permission after successful injection ..