Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 CRLF Query

Author  Topic 

SimonMcGurk
Starting Member

8 Posts

Posted - 2006-04-12 : 05:56:39
HI

This probably sounds like a dumb question, but here goes!
I have a field in a database where I store a list of parameters for a report. These are seperated by hard crlf. IN SQL Server 2000 I could recall the paramters and in the results pane I could use CTRL and Enter go go onto the next line and add a new parameter. I recently upgraded to SQL 2005. Now in the management studion, when I recall the parameters, they all display on one line, seperated by a rectangle symbol. I need to add a new parameter, but using CTRL and enter does not work. Is there any way to do this through the results pane, or do I need to add parameters using a script?

Any help gratefully received
Thanks
Simon

Srinika
Master Smack Fu Yak Hacker

1378 Posts

Posted - 2006-04-12 : 08:08:19
Just an idea
try the following:

'First Line' + char(13) + 'Second Line' + char(13) + 'Third Line' + .........

Srinika
Go to Top of Page

SimonMcGurk
Starting Member

8 Posts

Posted - 2006-04-13 : 04:41:08
Thanks for the advice - that seems to work in that it adds the parameter to the list correctly - however, I call this from an ASP page which uses the following:

parameters=split(ReportParams,vbCRLF)

where ReportParams is that brought back from the database. When I response.write the variable, it shows all the parameters, however, when I try to write them after the split, the new parameter is not showing up in the array - am I doing something else wrong here?

Thanks again - and any more help would be great
Simon
Go to Top of Page

SimonMcGurk
Starting Member

8 Posts

Posted - 2006-04-13 : 09:55:00
Ignore this now - I modified the code to

'First Line' + char(10) + char(13) + 'Second Line' .....

And this works correctly with the split on vbCRLF

Thanks for the nudge in the right direction!
Simon
Go to Top of Page
   

- Advertisement -