تبلیغات
آموزش SQL - FUNCTIONS
 
آموزش SQL
الان میجنبم! فردا برای جنبیدن دیر است!!!
درباره وبلاگ


این وبلاگ زیر نظر مهندس یوسفی فرد مدیر گروه رشته کامپیوتر دانشگاه تمیشان بهشهر می باشد. در این وبلاگ مطالب آموزشی مربوط به درس SQL Server را قرار داده ام . امید است که مورد توجه شما کاربران عزیز قرار گیرد.

مدیر وبلاگ : Elham Sarfaraz
نویسندگان
آمار وبلاگ
  • کل بازدید :
  • بازدید امروز :
  • بازدید دیروز :
  • بازدید این ماه :
  • بازدید ماه قبل :
  • تعداد نویسندگان :
  • تعداد کل پست ها :
  • آخرین بازدید :
  • آخرین بروز رسانی :

FUNCTIONS :

ساختار کلی دستور ایجاد تابع:

CREATE FUNCTION  <fn_name>

  (

              <parameter_list>

 

)

RETURNS <retun_type>

AS

BEGIN

        

   <T_sql Statements>

       

RETURN <return_value>

END


مثال: تابعی تعریف كنید كه 2 عدد بگیرد و آن دو را در هم ضرب كند و مقدار آن را برگرداند.

CREATE  FUNCTION  Mul

(

     @a int,

     @b int

)

RETURNS bigint

AS

BEGIN

          DECLARE @r  bigint

          SET  @r=@a*@b

                        RETURN @r

END

SELECT  DBO.Mul   (3,5)  AS   ZARB

استفاده از تابع در SQL:

مثال:
ستونی به نام ضرب ایجاد کنید كه ستون های ID,Age را در هم ضرب كند.

SELECT

    ID,

    Firstname,

    Lastname,

Age   

DBO.Mul (ID,Age)  AS  ZARB

FROM

       Student

 

CREATE  FUNCTION  Mul

(

     @a int,

     @b int

)

RETURNS bigint

AS

BEGIN

          DECLARE @r  bigint

          SET  @r = @a * @b

                        RETURN @r

END

 

e.g)

SELECT  DBO.Mul   (3,8)  AS   ZARB

SELECT

    ID,

    Firstname,

    Lastname,

Age   

DBO.Mul (ID,Age)  AS  ZARB

FROM

       Student






نوع مطلب :
برچسب ها :
لینک های مرتبط :

       نظرات
جمعه 8 دی 1391
Elham Sarfaraz
پنجشنبه 31 مرداد 1398 11:54 ق.ظ
Patsy is what you can call me and I feel comfortable when we use complete name.
For a while he's visited Colorado and then he will never move.

After being out of my job countless soft drinks I became
an interviewer and Certain think I'll change it anytime
real soon. What I love doing would act the newest I'm suitable earn cash with it.
Check out the most recent news smaller website: http://potenzmittel-online-bestellen-de.eu/erozon-max.html
جمعه 25 مرداد 1398 04:29 ق.ظ
Hey! Quick question that's completely off topic. Do you know how to
make your site mobile friendly? My blog looks weird when viewing from
my iphone4. I'm trying to find a template or plugin that might be able
to fix this problem. If you have any suggestions, please
share. With thanks!
چهارشنبه 23 مرداد 1398 07:46 ب.ظ
No matter if some one searches for his necessary thing, thus he/she desires to be available that in detail, therefore
that thing is maintained over here.
چهارشنبه 23 مرداد 1398 04:22 ب.ظ
You can certainly see your skills in the article you write.
The arena hopes for even more passionate writers like you who are
not afraid to say how they believe. Always go after your heart.
یکشنبه 20 مرداد 1398 02:13 ب.ظ
excellent submit, very informative. I wonder
why the opposite specialists of this sector don't realize
this. You must proceed your writing. I am sure, you've a great readers'
base already!
پنجشنبه 17 مرداد 1398 11:30 ق.ظ
We're having coffee at Nylon Coffee Roasters on Everton Park
in Singapore. I'm having black coffee, he's having a cappuccino.

They are handsome. Brown hair slicked back, glasses that fit his face,
hazel eyes and the most beautiful lips I've seen. He or she is well developed, with incredible arms plus a chest that shines during this sweater.
We're standing ahead of each other speaking about how we
live, what we would like into the future, what we're trying to find on another person.
He starts saying that she has been rejected plenty of times.



‘Why Andrew? You're so handsome. I'd never reject you ', I only
say He smiles at me, biting his lip.

‘Oh, I wouldn't know. Everything happens for grounds right.
But inform me, you would not reject me, does one Ana?' He said.



‘No, how could I?' , I replied

"So, would you mind if I kissed you right now?' he was quoted saying as I am much better him and kiss him.

‘When don't ask, do exactly it.' I reply.

‘I prefer how you think.' , he said.

While waiting, I start scrubbing my hindfoot in his leg, massaging it slowly. ‘What exactly do you wish ladies? And, Andrew, don't spare me the details.' I ask.

‘I really like determined women. Someone that knows the things they want. Somebody that won't say yes just because I said yes. Someone who's unafraid when you attempt new things,' he says. ‘I'm never afraid when you try new stuff, especially in terms of making something totally new in bed ', I intimate ‘And I enjoy ladies who are direct, who cut from the chase, like you recently did. To get
honest, which is a huge turn on.
پنجشنبه 17 مرداد 1398 02:11 ق.ظ
You're so awesome! I do not think I've truly read through a single
thing like that before. So great to discover somebody with original thoughts on this subject matter.
Really.. thank you for starting this up. This website is something
that's needed on the internet, someone with a little originality!
چهارشنبه 16 مرداد 1398 12:29 ب.ظ
We're having coffee at Nylon Coffee Roasters on Everton Park in Singapore.
I'm having black coffee, he's having a cappuccino. He could be handsome.
Brown hair slicked back, glasses for his face, hazel eyes and the most
wonderful lips I've seen. They are nice, with incredible
arms including a chest that stands out with this sweater. We're standing right in front of one
another speaking about our way of life, what you want money for hard times,
what we're seeking on another person. He starts telling me
that he's been rejected a great deal of times.

‘Why Andrew? You're so handsome. I'd never reject you ', I
only say He smiles at me, biting his lip.


‘Oh, I wouldn't know. Everything happens for a good reason right.
But analyze, you would not reject me, would you Ana?' He said.


‘No, how could I?' , I replied

"So, utilize mind if I kissed you at the moment?' he explained as I receive nearer to him and kiss him.

‘Next time don't ask, accomplish it.' I reply.

‘I love how you think.' , he said.

In the meantime, I start scrubbing my your back heel in his leg, massaging it slowly. ‘What exactly do you like in females? And, Andrew, don't spare me the details.' I ask.

‘I love determined women. Someone to know what we want. A person who won't say yes even though I said yes. Someone who's not scared when trying a new challenge,' he says. ‘I'm never afraid when trying something mroe challenging, especially in terms of making interesting things in the bedroom ', I intimate ‘And I love women that are direct, who cut with the chase, like you recently did. For being
honest, that is a huge turn on.
چهارشنبه 16 مرداد 1398 08:03 ق.ظ
Fantastic goods from you, man. I have understand your stuff
prior to and you're simply extremely fantastic. I really
like what you've bought right here, certainly like what you are stating and the best way during which you assert it.
You make it entertaining and you still take care of to
keep it wise. I cant wait to read much more from you. This is
actually a terrific web site.
سه شنبه 15 مرداد 1398 05:36 ب.ظ
This post is invaluable. How can I find out more?
دوشنبه 14 مرداد 1398 11:41 ب.ظ
Hi there, its pleasant paragraph on the topic of media print,
we all be aware of media is a impressive source of information.
یکشنبه 13 مرداد 1398 07:25 ب.ظ
It's really a nice and useful piece of information. I'm satisfied that you just shared this useful info with us.
Please stay us up to date like this. Thanks for sharing.
شنبه 12 مرداد 1398 02:14 ب.ظ
What's up to all, how is everything, I think every one is getting more from
this web site, and your views are pleasant for new visitors.
جمعه 11 مرداد 1398 07:49 ق.ظ
Greetings. The author's name is Santiago Vos but he doesn't like are extremely use his full phone.
Colorado is her birth place but she will have to move one
day or another. He is really fond of body building and
now he has time to new options. Meter reading is my day job now but
soon I'll be on my own, personal. Her husband and her maintain web page.
You might wish to check it out: http://supplements-for-body-builders.com/armostrax.html
جمعه 11 مرداد 1398 03:05 ق.ظ
Santiago is his name and he totally digs that tag.
The favorite hobby for my children and me is to gather badges nevertheless i can't permit it to become my profession really.
Delaware is the only place he's been staying in. She used always
be unemployed obtain he is often a data processing officer.
He's not godd at design but you'll probably decide to to check his website: http://productos-para-la-alopecia.eu/propecia.html
چهارشنبه 9 مرداد 1398 02:45 ب.ظ
Hi there, I am Mallie Coggin. Montana is my living place and i have like in I need here.
For years I've been doing its job as a data processing officer although i plan on changing that
it. What Appreciate doing end up being to play baseball but Can not make it my profession really.
He's been using his website for quite some time now.
Continue reading here: http://brucia-grassi-efficace-it.eu/sliminazer.html
چهارشنبه 9 مرداد 1398 01:46 ب.ظ
Valentin is whatever you can call my wife and i doesn't be pleased at just.
My house has been in Montana. The job I've been occupying widespread beverages .
is an interviewer but I've always wanted a business. What
me and my family love to be able to climb however i can't make
certain it is my profession really. Her husband and her have
a website. May want to want to see it out: http://tabletkinaodchudzanie.com.pl/silvets/
سه شنبه 8 مرداد 1398 02:28 ق.ظ
5escortgirls Quick search and obtain the modern results
Locate a massage escort girl, discrete apartment or
any perfect and indulgent recreation. Looking for escort girls?

Discrete apartments? Produce a quick search by region
دوشنبه 7 مرداد 1398 02:01 ق.ظ

Really lots of great advice.
canadian medications list canadian pharmaceuticals for usa sales canada pharmacies online prescriptions buy viagra 25mg canadian medications pharmacy Canadian Pharmacy USA drugs for sale deep web canada viagra canada medication list how safe are canadian online pharmacies
شنبه 5 مرداد 1398 03:04 ق.ظ
Hi there, I am Mallie Coggin. For years I've been doing its job as a computer officer nonetheless plan on changing the software.
What Really like doing for you to play baseball but Not able to make it my
profession really. Montana has always been my living place and therefore i have trucking deliveries I need here.
He's been acting on his website for a few days now. Give it a try here:
http://produkte-gegen-haarausfall.eu/propecia.html
جمعه 4 مرداد 1398 10:47 ق.ظ
The writer's name is Jaime. What I love doing is kit cars and
i am just trying to make money with this particular.
Dispatching is what he delivers. My wife and i chose to exist in Montana.
He's not godd at design but may possibly want to use his website: http://produkte-gegen-haarausfall.eu/foligain.html
جمعه 4 مرداد 1398 05:58 ق.ظ
Tawanna Magdaleno is what her husband loves to call her although moment has come
not her birth status. Fishing is the hobby I will never stop doing.
New York is her birth locale. Meter reading is my profession for a little extra time and Certain think I'll change it anytime
promptly. Check out his website here: http://produits-contre-la-calvitie.eu/rogaine.html
پنجشنبه 3 مرداد 1398 10:14 ب.ظ
Dianne precisely what her husband loves to call her but large number of misspell everything.
Software developing is what he is doing but he's already went for another particular.
He is really fond of going to fitness the new he has time to take
on new things. For years I've been living in New York and won't ever move.
Check out my website here: http://seven-pride.com/de/tabletten-zum-muskelaufbau.html
چهارشنبه 2 مرداد 1398 10:47 ب.ظ
Hello! Allow me to start by saying my name - Jaime although i don't like when people use my full domain name.
He used with regard to unemployed but now he a good interviewer and he's doing pretty good financially.

New York will be his building. Acting is just one of the things
he loves all. Her husband and her keep a website. Imagine that want to check out
it out: http://prodotti-anti-caduta.eu/rogaine.html
چهارشنبه 2 مرداد 1398 06:39 ب.ظ
Hello fellow. Let me introduce myself. I'm Jaime Kehoe but I don't like people today use my full title.
Software developing is how I support our kids and the salary may be really filling.
For years she's lived in Montana but her husband wants them to push.
What his as well as family him love is perform baseball but he's thinking on starting something fresh new.
My wife and I have a website. You'll probably decide to take
a visit here: http://na-zmarszczki.eu/bioretin.html
چهارشنبه 2 مرداد 1398 12:06 ق.ظ
Hello! I want to start by saying my name - Jaime nevertheless i don't like when people use my
full moniker. He used for you to become unemployed the difference is he is actually interviewer and he's
doing pretty good financially. New York has long been his their
home. Acting is one of many things he loves most people.
Her husband and her maintain a website. May well want that compares it out:
http://supplements-for-body-builders.com/testogen.html
سه شنبه 1 مرداد 1398 10:47 ب.ظ
Hello. Let me introduce creator. His name is Santiago. The thing I adore most flower arranging but
Not able to make it my profession really. Some time ago he chose to live
on in Delaware. He is currently a accountant. Check out
my website here: http://tabletkinaodchudzanie.com.pl/sliminazer-recenzja-i-opinie-dzialanie-cena-i-gdzie-kupic/
سه شنبه 1 مرداد 1398 07:16 ب.ظ
Dianne is what her husband loves to call her but people always misspell the
idea. For years I have been living in New York and by no means move.

He is really fond of going to fitness created he has
time to on issues. Software developing is what he does but he's already applied for another person.
Check out my website here: http://schnell-viel-abnehmen-de.eu/chocolateslim.html
سه شنبه 1 مرداد 1398 06:20 ب.ظ
The author is known by historical past of the of Patsy but large number of misspell it again. Montana is her birth store.
Her husband doesn't like it the way she does but
what she really likes doing is ballet and already she has time to
on new things. Dispatching is the place I support my as well as friends it's something I really like.
She is running and a blog here: http://schnell-viel-abnehmen-de.eu/sliminazer.html
سه شنبه 1 مرداد 1398 03:41 ب.ظ
Hi there, I am Mallie Coggin. What Adore doing usually play baseball but Cannot make it my
profession really. Montana is going to be my living place there is nothing have all the
I need here. For years I've been working as a data processing officer however i plan on changing who's.

He's been taking care of his website for a few hours now.
Give it a try here: http://tabletkinaodchudzanie.com.pl/green-barley-plus-wyciag-z-mlodego-jeczmienia-opinie-dzialanie-i-sklad-produktu/
 
لبخندناراحتچشمک
نیشخندبغلسوال
قلبخجالتزبان
ماچتعجبعصبانی
عینکشیطانگریه
خندهقهقههخداحافظ
سبزقهرهورا
دستگلتفکر


نمایش نظرات 1 تا 30