Showing posts with label keys. Show all posts
Showing posts with label keys. Show all posts

Monday, March 26, 2012

entity relationship diagram

I have VS 2005 and SQL Server 2005 Express installed and I created 4 tables and setup the primary and foreign keys and can view the individual foreign key relationships by right clicking on the foreign key.

Is there a way to view a table relationship diagram (fields with primary and foreign keys), such as Access provides. Does VS 2005 or SQL Server 2005 have that capability?

Thanks

If you right-click on the folder named Database Diagrams, you can create a databse diagram. You can create a diagram here. To view the folder, click the plus sign next to the database that you want to create the diagram for.

Wednesday, February 15, 2012

enterprise key?

has anyone heard of this? A unique key separate from primary keys? Something
that stands apart from say, clientID, employeeID, companyID,...? thx, -hazzThere is the ability to create a unique index and a unique constraint. I've
never heard of "enterprise keys" with specific relation to SQL Server.
http://www.aspfaq.com/
(Reverse address to reply.)
"Hazz" <hazz@.nospameroosonic.net> wrote in message
news:#A8K3arIFHA.3108@.tk2msftngp13.phx.gbl...
> has anyone heard of this? A unique key separate from primary keys?
Something
> that stands apart from say, clientID, employeeID, companyID,...?
thx, -hazz
>|||Are you looking for a uniqueidentifier data type? It can create unique
values using NEWID().
Simon Worth
"Hazz" <hazz@.nospameroosonic.net> wrote in message
news:%23A8K3arIFHA.3108@.tk2msftngp13.phx.gbl...
> has anyone heard of this? A unique key separate from primary keys?
Something
> that stands apart from say, clientID, employeeID, companyID,...?
thx, -hazz
>|||Thank you Aaron.
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:uXMBpdrIFHA.3484@.TK2MSFTNGP12.phx.gbl...
> There is the ability to create a unique index and a unique constraint.
> I've
> never heard of "enterprise keys" with specific relation to SQL Server.
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "Hazz" <hazz@.nospameroosonic.net> wrote in message
> news:#A8K3arIFHA.3108@.tk2msftngp13.phx.gbl...
> Something
> thx, -hazz
>|||Thank you Simon.
"Simon Worth" <REMOVEFIRST_simon.worth@.gmail.com> wrote in message
news:%23MBjFgyIFHA.2132@.TK2MSFTNGP14.phx.gbl...
> Are you looking for a uniqueidentifier data type? It can create unique
> values using NEWID().
> --
> Simon Worth
>
> "Hazz" <hazz@.nospameroosonic.net> wrote in message
> news:%23A8K3arIFHA.3108@.tk2msftngp13.phx.gbl...
> Something
> thx, -hazz
>

Enterprise DB w/out keys

Hi all-

I have recently come across a DB Schema without about 300 tables, none of which have any keys associated with them. What I did notice however is the schema has 3000 or so SProcs which is handling most of the validations.

Does anyone know of any advantages/disadvantages to this approach? I have always been around DB Engineers who have stressed upon having keys for Table level integrity.

Thanks for your time.The primary benefit of this approach to database design is job stability. The database only exists in your head, so they can never fire you.

The disadvantage is that no sane person would ever let you near another project again.|||Thanks for the reply... (the db designers are no longer present... they were contractors, before my time)

I thought this was extremely strange to not have any keys at the table level. I have worked with Oracle Databases in two other jobs and have been involved with Oracle schemas for about 8 years... and keys were a MUST. I was just unsure if I was missing some benefit I was unaware of... or something 'new' in RDBMS theory.

It scares me to think that the application sitting on top of this schema could malfunction and input data without any integrity constraints existing at the table level. This should be a fun one to support. :eek:|||You have your job cut out for you.

Most likely, this database was "designed" by VB or C developers who view databases as nothing more than glorified file cabinets. These people cannot conceive of placing any business logic in the data layer, insisting that all code should be in the middle tier or the interface. It can be hard to talk sense to them, but the best rule of thumb I've come up with is "If a rule applies to the data, keep the rule with the data."

I bet most of the procedures in your database are nothing more than get-n-puts that insert or retrieve records. Put there, no doubt, by people who had heard that user's should not have direct access to the data, but who have little understanding of why.|||blindman, you should have a blog, or at least a web site

you can write (and one cannot say this about most of the blogs out there -- especially sql blogs)

it's hard work skimming through various forums for your occasional gems

put them out on the web for all to see|||Aw shucks, Rudy... :o

Enter Default Values for all columns in all tables except Primary Keys

How can i enter Default Values of " " to all the columns of type character
of all the tables (excluding system tables) and Default Values of 0
of all columns of type numbers. Excluding all primary key columns.

Thank youOn Sun, 3 Apr 2005 18:05:46 -0400, serge wrote:

>How can i enter Default Values of " " to all the columns of type character
>of all the tables (excluding system tables) and Default Values of 0
>of all columns of type numbers. Excluding all primary key columns.
>Thank you

Hi Serge,

CREATE TABLE Example (PKCol int NOT NULL PRIMARY KEY,
NumCol int NOT NULL DEFAULT 0,
CharCol varchar(20) NOT NULL DEFAULT '')
go
INSERT Example (PKCol)
VALUES (1)
SELECT * FROM Example
go
DROP TABLE Example
go

Best, Hugo
--

(Remove _NO_ and _SPAM_ to get my e-mail address)