Professional Web Applications Themes

Parameterized Views - Microsoft SQL / MS SQL Server

Do we have them in Sql Sever ?...

Sponsored Links
  1. #1

    Default Parameterized Views

    Do we have them in Sql Sever ?


    Sponsored Links
    Nice Chap Guest

  2. #2

    Default Re: Parameterized Views

    Thank you. But the question then would be - is it an Ansi standard ?

    "Vishal Parkar" <vgparkarhotmail.com> wrote in message
    news:#TZDv4hQDHA.3192tk2msftngp13.phx.gbl...
    > SQL Server do not have parameterized views, however you can make use of
    > table-valued functions in sql 2000
    > ex:
    > create function param_func( cust_id varchar(300))
    > returns table
    > as return
    > select * from customers where customerid = cust_id
    > go
    >
    > select * from param_func('alfki')
    >
    > --
    > -Vishal
    > "Nice Chap" <ChapThunderbolt.com> wrote in message
    > news:u2gPDzhQDHA.3020TK2MSFTNGP10.phx.gbl...
    > > Do we have them in Sql Sever ?
    > >
    > >
    >
    >

    Nice Chap Guest

  3. #3

    Default Re: Parameterized Views

    no ,as far as i know SQL server functions are not ansi standard.
    --
    -Vishal
    "Nice Chap" <ChapThunderbolt.com> wrote in message
    news:Oic8gKiQDHA.3144tk2msftngp13.phx.gbl...
    > Thank you. But the question then would be - is it an Ansi standard ?
    >
    > "Vishal Parkar" <vgparkarhotmail.com> wrote in message
    > news:#TZDv4hQDHA.3192tk2msftngp13.phx.gbl...
    > > SQL Server do not have parameterized views, however you can make use of
    > > table-valued functions in sql 2000
    > > ex:
    > > create function param_func( cust_id varchar(300))
    > > returns table
    > > as return
    > > select * from customers where customerid = cust_id
    > > go
    > >
    > > select * from param_func('alfki')
    > >
    > > --
    > > -Vishal
    > > "Nice Chap" <ChapThunderbolt.com> wrote in message
    > > news:u2gPDzhQDHA.3020TK2MSFTNGP10.phx.gbl...
    > > > Do we have them in Sql Sever ?
    > > >
    > > >
    > >
    > >
    >
    >

    Vishal Parkar Guest

  4. #4

    Default Re: Parameterized Views

    We have a group of tables that form some rules. We need join the these
    tables to every single sql that needs to use the rules. What this does is
    spoil the readability of the main query. Is there an Ansi alternative to
    something like user defined function?

    "Vishal Parkar" <vgparkarhotmail.com> wrote in message
    news:urBLruiQDHA.2480tk2msftngp13.phx.gbl...
    > no ,as far as i know SQL server functions are not ansi standard.
    > --
    > -Vishal
    > "Nice Chap" <ChapThunderbolt.com> wrote in message
    > news:Oic8gKiQDHA.3144tk2msftngp13.phx.gbl...
    > > Thank you. But the question then would be - is it an Ansi standard ?
    > >
    > > "Vishal Parkar" <vgparkarhotmail.com> wrote in message
    > > news:#TZDv4hQDHA.3192tk2msftngp13.phx.gbl...
    > > > SQL Server do not have parameterized views, however you can make use
    of
    > > > table-valued functions in sql 2000
    > > > ex:
    > > > create function param_func( cust_id varchar(300))
    > > > returns table
    > > > as return
    > > > select * from customers where customerid = cust_id
    > > > go
    > > >
    > > > select * from param_func('alfki')
    > > >
    > > > --
    > > > -Vishal
    > > > "Nice Chap" <ChapThunderbolt.com> wrote in message
    > > > news:u2gPDzhQDHA.3020TK2MSFTNGP10.phx.gbl...
    > > > > Do we have them in Sql Sever ?
    > > > >
    > > > >
    > > >
    > > >
    > >
    > >
    >
    >

    Nice Chap Guest

  5. #5

    Default Re: Parameterized Views

    probably you can use views and pass parameter to it to filter on the basis
    of required condition. Im changing my own example using view as follows.
    Ex:
    create view v1 as
    select * from customers

    --filtering resultset of the above view as

    select * from v1 where customerid = 'ALFKI'

    --
    -Vishal
    "Nice Chap" <ChapThunderbolt.com> wrote in message
    news:O1hplyiQDHA.560TK2MSFTNGP10.phx.gbl...
    > We have a group of tables that form some rules. We need join the these
    > tables to every single sql that needs to use the rules. What this does is
    > spoil the readability of the main query. Is there an Ansi alternative to
    > something like user defined function?
    >
    > "Vishal Parkar" <vgparkarhotmail.com> wrote in message
    > news:urBLruiQDHA.2480tk2msftngp13.phx.gbl...
    > > no ,as far as i know SQL server functions are not ansi standard.
    > > --
    > > -Vishal
    > > "Nice Chap" <ChapThunderbolt.com> wrote in message
    > > news:Oic8gKiQDHA.3144tk2msftngp13.phx.gbl...
    > > > Thank you. But the question then would be - is it an Ansi standard ?
    > > >
    > > > "Vishal Parkar" <vgparkarhotmail.com> wrote in message
    > > > news:#TZDv4hQDHA.3192tk2msftngp13.phx.gbl...
    > > > > SQL Server do not have parameterized views, however you can make use
    > of
    > > > > table-valued functions in sql 2000
    > > > > ex:
    > > > > create function param_func( cust_id varchar(300))
    > > > > returns table
    > > > > as return
    > > > > select * from customers where customerid = cust_id
    > > > > go
    > > > >
    > > > > select * from param_func('alfki')
    > > > >
    > > > > --
    > > > > -Vishal
    > > > > "Nice Chap" <ChapThunderbolt.com> wrote in message
    > > > > news:u2gPDzhQDHA.3020TK2MSFTNGP10.phx.gbl...
    > > > > > Do we have them in Sql Sever ?
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >
    > >
    > >
    >
    >

    Vishal Parkar Guest

Similar Threads

  1. Replies: 0
    Last Post: January 25th, 11:20 PM
  2. Adding parameterized values. Which is more secure.
    By Ryan Taylor in forum ASP.NET Security
    Replies: 1
    Last Post: September 10th, 06:17 PM
  3. 2 views
    By duff@adobeforums.com in forum Adobe Illustrator Macintosh
    Replies: 4
    Last Post: May 28th, 06:03 PM
  4. create views from parameterized stored procedures
    By gregg durishan in forum Microsoft SQL / MS SQL Server
    Replies: 4
    Last Post: July 8th, 05:26 PM
  5. Replies: 4
    Last Post: July 8th, 07:00 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139