Jun 18
The Curse and Blessings of Dynamic SQL
Introduction If you follow the various newsgroups on Microsoft SQL Server, you often see people asking why they can’t do: SELECT * FROM @tablename SELECT @colname FROM tbl SELECT * FROM tbl WHERE x IN (@list) For all three examples you can expect someone to answer Use dynamic SQL and give a quick example on […]
Jun 18
Dynamic PIVOT queries in SQL Server
Problem Pivoting (or producing a “cross-tab”) is a common reporting requirement – data is stored in columns and you need to present it in rows. This was a nice feature that was added to SQL Server, but you don’t always know all of the values you need to pivot on.? In this tip we look […]
최근 댓글