akohan
asked on
defining a variable in stored procedure in SQL Server and MySQL
Hello,
I'm looking at http://mikehillyer.com/articles/managing-hierarchical-data-in-mysql/
and since I'm using SQL Server so need to know what is the equivalent of
in SQL Server.
Thanks,
ak
I'm looking at http://mikehillyer.com/articles/managing-hierarchical-data-in-mysql/
and since I'm using SQL Server so need to know what is the equivalent of
SELECT @myRight := rgt FROM nested_category
--WHERE name = 'TELEVISIONS';
in SQL Server.
Thanks,
ak
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You just have the SQL print command but you can concatenate strings with a +
eg
Print 'This is the result: ' + @myRight
eg
Print 'This is the result: ' + @myRight
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks.
Hi Akohan
I kind of thought my solution was the one that helped with your original question, but no points? :-(
I kind of thought my solution was the one that helped with your original question, but no points? :-(
ASKER
I see! how can I fix it?
Thanks for letting me know.
Thanks for letting me know.
ASKER
do we have any things like format specifier as we have in C?
sprintf("some string %i , %s", intVar1, StringVar2);
Any idea?
Thanks.