altering dynamically a set data type

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • J.Beaulieu

    altering dynamically a set data type

    Hi

    suppose that I have a set named 'my_set' wich contain
    'aaa','bbb','cc c'
    and I want to alter with an sql command the structure to get 'ddd' in
    addition. How can I do that?
  • David Portas

    #2
    Re: altering dynamically a set data type

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


    Comment

    • Simon Hayes

      #3
      Re: altering dynamically a set data type

      jfbeaulieu2003@ yahoo.com (J.Beaulieu) wrote in message news:<eb1b8a74. 0408101906.49a3 bf1b@posting.go ogle.com>...[color=blue]
      > Hi
      >
      > suppose that I have a set named 'my_set' wich contain
      > 'aaa','bbb','cc c'
      > and I want to alter with an sql command the structure to get 'ddd' in
      > addition. How can I do that?[/color]

      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

      Comment

      • J.Beaulieu

        #4
        Re: altering dynamically a set data type

        No, my_set is a field, a SET data type

        "David Portas" <REMOVE_BEFORE_ REPLYING_dporta s@acm.org> wrote in message news:<78GdnU9ya cB-aoTcRVn-iA@giganews.com >...[color=blue]
        > 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[/color]
        [color=blue][color=green]
        >> Hi
        >>
        >> suppose that I have a set named 'my_set' wich contain
        >> 'aaa','bbb','cc c'
        >> and I want to alter with an sql command the structure to get 'ddd' in
        >> addition. How can I do that?[/color][/color]

        Comment

        • Erland Sommarskog

          #5
          Re: altering dynamically a set data type

          J.Beaulieu (jfbeaulieu2003 @yahoo.com) writes:[color=blue]
          > No, my_set is a field, a SET data type[/color]

          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@sommarsk og.se

          Books Online for SQL Server SP3 at
          SQL Server 2025 redefines what's possible for enterprise data. With developer-first features and integration with analytics and AI models, SQL Server 2025 accelerates AI innovation using the data you already have.

          Comment

          • David Portas

            #6
            Re: altering dynamically a set data type

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


            Comment

            Working...