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

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links


Posted By:      Posted Date: August 30, 2010    Points: 0   Category :Sql Server
Hi, I am trying to write a query which takes name as an input parameter and then will create a table having columns as my name characters. for eg suppose i entered the name rishabh Now,the table will have columns named R,I,S,H,A,B,H My  query is create   proc test @input   varchar(15) as begin     if   Object_id('New_Table') is not null drop   table New_Table declare   @i int set   @i=1 create   table New_Table ( x int null ) while   (@i<=len(@input)) begin declare   @str char(1) set   @str =substring(@input,1,@i) alter   table New_Table add  @str char(1) null set   @i=@i+1 end     alter   table New_Table drop column x select   * from New_Table end       on executing i am getting the error as   Incorrect syntax near the keyword 'column'. Can anybody suggest me what i am doing wrong or is there any other way to achieve this Thanks, Rishabh

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