Click here to Skip to main content
15,886,584 members
Articles / Database Development / SQL Server

Updating a temp table in a Stored Proc

Rate me:
Please Sign up or sign in to vote.
1.00/5 (1 vote)
1 Nov 2011CPOL 19.8K   1  
How to update the schema of a temp table in a Stored Procedure in SQL Server

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

Please Sign up or sign in to vote.
1 Nov 2011Jeff Balcerzak
You might also want to try using a table variable - like this:DECLARE @tableName TABLE ( Key1 INT, Key2 INT, Description NVARCHAR(255), AggAmount FLOAT,)Then you can refer to your table by @tableName. Granted this is SQL Server 2005 and above, but then...

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect UBS AG
Switzerland Switzerland
Mel Padden:

Musician, papier maché guru, international authority on the modern crisp, and sometime software developer based in Zurich, Switzerland and Dublin, Ireland.

http://www.linkedin.com/in/melpadden

Comments and Discussions