Hi All,
I have created a stored proc that is set to accept @.username =
varchar(40)...it fails when the username is FULLY qualified with Domain name
...ex: 'MyDomain\Username'...how do I get my procedure to except this FULL
name?
Thanks...M.Please post some sample code on how you execute that.
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
--
"Michelle" <smiley2211@.yahoo.com> schrieb im Newsbeitrag
news:eVrMaXrZFHA.3220@.TK2MSFTNGP14.phx.gbl...
> Hi All,
> I have created a stored proc that is set to accept @.username =
> varchar(40)...it fails when the username is FULLY qualified with Domain
> name ...ex: 'MyDomain\Username'...how do I get my procedure to except this
> FULL name?
> Thanks...M.
>|||The datatype for usernames in SQL (as used in the system tables) is sysname,
which is equivalent to nvarchar(128). Use that instead of varchar(40).
Jacco Schalkwijk
SQL Server MVP
"Michelle" <smiley2211@.yahoo.com> wrote in message
news:eVrMaXrZFHA.3220@.TK2MSFTNGP14.phx.gbl...
> Hi All,
> I have created a stored proc that is set to accept @.username =
> varchar(40)...it fails when the username is FULLY qualified with Domain
> name ...ex: 'MyDomain\Username'...how do I get my procedure to except this
> FULL name?
> Thanks...M.
>|||Yes, I tried sysname as well...still errors: "Associated statement is not
prepared"
************snippet********
CREATE PROCEDURE sp_getprivs (@.username sysname = null) AS
set nocount on
declare @.dbn varchar(30)
declare test cursor for
select name from master..sysdatabases
etc....
*****************
"Jacco Schalkwijk" <jacco.please.reply@.to.newsgroups.mvps.org.invalid> wrote
in message news:%23$f5sirZFHA.3780@.tk2msftngp13.phx.gbl...
> The datatype for usernames in SQL (as used in the system tables) is
> sysname, which is equivalent to nvarchar(128). Use that instead of
> varchar(40).
> --
> Jacco Schalkwijk
> SQL Server MVP
>
> "Michelle" <smiley2211@.yahoo.com> wrote in message
> news:eVrMaXrZFHA.3220@.TK2MSFTNGP14.phx.gbl...
>|||Sorry...I execute this as such...
sp_getprivs 'MyDomain\Username'
Thanks...M
"Michelle" <smiley2211@.yahoo.com> wrote in message
news:ukE3YorZFHA.2496@.TK2MSFTNGP14.phx.gbl...
> Yes, I tried sysname as well...still errors: "Associated statement is not
> prepared"
> ************snippet********
> CREATE PROCEDURE sp_getprivs (@.username sysname = null) AS
> set nocount on
> declare @.dbn varchar(30)
> declare test cursor for
> select name from master..sysdatabases
> etc....
> *****************
>
> "Jacco Schalkwijk" <jacco.please.reply@.to.newsgroups.mvps.org.invalid>
> wrote in message news:%23$f5sirZFHA.3780@.tk2msftngp13.phx.gbl...
>|||Try using delimiters:
sp_getprivs '[MyDomain\Username]'
Jacco Schalkwijk
SQL Server MVP
"Michelle" <smiley2211@.yahoo.com> wrote in message
news:OhhR1qrZFHA.2412@.TK2MSFTNGP10.phx.gbl...
> Sorry...I execute this as such...
> sp_getprivs 'MyDomain\Username'
> Thanks...M
> "Michelle" <smiley2211@.yahoo.com> wrote in message
> news:ukE3YorZFHA.2496@.TK2MSFTNGP14.phx.gbl...
>|||Thanks, that worked...
...M
"Jacco Schalkwijk" <jacco.please.reply@.to.newsgroups.mvps.org.invalid> wrote
in message news:ui3WLisZFHA.2884@.tk2msftngp13.phx.gbl...
> Try using delimiters:
> sp_getprivs '[MyDomain\Username]'
>
> --
> Jacco Schalkwijk
> SQL Server MVP
>
> "Michelle" <smiley2211@.yahoo.com> wrote in message
> news:OhhR1qrZFHA.2412@.TK2MSFTNGP10.phx.gbl...
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment