Error converting data type varchar

OK. I finally created a view that works: Thanks to AdaTheDev and CodeByMoonlight. I used your two answers to get to this. (Thanks to the other repliers too of course) Now when I do joins with other bigint cols or do something like ‘SELECT * FROM MyView where mycol=1’ it returns the correct result with … Read more

How to write a foreach in SQL Server?

You seem to want to use a CURSOR. Though most of the times it’s best to use a set based solution, there are some times where a CURSOR is the best solution. Without knowing more about your real problem, we can’t help you more than that: