SQL includes a simple stored procedure, sp_who that allows for fast monitoring of SQL server resources by examining active and inactive SQL processes. Even with an efficient facade and coding style, sp_who can be used to assess performance in several different ways:
The Session object is extensively used for many projects, but it is often misused to the point of becoming unwieldy if it isn’t appropriately managed.
The ‘Traditional’ Management
The traditional method of referencing a session key is to use a string literal:
Session("SessionID") = 12345
Session("SessID") = 12345
Session("SID") = 12345
Consider the following two examples:
Dim UserInput As String = "1'); DELETE FROM tblInjectionAttack;"
Dim SQL As String
SQL = "INSERT INTO tblInjectionAttack (Column1) VALUES ('" & UserInput & "')"
CREATE PROCEUDRE InsertInjection @UserInput NVARCHAR(500) AS INSERT INTO tblInjectionAttack (Column1) VALUES (@UserInput) --EXEC InsertInjection '1''); DELETE FROM tblInjectionAttack;'
In the first example, the SQL query will be injected and the attacker will be able to execute any command that they have access to. In the second example, the attacker’s SQL injection will be saved in Column1 and won’t be executed at all.
If you create a new user in a database, by default, that user has no privileges; however, if you need to remove existing privileges from an account, you can do so by executing the following query:
[sourcecode language="sql"]
–To deny access on one single table:
DENY SELECT,INSERT,UPDATE,DELETE ON [TableName] TO [Username]
ASP.NET makes managing uploaded images and creating thumbnails relatively straightforward. I have utilized the following process to accept an uploaded image, and resize it to a maximum size of 200×200 pixels. Read the rest of this entry »