Hi All,
I use this sql to add new column in my DB, but it put this column in last
position of table, have any way to specific this position?
ALTER TABLE clientes_dados_economicos ADD matricula INT NULL
CONSTRAINT matricula__clientes_dados_economicos__u UNIQUE;
renda_mensal money no 8 19 4 no (n/a) (n/a) NULL
ddd int no 4 10 0 yes (n/a) (n/a) NULL
telefone int no 4 10 0 yes (n/a) (n/a) NULL
ramal int no 4 10 0 yes (n/a) (n/a) NULL
matricula int no 4 10 0 yes (n/a) (n/a) NULL <-- put here
----
matricula int no 4 10 0 yes (n/a) (n/a) NULL <--I want here
renda_mensal money no 8 19 4 no (n/a) (n/a) NULL
ddd int no 4 10 0 yes (n/a) (n/a) NULL
telefone int no 4 10 0 yes (n/a) (n/a) NULL
ramal int no 4 10 0 yes (n/a) (n/a) NULL
Thanks> I use this sql to add new column in my DB, but it put this column in last
> position of table, have any way to specific this position?
You need to drop the table and re-create it. Why does column position
matter?|||Retf,
> I use this sql to add new column in my DB, but it put this column in last
> position of table, have any way to specific this position?
No, there is not a straight way to accomplish this. SQL Server will put the
new column to the end when using "alter table".
You can do this from "Enterprise Manager". See the script used, before
saving the changes.
AMB
"Retf" wrote:
> Hi All,
> I use this sql to add new column in my DB, but it put this column in last
> position of table, have any way to specific this position?
> ALTER TABLE clientes_dados_economicos ADD matricula INT NULL
> CONSTRAINT matricula__clientes_dados_economicos__u UNIQUE;
> renda_mensal money no 8 19 4 no (n/a) (n/a) NULL
> ddd int no 4 10 0 yes (n/a) (n/a) NULL
> telefone int no 4 10 0 yes (n/a) (n/a) NULL
> ramal int no 4 10 0 yes (n/a) (n/a) NULL
> matricula int no 4 10 0 yes (n/a) (n/a) NULL <-- put here
>
> ----
>
> matricula int no 4 10 0 yes (n/a) (n/a) NULL <--I want here
> renda_mensal money no 8 19 4 no (n/a) (n/a) NULL
> ddd int no 4 10 0 yes (n/a) (n/a) NULL
> telefone int no 4 10 0 yes (n/a) (n/a) NULL
> ramal int no 4 10 0 yes (n/a) (n/a) NULL
>
> Thanks
>
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment