小编use*_*723的帖子

Tables not displaying after creating database by script. Do I need to insert?

I successfully created (scripted) a database in SQL Server 2012.

My problem is that while the database itself is listed in the object explorer, the tables from the database are not. The database I scripted did not contain actual data, i.e., there were no 'Insert' statements. Is this last the reason why the tables are not listed?

I tried to see if the tables were stored somehow without appearing by running an insert into statement for one of the tables …

sql-server sql-server-2012

2
推荐指数
1
解决办法
1万
查看次数

在 DROP/Add 列语句中更改 Key (PK, FK) 属性

我想通过添加一列来更改表格。到目前为止,这里没什么可看的,但我想让这个列成为复合键的一部分,即,我现在有一个布局

table_name( Field_1  datatype PK, Field_2 datatype,....) 
Run Code Online (Sandbox Code Playgroud)

并且我希望插入的列,比如 Field_k 与现有的单字段 PK 一起成为 PK 的一部分。

我还没有找到有关如何执行此操作或是否可行的任何来源。请问有什么建议吗?

foreign-key database-design sql-server alter-table ddl

1
推荐指数
1
解决办法
45
查看次数