如何通过代码创建主键 [英] how create primary key by code
本文介绍了如何通过代码创建主键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用此代码在数据库中创建表
i create table in database using this code
sqlcommand.commandtext="create table EM(no int,text
varchar);"
sqlcommand.executenonquery()
但是我不能创建主键.请帮我.即时通讯使用vb.net和.sql服务器.谢谢
but i cant create primary key as no. please help me. im using vb.net and.sql server. thanks
推荐答案
以下是您的链接
在sql server中用主键创建表
http://www.1keydata.com/sql/sql-primary-key.html [ ^ ]
http://msdn.microsoft.com/en-us/library/aa258255 (v = sql.80).aspx [ http://www.w3schools.com/sql/sql_primarykey.asp [
Here is the links for you
to create table with primary key in sql server
http://www.1keydata.com/sql/sql-primary-key.html[^]
http://msdn.microsoft.com/en-us/library/aa258255(v=sql.80).aspx[^]
http://www.w3schools.com/sql/sql_primarykey.asp[^]
Thnaks
--RA
这篇关于如何通过代码创建主键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文