GROUP_CONCAT OF MySQL | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

GROUP_CONCAT OF MySQL

Hello, I am Migrating one database of Mysql to SQL server 2005, I am facing problem with Views where in Mysql they have GROUP_Concat (aggregate Function) which is not available with SQL i found some solution on Google. 1. Use of Cursors (T-SQL)
2. Creating an functions. but again now i am facing issues like. 1. can i create CURSORS inside Views if yes please give me more information on it.
2. the function will return only 255 max value and what if i want to return bigger value. Thanks for your help. Sachin

ad 1: No, you can’t. You would have to use a stored procedure instead.
ad 2: What data type are you using? Try with a VARCHAR(MAX). Should be wide enough for almost anything. —
Frank Kalis
Moderator
Microsoft SQL Server MVP
Webmaster:http://www.insidesql.de
quote:Originally posted by sachinonnet 1. can i create CURSORS inside Views if yes please give me more information on it.
2. the function will return only 255 max value and what if i want to return bigger value.
1. No
2. There is no such limitation. UDF is the way to go. Roji. P. Thomas
SQL Server MVP
http://toponewithties.blogspot.com

Hey, Frank and Roji thanks for your comment, I think my problem would get resolve by this. I am returning VARCHAR Data type. Sachin

]]>