more progress
This commit is contained in:
parent
ede82e7137
commit
461faa9184
3 changed files with 40 additions and 40 deletions
|
|
@ -1,22 +1,24 @@
|
|||
CREATE VIEW V_Orders
|
||||
-- =============================================
|
||||
-- Author: Morgan Yarbrough
|
||||
-- Create date: 4/27/2015
|
||||
-- Description: Test Procedure that shows off language features.
|
||||
-- Includes non-standard folding using region comments using either
|
||||
-- line comments or block comments (both are demonstrated below)
|
||||
-- =============================================
|
||||
CREATE PROCEDURE dbo.TestProcedure
|
||||
|
||||
--#region parameters
|
||||
@vint INT = 1;
|
||||
--#endregion
|
||||
|
||||
AS
|
||||
SELECT
|
||||
|
||||
--#region Orders
|
||||
Orders.OrderID
|
||||
,Orders.CustomerID
|
||||
,Orders.OrderDate
|
||||
--#endregion
|
||||
BEGIN
|
||||
-- SET NOCOUNT ON added to prevent extra result sets from
|
||||
-- interfering with SELECT statements.
|
||||
SET NOCOUNT ON;
|
||||
|
||||
/*#region Customers*/
|
||||
,Customers.CompanyName
|
||||
,Customers.ContactName
|
||||
/*#endregion*/
|
||||
|
||||
--#region Other
|
||||
,DATEFROMPARTS(YEAR(GETDATE()), 1, 1) AS FirstDayOfYear
|
||||
--#endregion
|
||||
|
||||
FROM Orders
|
||||
INNER JOIN Customers
|
||||
ON Orders.CustomerID = Customers.CustomerID
|
||||
SELECT Orders.OrderID, Customers.CompanyName, DATEFROMPARTS(YEAR(GETDATE()), 1, 1) AS FirstDayOfYear
|
||||
FROM Orders
|
||||
INNER JOIN Customers
|
||||
ON Orders.CustomerID = Customers.CustomerID
|
||||
END
|
||||
Loading…
Add table
Add a link
Reference in a new issue