0

有点新的数据库脚本,

  1. 我想要一个脚本,它可以显示 10 列中的 10 列。
  2. 用于从 10 列更改 10 列的值的脚本。

我知道我可以使用 Select 语句,但这是最佳做法吗?

编辑

我累了

Select

table1.column1,
table1.column2,
table2.column1
    ......
    table100.column100 FROM    table1,table2,.....table100;

但收到此错误

消息 208,级别 16,状态 1,第 1 行无效的对象名称“table1”。

回答

少数表被误删

4

1 回答 1

1
1.Selecting 10's of columns from 10's of columns -- select * from tablename is good way.
But this is not good when you consider the query for performance point of view.If your reuirement is to get all the columns of a table then you can use select * from tablename.

2.This is quite obvious that you have to use all 10 columns if u have to change their values.
UPDATE tablename SETcol1=value1,
       col1=value1,
       col1=value1,
       .....
于 2012-08-06T14:24:12.730 回答