IF EXISTS (SELECT * FROM sys.types WHERE is_table_type = 1 AND name = 'TestPassList')
DROP TYPE TestPassList
GO
CREATE TYPE dbo.TestPassList
AS TABLE
(
BookingIdMaster INT,
BookingId INT
);
GO
CREATE PROCEDURE sp_TestPassList
@List AS dbo.TestPassList READONLY
AS
BEGIN
SELECT *
FROM @List
END
GO
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'fn_TestPassList') AND type in (N'P', N'TF'))
DROP FUNCTION fn_TestPassList
GO
CREATE FUNCTION fn_TestPassList(@List AS dbo.TestPassList READONLY)
RETURNS @temptable
TABLE (
BookingId INT
)
AS
BEGIN
INSERT INTO @temptable
SELECT BookingId
FROM @List
RETURN
END
GO
----------- test
DECLARE @TestPassListVar dbo.TestPassList
INSERT INTO @TestPassListVar
SELECT TOP 10 billing_id Booking_IdMaster,
Booking_Id
FROM d_booking
SELECT *
FROM fn_TestPassList(@TestPassListVar)
Category :
Time: 9:29 PM
Category : principles
Time: 11:11 AM
Definition
- A. High-level modules should not depend on low-level modules. Both should depend on abstractions.
- B. Abstractions should not depend upon details. Details should depend upon abstractions.
my thanks to:
http://code.tutsplus.com/tutorials/solid-part-4-the-dependency-inversion-principle--net-36872
Category : sql
Time: 10:35 AM
“Pivot is a sql server operator that can be used to turn unique values from one column, into multiple columns in the output, there by effectively rotating a table”.
Column values are converted into column names
Represented in cross tab format…
my thanks to: http://www.youtube.com/watch?v=h3BtudZehuo
Read Pivot Statement
We are performing this aggregate function on the 1st column for 2nd column for column in “in”Represented in cross tab format…
my thanks to: http://www.youtube.com/watch?v=h3BtudZehuo
Category : architecture, principles
Time: 12:35 AM
http://net.tutsplus.com/tutorials/php/solid-part-3-liskov-substitution-interface-segregation-principles/
Subtypes must be substitutable for their base types.
Subtypes must be substitutable for their base types.
Subscribe to:
Comments (Atom)

