Re: Record Level Security
From: John Bell (jrm_bell@hotmail.com)
Date: 12/31/02
- Next message: mike singer: "Re: Renamed Windows login not found in SQL Server 2000"
- Previous message: Pat Diminico: "RE: Record Level Security"
- In reply to: Pat Diminico: "RE: Record Level Security"
- Next in thread: Pat Diminico: "Re: Record Level Security"
- Reply: Pat Diminico: "Re: Record Level Security"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: "John Bell" <jrm_bell@hotmail.com> Date: Tue, 31 Dec 2002 18:16:39 -0000
Hi
CURRENT_USER returns a SYSNAME
USER_NAME requires a ID (INT)
I don't know the contents of your USER_ID column, but you may just want to
use CURRENT_USER straight off
or if this is an internal ID then link it through the table that defines the
mapping between CURRENT_USER and the USER_ID
John
"Pat Diminico" <pat@diminico.com> wrote in message
news:016201c2b0f6$7bbfdc90$d3f82ecf@TK2MSFTNGXA10...
> I created the following User Defined Function:
>
>
> CREATE FUNCTION fn_CurrentUserRows()
> RETURNS table
> AS
> RETURN (
> SELECT *
> FROM TABLE1
> WHERE USER_ID = USER_NAME(CURRENT_USER)
> )
>
> When I run the following select statement logged in as
> user 99999, I receive the error below:
>
> select * from fn_CurrentUserRows()
>
> Server: Msg 244, Level 16, State 2, Line 1
> The conversion of the nvarchar value '99999' overflowed an
> INT2 column. Use a larger integer column.
>
>
> What have I forgotten to do?
>
> Thank you
- Next message: mike singer: "Re: Renamed Windows login not found in SQL Server 2000"
- Previous message: Pat Diminico: "RE: Record Level Security"
- In reply to: Pat Diminico: "RE: Record Level Security"
- Next in thread: Pat Diminico: "Re: Record Level Security"
- Reply: Pat Diminico: "Re: Record Level Security"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|