sql server 2005中创建表的过程 [英] procedure for create a table in sql server 2005

查看:77
本文介绍了sql server 2005中创建表的过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

我有一个Web表单,上面有一个按钮.单击该按钮时,我想在sql server 2005中创建一个表,其中有两个列是主键.所以我在该表中有固定的列数,任​​何一个都可以告诉我使用c#.net

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

推荐答案

如何用存储过程实现ii,就像数字人所说的那样,每次有人按下您的Web应用程序中的一个按钮时,都会创建一个新表,完全没有道理.但是,编写SQL来创建表并执行该表将是微不足道的.使用存储的proc的麻烦在于,如果新表的名称随时不同,则您的proc将需要对字符串进行mash并执行SQL.

我建议修复您的设计,听起来像是一团糟.
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.


这篇关于sql server 2005中创建表的过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆