Date: 12/14/07 (SQL Server) Keywords: no keywords I'm trying to write something in a stored procedure (I say "something" because I don't care if it's a SELECT statement, a CREATE TABLE statement, whatever) that will allow me to dynamically declare column names. I've got variables set to 52 week ending dates (@m_week1, @m_week2, etc.), and I need to turn them into 104 column names by adding suffixes ([week1]_dollars, [week1]_units, [week2]_dollars, etc.). Doesn't seem to matter how I do this, however, I get a syntax error. Source: http://community.livejournal.com/sqlserver/65345.html
|