Skip to content

Instantly share code, notes, and snippets.

@sqlparser
sqlparser / indentation block of stored procedure with begin end
Created April 9, 2014 01:47
indentation block of stored procedure with begin end
CREATE PROCEDURE humanresources.Uspgetallemployees
AS
BEGIN
SELECT lastname,
firstname,
jobtitle,
department
FROM humanresources.vemployeedepartment;
END
@sqlparser
sqlparser / indentation block stored procedure body
Created April 9, 2014 01:46
indentation block stored procedure body
CREATE PROCEDURE humanresources.Uspgetallemployees
AS
SELECT lastname,
firstname,
jobtitle,
department
FROM humanresources.vemployeedepartment;
@sqlparser
sqlparser / indentation generic size
Created April 8, 2014 09:48
indentation generic size
SELECT
lastname,
firstname,
jobtitle,
department
FROM humanresources.vemployeedepartment;
@sqlparser
sqlparser / blank lines sql server go statement
Created April 8, 2014 09:34
blank lines sql server go statement
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
@sqlparser
sqlparser / blank lines sql server set statement
Created April 8, 2014 09:33
blank lines sql server set statement
SET @A = @B
SET @C = @D
SET @E = @F
SET @G = @H
@sqlparser
sqlparser / blank lines plsql vertical after declaration
Created April 8, 2014 09:03
blank lines plsql vertical after declaration
PROCEDURE Update_Student_GPA (nSSN IN number)
IS
@sqlparser
sqlparser / blank lines plsql vertical constant variable
Created April 8, 2014 09:02
blank lines plsql vertical constant variable
PROCEDURE Update_Student_GPA (nSSN IN number)
IS
<declaration>
<declaration>
BEGIN
<statements>;
END Update_Student_GPA;
@sqlparser
sqlparser / blank lines plsql vertical exception
Created April 8, 2014 09:01
blank lines plsql vertical exception
EXCEPTION
WHEN NO_DATA_FOUND THEN
<statements>
WHEN TOO_MANY_ROWS THEN
<statements>
WHEN OTHERS THEN
<statements>
@sqlparser
sqlparser / blank lines plsql loop
Created April 8, 2014 09:00
blank lines plsql loop
--
-- For each student returned by the query, add the student's social
-- security number to the PL/SQL table.
--
FOR Students_rec IN Students_cur LOOP
<statements>
END LOOP;
@sqlparser
sqlparser / blank lines plsql if_else_elsif
Created April 8, 2014 08:58
blank lines plsql if_else_elsif
--
-- If the student's grade point average meets the criteria for
-- mandatory academic counseling, add the student's name and social
-- security number to the list.
--
IF (nRealGPA < 1.5) THEN
<statements>
--
-- We also want to consider students who are failing two or more