Re: Stored Procedure only works in when app uses trusted security



Dan you nailed it - SUSER_SNAME() in my trigger blows up because there
isn't a '\' and I didn't code for it.

Happy Holidays to you as well!


Dan Guzman wrote:
> Check the proc (or invoked trigger) to see SUSER_SNAME() is being parsed
> into separate domain/account components. The code may fail with a standard
> SQL Security connection because a '\' is assumed to be present.
>
> --
> Happy Holidays
>
> Dan Guzman
> SQL Server MVP
>
> "ZRexRider" <jerryg@xxxxxxx> wrote in message
> news:1135358521.631291.106350@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> > Hi,
> >
> > I have a .NET application that connects to a SQL 2000 database using
> > trusted security. It eventually calls a stored procedure that receives
> > 3 parameters - nothing special.
> >
> > If I simply change the connection string to use a valid Userid and
> > Password it still connects to the DB w/o problems but when it executes
> > the SP I get the following:
> >
> > System.Data.SqlClient.SqlException: Invalid length parameter passed to
> > the substring function.
> >
> > I change nothing but the login. Same store procedure, same parameters.
> >
> > Any ideas?
> >

.



Relevant Pages

  • Re: public role question
    ... I didn't understand what Dan was asking me to do. ... Then I am able to create a stored procedure. ... system tables with select permissions. ... You ARE the special DBO user, and not the new user, which is why you have ...
    (microsoft.public.sqlserver.security)
  • Re: public role question
    ... Dan, I'm sorry but after I responded to Kalen's email I deleted the test ... Somehow the user 'dantest' was the owner of the database so I guess ... I did create a second user with only the public role for permissions and was ... Then I am able to create a stored procedure. ...
    (microsoft.public.sqlserver.security)
  • Re: public role question
    ... The user dbo is a privileged user and can create tables and procs, ... permissions from the user dbo. ... "Dan Guzman" wrote: ... Why am I able to create a stored procedure with the new user. ...
    (microsoft.public.sqlserver.security)
  • Re: why is execution of a storedprocedure in QueryAnalyzer faster than executing this SP as schedule
    ... > It appears you have an INSERT trigger on the table that iterates over the inserted table. ... Good catch, Dan! ... Tibor Karaszi, SQL Server MVP ... >> The INSERT-Statement gets the data from a joined and grouped SELECT - here is the code ...
    (microsoft.public.sqlserver.server)
  • Re: public role question
    ... database?), I get 'dbo'. ... procedure if public doesn't have permissions and the new user is only in the ... Are you saying that the permissions to create the stored procedure are ... Dan D. ...
    (microsoft.public.sqlserver.security)