Showing posts with label identity. Show all posts
Showing posts with label identity. Show all posts

Monday, March 19, 2012

is it possible to alter a table to remove IDENTITY attribute

We have a column with an IDENTITY attribute and we no longer want this
column to have the IDENTITY attribute.
I know that set IDENTITY_INSERT will more or less ignore the IDENTITY for
that unit of work however I need the IDENTITY attribute totally removed so
that we don't have to set IDENTITY_INSERT each time.
Thanks in advanceYou can add a new column, copy the contents of the identity column to it,
drop the identity column, and rename the new column.
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Toronto, ON Canada
"TJT" <TJT@.nospam.com> wrote in message
news:egxy3DYXGHA.1200@.TK2MSFTNGP03.phx.gbl...
We have a column with an IDENTITY attribute and we no longer want this
column to have the IDENTITY attribute.
I know that set IDENTITY_INSERT will more or less ignore the IDENTITY for
that unit of work however I need the IDENTITY attribute totally removed so
that we don't have to set IDENTITY_INSERT each time.
Thanks in advance

is it possible to alter a table to remove IDENTITY attribute

We have a column with an IDENTITY attribute and we no longer want this
column to have the IDENTITY attribute.
I know that set IDENTITY_INSERT will more or less ignore the IDENTITY for
that unit of work however I need the IDENTITY attribute totally removed so
that we don't have to set IDENTITY_INSERT each time.
Thanks in advanceYou can add a new column, copy the contents of the identity column to it,
drop the identity column, and rename the new column.
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Toronto, ON Canada
"TJT" <TJT@.nospam.com> wrote in message
news:egxy3DYXGHA.1200@.TK2MSFTNGP03.phx.gbl...
We have a column with an IDENTITY attribute and we no longer want this
column to have the IDENTITY attribute.
I know that set IDENTITY_INSERT will more or less ignore the IDENTITY for
that unit of work however I need the IDENTITY attribute totally removed so
that we don't have to set IDENTITY_INSERT each time.
Thanks in advance

Wednesday, March 7, 2012

Is it a bug in SQL CE?

Hi!

I use SQL CE with VS.NET. I find the following bug 2th.

The table has an "ID int IDENTITY(0,1) PRIMARY KEY,". That is my row identity.

I add rows to the table, then I realized that the ID order not in the general order (from 0 to ........)

For example: 6,7,8,0,1,2,3,4,5.

Of course row 6,7 and 8 was added the very last.

The content of each row is not mixed, only the ID order.

Is it a very confused, because we develop mobile invoice programs for PDAs.

What I did wrong?

Thank you!

Does that happen in the Query Analyzer on the PDA?

Maybe it does not order the rows by the primary key column by default (?). I don't know if that would be a bug, although it sounds more convenient if it did order on any key columns.

|||I moved this thread to the SQL Mobile's team forusm|||

Neither SQL Server nor SQL Mobile guarrenty you about the physical order of the rows and you are not expected to concluded something from running multiple queries. It can always change. If you want the rows to be ordered on a column, you should ideally use ORDER BY. Your query result (with out ordering) always depends on the cursor position.

Thanks,

Laxmi Narsimha Rao ORUGANTI, MSFT, SQL Mobile, Microsoft Corporation