Procedure:
[AdventureWorks2016CTP3].[dbo].[uspGetOrderTrackingBySalesOrderID]
Name | Value |
Schema | [dbo] |
Owner | [dbo] |
Creation date | 16.11.2015 |
Type | P |
Encrypted | |
ID | 2061250398 |
Implementation type | Transact SQL |
Is native compiled |
Name | Value |
QUOTED_IDENTIFIER | ON |
ANSI_NULLS | ON |
Name | Description | Datatype | Max length | Type | ReadOnly |
@SalesOrderID | int | 4 | Input |
Name | Datatype | Max length |
SalesOrderID | int | 4 |
CarrierTrackingNumber | nvarchar | 25 |
OrderTrackingID | int | 4 |
TrackingEventID | int | 4 |
EventName | nvarchar | 255 |
EventDetails | nvarchar | 2000 |
EventDateTime | datetime2 | 8 |
Object name | Object type | Dep level |
[Sales].[OrderTracking] | Table | 1 |
[Sales].[TrackingEvent] | Table | 1 |
SET ANSI_NULLS ON SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE [dbo].[uspGetOrderTrackingBySalesOrderID] @SalesOrderID [int] NULL AS BEGIN /* Example: exec dbo.uspGetOrderTrackingBySalesOrderID 53498 */ SET NOCOUNT ON; SELECT ot.SalesOrderID, ot.CarrierTrackingNumber, ot.OrderTrackingID, ot.TrackingEventID, te.EventName, ot.EventDetails, ot.EventDateTime FROM Sales.OrderTracking ot, Sales.TrackingEvent te WHERE ot.SalesOrderID = @SalesOrderID AND ot.TrackingEventID = te.TrackingEventID ORDER BY ot.SalesOrderID, ot.TrackingEventID; END; GO |