Showing posts with label SQL. Show all posts
Showing posts with label SQL. Show all posts

Wednesday, April 25, 2012

Simple, very simple Stored Procedure


USE [Bank]
GO
/****** Object:  StoredProcedure [dbo].[my_sp3]    Script Date: 04/25/2012 20:11:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER procedure [dbo].[my_sp3]
@name varchar(20)
as

select a.account_id, a.balance, a.[type]
from account a, customer c
where (a.customer_id = c.customer_id) and (c.first_name = @name)

____________________________________________________

You can call this procedure as below :

exec my_sp3 'Бат'

Sunday, February 12, 2012

Өгөгдлийн сангийн үндэс

Өгөгдлийн сангийн үндэс хичээлийн зарим презентейшний хувилбарыг энд байрлууллаа. Авч үзээд асуудал гарвал холбогдоорой.

  1. Select comand
  2. DML & DCL хэлбэрүүд
  3. Calculated fields
  4. Subquery
  5. Stored Procedure