Showing posts with label order. Show all posts
Showing posts with label order. Show all posts

Tuesday, March 27, 2012

Adding a new column of a UDT type fails on "invalid data type"

Hi all,

A strange thing happened to me a few days ago - I tried to modify a table, using the SQL server 2005 management studio, in order to add a new column to an existing table. I've entered the column's name and selected one of my UDTs for the column type. When I pressed "enter", I got the following message "invalid data type" !

Needless to say that shouldn't have happen, didn't happen it the previous version (CTP) and for some reason it works on other computers having the same version !

BTW, the database is sql server 2000.

Any ideas what this works on other computers but not on mine ?

Should I re-install the SQL server ? or the framework ?

Thanks,

Ido.

I'm still getting the error - currently on 2 out of 3 computers.

Any ideas ?

Ido.

sql

Sunday, February 19, 2012

add coll in specific order

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
>
>