Showing posts with label searched. Show all posts
Showing posts with label searched. Show all posts

Monday, March 26, 2012

Primary Keys: Best Practice: uniqueidentifier or?

I've searched the posts and library. Associates have different ideas on the topic. So what is your opinion?

For SQL 2005, what is the recommended data type for a primary key?

Hi,

tihs is normally not a thing of best practice. I am always a friend of using natural Primary Keys rather than artifical produced keys. Uniqueidentifiet is normally NOT a natural key.

Using GUIDs or not is a religious question, which I decided for me is a worse practice, because storing GUID is often more expensive than storing natural keys. Primary keys should always be designed to use the less amount of data that joining will not be expensive. If you have no natural key, I am always a friend of using integer value (differnent scale based on the requirement, e.g. for a table of male/female you won′t need a bigint, though there won′t be much more genders)

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

|||Unless you need a guid for a reason(networked based uniqueness) then I suggest using an Integer with the identity attribute, this will autogenerate keys like autonumber does in access. THis assumes of course that you can not follow Jens advice of finding a natural key.

Primary Keys: Best Practice: uniqueidentifier or?

I've searched the posts and library. Associates have different ideas on the topic. So what is your opinion?

For SQL 2005, what is the recommended data type for a primary key?

Hi,

tihs is normally not a thing of best practice. I am always a friend of using natural Primary Keys rather than artifical produced keys. Uniqueidentifiet is normally NOT a natural key.

Using GUIDs or not is a religious question, which I decided for me is a worse practice, because storing GUID is often more expensive than storing natural keys. Primary keys should always be designed to use the less amount of data that joining will not be expensive. If you have no natural key, I am always a friend of using integer value (differnent scale based on the requirement, e.g. for a table of male/female you won′t need a bigint, though there won′t be much more genders)

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

|||Unless you need a guid for a reason(networked based uniqueness) then I suggest using an Integer with the identity attribute, this will autogenerate keys like autonumber does in access. THis assumes of course that you can not follow Jens advice of finding a natural key.sql

Saturday, February 25, 2012

Previous Function - Help

Newbie question. I have searched the posts and have found a few that say the
previous function works. The documentation in the online books is a little
sketchy. Does someone have a detailed example? If not, could someone point
me to more detailed documentation on this function?
Thanks,
RickThe documentation about the Previous() function is actually incorrect
because it describes multiple parameters. The Previous function only has one
argument which is an expression and you can use Previous() only in a list or
a table.
Example:
=Previous(Fields!A.Value)
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"Rick" <Rick@.discussions.microsoft.com> wrote in message
news:A47E8613-9078-4610-A528-FC5923197318@.microsoft.com...
> Newbie question. I have searched the posts and have found a few that say
> the
> previous function works. The documentation in the online books is a
> little
> sketchy. Does someone have a detailed example? If not, could someone
> point
> me to more detailed documentation on this function?
> Thanks,
> Rick|||Thanks Robert. Works like a champ.
"Robert Bruckner [MSFT]" wrote:
> The documentation about the Previous() function is actually incorrect
> because it describes multiple parameters. The Previous function only has one
> argument which is an expression and you can use Previous() only in a list or
> a table.
> Example:
> =Previous(Fields!A.Value)
> -- Robert
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Rick" <Rick@.discussions.microsoft.com> wrote in message
> news:A47E8613-9078-4610-A528-FC5923197318@.microsoft.com...
> > Newbie question. I have searched the posts and have found a few that say
> > the
> > previous function works. The documentation in the online books is a
> > little
> > sketchy. Does someone have a detailed example? If not, could someone
> > point
> > me to more detailed documentation on this function?
> >
> > Thanks,
> > Rick
>
>