.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

Help me about dyanmic SQL

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :

create procedure [dbo].[select_column](@tablename varchar(20),@columnname varchar(20))as
     select @columnname from @tablename

Msg 1087, Level 15, State 2, Procedure select_column, Line 3
Must declare the table variable "@tablename".

I have read some documents on internet and understand what is problem behind it.but not getting sample code to solve this error.Tell me how can I use table name dynamically.

thanks in advance.

View Complete Post

More Related Resource Links

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend