මොඩියුල විශ්ලේෂණය Stored Procedure හඳුන්වා දීම.

Slides:



Advertisements
Similar presentations
Transact-SQL. 1. Declare float = 10 select * from customers where discnt
Advertisements

What Is a User-defined Function? Scalar Functions –Similar to a built-in function Multi-Statement Table-valued Functions –Content like a stored procedure.
Unit 5 Seminar. Derived Table A derived table is a virtual table that’s calculated on the fly from a select statement. The biggest benefit of using derived.
Stored Procedures and Functions Rose-Hulman Institute of Technology Curt Clifton.
Module 10: Implementing User-defined Functions. Overview What Is a User-defined Function? Defining Examples.
Module 9: Implementing Stored Procedures. Introduction to Stored Procedures Creating Executing Modifying Dropping Using Parameters in Stored Procedures.
8/6/ ITE 370: SQL Stored Procedures. 8/6/ Stored Procedures A stored procedure is A stored procedure is a collection of SQL statements saved.
02 | Advanced SELECT Statements Brian Alderman | MCT, CEO / Founder of MicroTechPoint Tobias Ternstrom | Microsoft SQL Server Program Manager.
Integrating Business Intelligence with the Enterprise Peter Thanisch.
FLogging: Metric Collection on the High Seas Joe Ludwig Director of Development Flying Lab Software.
IMS 4212: Application Architecture and Intro to Stored Procedures 1 Dr. Lawrence West, Management Dept., University of Central Florida
Stored Procedures (dynamic Order By + Web Assistant Wizard) Kevin Penny, MMCP
Defining Stored Procedures Named Collections of Transact-SQL Statements Encapsulate Repetitive Tasks Five Types (System, Local, Temporary, Remote, and.
Dinamic SQL & Cursor. Why Dinamic SQL ? Sometimes there is a need to dynamically create a SQL statement on the fly and then run that command. This can.
Dexterity | CONFIDENTIAL 2009 MRO | Analytics | Insights 1 Stored Procedures.
Module 8: Implementing Stored Procedures. Introducing Stored Procedures Creating, Modifying, Dropping, and Executing Stored Procedures Using Parameters.
Module 9 Designing and Implementing Stored Procedures.
Module 9: Introduction to Programming Objects. Overview Displaying the Text of a Programming Object Introduction to Views Advantages of Views Creating.
04 | Grouping and Aggregating Data Brian Alderman | MCT, CEO / Founder of MicroTechPoint Tobias Ternstrom | Microsoft SQL Server Program Manager.
Database Unit Test MSSQL 2008 & VS 2010 Aung Kyaw Myo.
Module 18 Querying XML Data in SQL Server® 2008 R2.
Module 8: Implementing Stored Procedures. Overview Implementing Stored Procedures Creating Parameterized Stored Procedures Working With Execution Plans.
10 | Programming with Transact-SQL Graeme Malcolm | Senior Content Developer, Microsoft Geoff Allix | Principal Technologist, Content Master.
Creating a dynamic search form with database paging Tony Rogerson SQL Server MVP Torver Computer Consultants.
SQL Server User Defined Functions. CREATE FUNCTION [ schema_name. ] function_name ( [ [ AS ][ type_schema_name. ] parameter_data_type.
Slide 1 of 19Session 13 Ver. 1.0 Querying and Managing Data Using SQL Server 2005 In this session, you will learn to: Implement stored procedures Implement.
IBuySPY Shopping Store. Data Model for IBuySPY Shopping Store.
Learningcomputer.com SQL Server 2008 –Views, Functions and Stored Procedures.
05 | SET Operators, Windows Functions, and Grouping Brian Alderman | MCT, CEO / Founder of MicroTechPoint Tobias Ternstrom | Microsoft SQL Server Program.
Parametre og variable i T-SQL 1.Parametre (input) 2.Parametre (output) 3.Variable.
Module 3: Using XML. Overview Retrieving XML by Using FOR XML Shredding XML by Using OPENXML Introducing XQuery Using the xml Data Type.
Ch 5. Introducing More Database Objects. Database Objects Table (ch2) View (ch3) Stored Procedure Trigger Function User-defined types.
Ch 3. Working with Tables and Views. Data type Specify type of data to be entered into a column (text, number, datetime, etc) Unicode (National) Datatypes.
Ch 7. Working with relational data. Transactions Group of statements executed as a group. If all statements execute successfully, changes are committed.
Module 9: Using Advanced Techniques. Considerations for Querying Data Working with Data Types Cursors and Set-Based Queries Dynamic SQL Maintaining Query.
Module 8: Using Programming Objects for Data Retrieval.
SQL SERVER.   Optionally, some other XML 
SQLSaturday Paris 2015 Plans d’execution Optimisations.
Create Stored Procedures and Functions Database Management Fundamentals LESSON 2.4.
Module 9: Implementing Functions. Overview Creating and Using Functions Working with Functions Controlling Execution Context.
Module 9: Implementing User-Defined Functions. Overview Introducing User-Defined Functions Implementing User-Defined Functions.
Implementing Functions Advanced Database Dr. AlaaEddin Almabhouh.
1 c6212 Advanced Database and Client Server MS SQL Server 2000 Stored Procedures and Parameters What ? Why ? How ?
Module 5: Working with Subqueries. Writing Basic Subqueries Writing Correlated Subqueries Comparing Subqueries with Joins and Temporary Tables Using Common.
Transact SQL (T-SQL) Creating Stored Procedures, Functions and Triggers SoftUni Team Technical Trainers Software University
User-defined functions, Procedures, Triggers and Transactions
COMP 430 Intro. to Database Systems
Parameter Sniffing in SQL Server Stored Procedures
Task oriented processing
02 | Advanced SELECT Statements
10 | Programming with Transact-SQL
Chapter Name By Adrienne Watt
PROCEDURES, CONDITIONAL LOGIC, EXCEPTION HANDLING, TRIGGERS
All Powder Board and Ski
STORED PROCEDURES AND FUNCTION (9.6.1)
Why Should I Care About … Partitioned Views?
Why Should I Care About … Partitioned Views?
පාඨමාලා මාතෘකා Microsoft SQL Server Databases සැකසීම
Stored Procedures
Why Should I Care About … Partitioned Views?
Why Should I Care About … Partitioned Views?
Using Table Expressions
Why Should I Care About … Partitioned Views?
SQL Server Stored Procedures.
Customizing Controllers Controllers Customizing කර ගැනීම
Why Should I Care About … Partitioned Views?
Why Should I Care About … Partitioned Views?
Introduction to Programming with Python
“Magic numbers”, local variable and performance
View ایحاد وتغییر Viewایجاد ایندکس روی
Presentation transcript:

මොඩියුල විශ්ලේෂණය Stored Procedure හඳුන්වා දීම. Stored Procedures ක්‍රියාවට නැංවීම. Parameterized Stored Procedures ක්‍රියාවට නැංවීම. Parameter Sniffing. Function හඳුන්වා දීම. Scalar Functions ක්‍රියාවට නැංවීම. Table-Valued Functions ක්‍රියාවට නැංවීම.

Stored Procedure හඳුන්වා දීම. Stored Procedures සතු විය හැකි දේවල්, input parameters output parameters

Stored Procedures හි ප්‍රයෝජන security boundary වෙනවා. modular programming සක්‍රීය කරනවා. කාර්යක්‍ෂමතාව වැඩි කරනවා.

Stored Procedures ක්‍රියාවට නැංවීම. CREATE PROCEDURE CREATE PROCEDURE Sales.GetSalespersonNames AS BEGIN SELECT sp.SalesPersonlD, c.LastName, c.FirstName FROM Sales.salesperson AS sp INNER JOIN Person.Contact AS C ON sp.SalesPersonID = c.ContactID WHERE sp.TerritoryID IS NOT NULL ORDER BY sp.SalesPersonID END;

Stored Procedures Execute කිරීම….

Stored Procedure මාර්ගසූචක…..

ENCRYPTION සමඟ CREATE PROCEDURE HumanResources.EmployeeList WITH ENCRYPTION AS SELECT EmployeeID. LastName, FirstName FROM HumanResources. Employee;

Stored Procedures

Input Parameters භාවිතා කිරීම. CREATE PROCEDURE Sales.OrdersDateStatus @DueDate datetime, @Status tinyint = 5 AS SELECT SalesOrderID, OrderDate, CustomerID FROM Sales.SalesOrderHeader AS soh WHERE soh.DueDate = @DueDate AND soh.[Status] = @Status; GO

Output Parameters භාවිතා කිරීම. CREATE PROC sales GetOrderCountByDueDate @DueDate datetime, @orderCount int OUTPUT AS SELECT (OrderCount = C0UNT(1) FROM Sales.SalesOrderHeader AS soh WHERE soh.DueDate =@DueDate; GO DECLARE @DueDate datetime '20050713'; DECLARE @ordercount int; EXEC sales.GetOrderCountByDueDate @DueDate, @orderCount OUTPUT; SELECT @OrderCount;

Parameters pass කිරීම 

Parameter Sniffing…..

Parameter Sniffing

Function එකක් යනු?

Scalar Functions ක්‍රියාවට නැංවීම. CREATE FUNCTION dbo.ExtractProtocolFromURL ( @URL nvarchar(1000)) RETURNS nvarchar(1000) AS BEGIN RETURN CASE WHEN CHARINDEX(N':',@URL,1) >= 1 THEN SUBSTRING(@URL,1,CHARINDEX(N':',@URL,1) - 1) END; SELECT dbo.ExtractProtocolFromURL(N'http://www.microsoft.com'); IF (dbo.ExtractProtocolFromURL(@URL) = N'http') ...

Scalar Function

Table-Valued Functions ක්‍රියාවට නැංවීම.

Table-Valued Function

Stored Procedures සහ Functions භාවිතා කිරීම සම්පිණ්ඩනය Stored Procedure හඳුන්වා දීම. Stored Procedures ක්‍රියාවට නැංවීම. Parameterized Stored Procedures ක්‍රියාවට නැංවීම. Parameter Sniffing. Function හඳුන්වා දීම. Scalar Functions ක්‍රියාවට නැංවීම. Table-Valued Functions ක්‍රියාවට නැංවීම.