I need to execute query and convert result to text. I know how to do it within Management Studio. But I need to do it within stored procedure and saved output result to text column
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The query itself has no idea what a grid or text pane is – these are presentation niceties coded into Management Studio. If you want to combine the values in a row and concatenate them into a single string, then insert those rows into your text column (I hope you mean
VARCHAR(MAX)orNVARCHAR(MAX), sinceTEXTis deprecated and shouldn’t be used), you can say something like this, keeping in mind that you’ll need to manually convert any non-string types (int,date, etc.) tovarcharornvarchar.If you need to combine rows as well and insert one big value that represents a text dump of the whole table, then you can do it slightly differently: