I just learned about the new sp_executesql stored procedure. I like the fact that there's a way to execute parameterized code from within SQL Server.
But, I'm wondering what the difference is between using the sp_executesql stored procedure when you don't have any parameters versus just calling EXEC directly. Also, is there a performance implication?
exec('select * from line_segment')
exec sp_executesql N'select * from line_segment'
Also, is there a difference between 2005 and 2008 or do they handle these the same?