• Ok I read Jeff's article on http://www.sqlservercentral.com/articles/Tally+Table/72993/ and at first put the code in a seperate window and it didn't work, since i suppose the the #test table contained only one # tag. when i put it in same window as code you wrote, dwain it worked. i know there is a difference between sessions on # and ##, so thank you now let me try to understand it.

    Thank You both.