Professional Web Applications Themes

Select of non DBO Table in UDF...can't do it. - Microsoft SQL / MS SQL Server

I have some tables with the same name but owned by different users. I have some UDFs that return a table variable. The SELECT statements in the UDF cannot 'see' the non dbo tables. The Same SELECT does work outside of the UDF. In the SELECT statement there is no owner prefix. If I prefix it to the specific user it works , but that won't do because I want the table the user owns to be returned, I cannot specify the owner. Is this a Bug? al...

  1. #1

    Default Select of non DBO Table in UDF...can't do it.

    I have some tables with the same name but owned by different users. I have
    some UDFs that return a table variable. The SELECT statements in the UDF
    cannot 'see' the non dbo tables. The Same SELECT does work outside of the
    UDF. In the SELECT statement there is no owner prefix. If I prefix it to the
    specific user it works , but that won't do because I want the table the user
    owns to be returned, I cannot specify the owner.

    Is this a Bug?

    al


    al Guest

  2. #2

    Default Re: Select of non DBO Table in UDF...can't do it.

    It seems to me that you have broken chain of ownership.

    --
    Dean Savovic
    www.teched.hr


    "al" <com> wrote in message news:%phx.gbl... 


    Dean Guest

  3. #3

    Default Re: Select of non DBO Table in UDF...can't do it.

    I know know what the expected behavior is, but I think that it would be
    better if when user 'al' calls

    EXEC dbo.spTest()

    and it does

    SELECT * FROM TestTable

    al would get al.TestTable not dbo.TestTable
    -------
    My wish list is this, a simple mechanism for passing arrays and Something
    like Table Pointers...
    -al

    "Dean Savovic" <hr> wrote in message
    news:bf5hcc$2mp$net4u.hr... 
    news:%phx.gbl... [/ref]
    have [/ref]
    the [/ref]
    the [/ref]
    user 
    >
    >[/ref]


    al Guest

Similar Threads

  1. select next id in table?
    By Jim Michaels in forum MySQL
    Replies: 1
    Last Post: April 23rd, 04:29 AM
  2. insert into...select using the same table
    By Don Vaillancourt in forum MySQL
    Replies: 2
    Last Post: March 22nd, 10:30 PM
  3. How to select record on one table but not the other
    By Rustywater in forum Coldfusion Database Access
    Replies: 1
    Last Post: September 11th, 11:15 AM
  4. randomly select a table, better way?
    By Daniel Bray in forum PHP Development
    Replies: 3
    Last Post: September 2nd, 06:25 AM
  5. Select all the user table
    By hngo01 in forum Microsoft SQL / MS SQL Server
    Replies: 4
    Last Post: July 9th, 05:13 PM

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