williamZanelli Posted September 20, 2011 Share Posted September 20, 2011 Hi guys, I have a scalability question - I have a for loop - after which I end with a String, 150 chars long - I write this to a log file. I;m thinking, if I rather than write to log file after each iteration, would it be better to append the Sting after each iteration, and write at the end of the loop? How long could my String be, I can potentially 1000 iterations * 150 chars - is it advisable to have such a long String in memory? Thanks for your advice Quote Link to comment Share on other sites More sharing options...
RobertP Posted September 20, 2011 Share Posted September 20, 2011 append a variable, then append your log file at the end of the loop. once the script stops execution, the variables stored in the memory are dumped. Quote Link to comment Share on other sites More sharing options...
oyster12 Posted September 21, 2011 Share Posted September 21, 2011 if you write a little string to a file in a for loop, you will handle a file for 1000 or more times, I think it will take more memory than just append it to the end of iteration. Quote Link to comment Share on other sites More sharing options...
epixeltechnologies Posted September 27, 2011 Share Posted September 27, 2011 Can we take nvarchar for big string? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.