Showing posts with label vs2005. Show all posts
Showing posts with label vs2005. Show all posts

Sunday, March 25, 2012

automatically expand identity specification node?

subject says it all -- is it possible to automatically expand the identity specification node in table properties for the Management Studio or VS2005 diagram mode? when creating a DB, it seems ridiculous that for EVERY table I have to add an extra click to get to just one more clickable item that ought to be exposed by default.Yeah, that's kind of a pain. If you have a lot of design to do at once, it's easier to use T-SQL than the GUI tools. I don't know of a method to auto-expand that.|||

thx for the reply ... even if it's a year later

sure, T-SQL would be easier for the identity aspect ... but when I'm modelling a DB, it's too organic of a process to do in script. One of SQL Server's strengths has always been the DB modeller. I don't need to create an ERD and work off of that because the SQL Server diagram IS my initial ERD. Implementing ideas visually at the conceptual stage of DB design is critical IMO. Making the identiy attribute more accessible, whether by default, by choice, or by rearranging that portion of the GUI, would be a big value add, again, IMO ...

|||Have you gone to the Microsoft site to make that suggestion? They have a place where they rank them.|||

Buck Woody - MSFT wrote:

Have you gone to the Microsoft site to make that suggestion? They have a place where they rank them.

Where at? Connections?

|||That's right - here is the link:

http://connect.microsoft.com/SQLServer

|||thanks for the link, hadn't used Connect in a while.

automatically expand identity specification node?

subject says it all -- is it possible to automatically expand the identity specification node in table properties for the Management Studio or VS2005 diagram mode? when creating a DB, it seems ridiculous that for EVERY table I have to add an extra click to get to just one more clickable item that ought to be exposed by default.Yeah, that's kind of a pain. If you have a lot of design to do at once, it's easier to use T-SQL than the GUI tools. I don't know of a method to auto-expand that.|||

thx for the reply ... even if it's a year later

sure, T-SQL would be easier for the identity aspect ... but when I'm modelling a DB, it's too organic of a process to do in script. One of SQL Server's strengths has always been the DB modeller. I don't need to create an ERD and work off of that because the SQL Server diagram IS my initial ERD. Implementing ideas visually at the conceptual stage of DB design is critical IMO. Making the identiy attribute more accessible, whether by default, by choice, or by rearranging that portion of the GUI, would be a big value add, again, IMO ...

|||Have you gone to the Microsoft site to make that suggestion? They have a place where they rank them.|||

Buck Woody - MSFT wrote:

Have you gone to the Microsoft site to make that suggestion? They have a place where they rank them.

Where at? Connections?

|||That's right - here is the link:

http://connect.microsoft.com/SQLServer

|||thanks for the link, hadn't used Connect in a while.sql

automatically expand identity specification node?

subject says it all -- is it possible to automatically expand the identity specification node in table properties for the Management Studio or VS2005 diagram mode? when creating a DB, it seems ridiculous that for EVERY table I have to add an extra click to get to just one more clickable item that ought to be exposed by default.Yeah, that's kind of a pain. If you have a lot of design to do at once, it's easier to use T-SQL than the GUI tools. I don't know of a method to auto-expand that.|||

thx for the reply ... even if it's a year later

sure, T-SQL would be easier for the identity aspect ... but when I'm modelling a DB, it's too organic of a process to do in script. One of SQL Server's strengths has always been the DB modeller. I don't need to create an ERD and work off of that because the SQL Server diagram IS my initial ERD. Implementing ideas visually at the conceptual stage of DB design is critical IMO. Making the identiy attribute more accessible, whether by default, by choice, or by rearranging that portion of the GUI, would be a big value add, again, IMO ...

|||Have you gone to the Microsoft site to make that suggestion? They have a place where they rank them.|||

Buck Woody - MSFT wrote:

Have you gone to the Microsoft site to make that suggestion? They have a place where they rank them.

Where at? Connections?

|||That's right - here is the link:

http://connect.microsoft.com/SQLServer

|||thanks for the link, hadn't used Connect in a while.

Sunday, February 12, 2012

Auto increment help

Is there an auto increment feature for integer key fields. I'm using VS2005 to configure my DB and I do not see a way to set this.

Thanks in Advance
MoonWa

CREATE TABLE tblArtists
(
artistID int identity primary key,
artistName nvarchar(50) NOT NULL
)

this SQL creates a table with two fields, the keyword 'identity' makes a field auto increment. In the UI there's a property 'identity specification', or something similar. If you open this, you can check 'is identity'.

|||

DataColumn type has a property AutoIncrement:

dtEmployees.Columns[0].AutoIncrement = true;
dtEmployees.Columns[0].AutoIncrementSeed = -1;
dtEmployees.Columns[0].AutoIncrementStep = -1;

SQL Server table may also have one identity column, as Christian mentioned. But you should be aware of some points:

1. SQL Server by default doesn't allows inserting in Identity columns (and never allows updates)
2. Your DataColumn instance knows nothing about current SQL Server Identity value and will possibly generate duplicate values (which will fail on insert if column is constrained via Primary Key or Unique, as usually).

So, if you let SQL Server to generate values, you also should update your column' values with generated one from stored proc output parameters or from output from FOR INSERT trigger on your table (or so) using DataAdapter. For example:

daEmployees.InsertCommand.UpdatedRowSource = UpdateRowSource.FirstReturnedRecord;

WBR, Evergray
--
Words mean nothing...

|||Thanks for your help.

MoonWa