Click here to Skip to main content
15,042,397 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all

i have a web form on which i have a button .On click that button i want to create a table in sql server 2005 with two columns in which on is primary key .so i have a fix number of columns in that table can any one tell me how ii is possible with stored procedure using c#.net
Posted
Updated 22-Aug-10 23:15pm
v2
Comments
R. Giskard Reventlov 23-Aug-10 5:16am
   
Why would you create a new table each time? That smacks of poor design.
Sandeep Mewara 23-Aug-10 6:12am
   
Why do you want to create table everytime?

1 solution

As digital man said, creating a new table every time someone presses a button in your web app, makes no sense at all. It would be trivial to do though, write the SQL to create the table and execute it. The trouble with using a stored proc is, your proc would need to string mash and execute SQL anyhow, if the name of your new table is different any time.

I suggest fixing your design, which sounds like it's a mess.
   

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




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900