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


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
  begin
     select @columnname from @tablename
  end

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

Categories: 
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