Re: Record Level Security

From: John Bell (jrm_bell@hotmail.com)
Date: 12/31/02


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



Relevant Pages

  • Re: Record Level Security
    ... >CURRENT_USER returns a SYSNAME ... >USER_NAME requires a ID (INT) ... >> INT2 column. ... Use a larger integer column. ...
    (microsoft.public.sqlserver.security)
  • Re: disable publishing and distribution error
    ... Director of Text Mining and Database Strategy ... RelevantNOISE.Com - Dedicated to mining blogs for business intelligence. ... publisher_db sysname, ... allow_push int, ...
    (microsoft.public.sqlserver.replication)
  • Re: disable publishing and distribution error
    ... My database is no longer being published for replication because I used ... Looking for a SQL Server replication book? ... publisher_db sysname, ... allow_push int, ...
    (microsoft.public.sqlserver.replication)
  • Re: disable publishing and distribution error
    ... Director of Text Mining and Database Strategy ... RelevantNOISE.Com - Dedicated to mining blogs for business intelligence. ... publisher_db sysname, ... allow_push int, ...
    (microsoft.public.sqlserver.replication)
  • Re: disable publishing and distribution error
    ... publisher_db sysname, ... designmasterid uniqueidentifier, ... allow_push int, ... Director of Text Mining and Database Strategy ...
    (microsoft.public.sqlserver.replication)