Friday, February 24, 2012

data types in SQL Server

I'm new to SQL Server, but could someone explain how to set up a field with an auto number/increment that can be used within an Access DB?Go to Books OnLine. Lookup IDENTITY. Read. Create DDL. Try it, you'll like it :) .|||Do you have SQL Server Client Tools Installed?

Do you know what Books Online is?

How about Enterprise Manager or Query Analyzer?

Do you know what DDL is?|||In reply to your questions:

Yes :)
No :confused:
Yes :)
No :confused:

I've found all that and read about it but that's what I've already done. What I wanted to do was set up a system in Access using forms etc but link the tables to SQL Server instead.
Usually when you create the tables in Access and set up an autonumber field, create a form, run it, when you change part of the form it automatically displays the number when you add a record, I take it when doing it through SQL Server it doesn't do that?|||First, I recommend that you create and Access Data Project rather than an Access MDB with linked tables, if you have not already taken this route.

Second, why are you displaying the auto-generated ID on your form anyway? Identity values are surrogate keys, and on principle should not be exposed to the users.

Third, create your auto-incrementing ID value in your table using Enterprise Manager. The identity value is not assigned, however, until the record is saved, so it will not be able to display it on your form until the transaction is committed.

No comments:

Post a Comment