Tuesday, March 27, 2012

altering dynamically a set data type

Hi

suppose that I have a set named 'my_set' wich contain
'aaa','bbb','ccc'
and I want to alter with an sql command the structure to get 'ddd' in
addition. How can I do that?Does "My_Set" refer to a table? If so, you add a new column to the table
using the ALTER TABLE statement. For example:

ALTER TABLE my_set ADD ddd INTEGER NULL

--
David Portas
SQL Server MVP
--|||jfbeaulieu2003@.yahoo.com (J.Beaulieu) wrote in message news:<eb1b8a74.0408101906.49a3bf1b@.posting.google.com>...
> Hi
> suppose that I have a set named 'my_set' wich contain
> 'aaa','bbb','ccc'
> and I want to alter with an sql command the structure to get 'ddd' in
> addition. How can I do that?

MSSQL doesn't have a 'set data type' - are you using MySQL, perhaps?
If so, you will get a better answer in a MySQL forum.

Simon|||No, my_set is a field, a SET data type

"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message news:<78GdnU9yacB-aoTcRVn-iA@.giganews.com>...
> Does "My_Set" refer to a table? If so, you add a new column to the table
> using the ALTER TABLE statement. For example:
> ALTER TABLE my_set ADD ddd INTEGER NULL

>> Hi
>>
>> suppose that I have a set named 'my_set' wich contain
>> 'aaa','bbb','ccc'
>> and I want to alter with an sql command the structure to get 'ddd' in
>> addition. How can I do that?|||J.Beaulieu (jfbeaulieu2003@.yahoo.com) writes:
> No, my_set is a field, a SET data type

There is no SET datatype in SQL Server (unless you it's a user-defined
type you added yourself.) Are you in the wrong newsgroup?

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||There is no base datatype called "SET" in SQL Server.

You may have a user-defined datatype of that name. There is no way to alter
the definition of an existing datatype - you have to drop it and then
recreate it - but I'm not even sure if your question relates to altering the
datatype or the data within it.

Simon suggested that maybe this is a MySQL question. If that's the case then
please try a MySQL forum. This is a SQL Server group.

--
David Portas
SQL Server MVP
--

No comments:

Post a Comment