如何使用VB代码选择主键 [英] how select primary key using vb code
本文介绍了如何使用VB代码选择主键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有两个领域,其名称和年龄需要选择名称作为主键.请帮助我.在使用vb.net和sql server. tax
解决方案
设置表的主键
看吧
http://databases.about.com/od/sqlserver/ss/sqlservertables_6.htm [ ^ ]
或
这样写查询
更改表EM添加主键(名称);
从表中获取主键
看吧
http://blog .sqlauthority.com/2007/09/04/sql-server-2005-find-tables-with-primary-key-constraint-in-database/ [ there have two feilds, its Name and Age l need select name as primary key.please help me. in using vb.net and sql server. tax解决方案To set primary key for a table
Look it
http://databases.about.com/od/sqlserver/ss/sqlservertables_6.htm[^]
or
write query like this
ALTER TABLE EM ADD PRIMARY KEY (Name);
Getting primary keys from table
Look it
http://blog.sqlauthority.com/2007/09/04/sql-server-2005-find-tables-with-primary-key-constraint-in-database/[^]
Thanks,
SP
这篇关于如何使用VB代码选择主键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文