Home All Groups Group Topic Archive Search About
Author
17 Feb 2006 9:41 AM
juokaz
I have only this piece of code and its said that there is mistake, it's excercise, so i dont have full code.

SQL wrote:
Show quote
> *declare @UserID uniqueidentifier
> SET @UserID = @@ROWCOUNT
> SELECT @UserID
>
> this will throw an error yes, assuming your @UserID is an int this
> should work
> What I do not understand is how userid and rowcount have anything in
> common?
> maybe you are looking for one of these 4?
> select user_id(),suser_sid(),suser_sname(),user_name()
>
> [url]http://sqlservercode.blogspot.com/[/url] * -- juokaz ------------------------------------------------------------------------ Posted via http://www.codecomments.com ------------------------------------------------------------------------

Author
17 Feb 2006 11:00 AM
Jens
Unless you provide more SQL code we can only say that this is valid SQL
so far.


HTH, Jens Suessmeyer.
Author
17 Feb 2006 11:46 AM
ML
Just as one of the posters mentioned before - the only flaw is the assignment
of an integer value to the variable of an incompatible data type
(uniqueidentifier).

Is that it? Then, change the declaration of UserID and use a compatible data
type (any numeric type or a character type).


ML

---
http://milambda.blogspot.com/

AddThis Social Bookmark Button