Microsoft Access DDL for new bigint fields - ms-access

Access 2016 added support for "Large Number" fields, a 64-bit integral type. How can I use CREATE TABLE or ALTER TABLE DDL statements to create fields of this type?

This is not possible as of January 2019. Using the Query Parameters dialog in a design screen, it's possible to get an exhaustive list of Access SQL types and and (by using sql view) their DDL equivalents:
There is no Access SQL data type available which corresponds to the field type Large Number.

Related

Data cells "#Deleted" in Access - ODBC, MySQL and BIGINT unique ID

I have problem with MS Access 2007 table connected via ODBC to MySQL server (not Microsoft SQL Server).
If unique identifier in MySQL table is BIGINT - all cells content is displayed like this: "#Deleted".
I have found this article:
"#Deleted" errors with linked ODBC tables (at support.microsoft.com)
and it says:
The following are some strategies that you can use to avoid this
behavior:
Avoid entering records that are exactly the same except for the unique index.
Avoid an update that triggers updates of both the unique index and another field.
Do not use a Float field as a unique index or as part of a unique index because of the inherent rounding problems of this data type.
Do all the updates and inserts by using SQL pass-through queries so that you know exactly what is sent to the ODBC data source.
Retrieve records with an SQL pass-through query. An SQL pass-through query is not updateable, and therefore does not cause
"#Delete" errors.
Avoid storing Null values within any field making up the unique index of your linked ODBC table.
but I don't have any of these things "to avoid". My problem is in BIGINT. To make sure if this is it I created 2 tables, one with INT id, one with BIGINT. And this is it.
I can't change BIGINT to INT in my production database.
Is there any way to fix this?
Im using: Access 2007, mysql-connector-odbc-3.51.30-winx64, MySQL server 5.1.73.
You can try basing the form on an Access query, and converting the BIGINT to an INT using CInt() in the query. This happens before the form processing. Depending on your circumstance, you may need to convert to a string (CStr()) in the Query, and then manually handle validating a user has entered a number using IsNumeric. The idea is to trick the form into not trying to interpret the datatype, which seems to be your problem.
Access 2016 now supports BigInt: https://blogs.office.com/2017/03/06/new-in-access-2016-large-number-bigint-support/
It's 2019 and with the latest ODBC driver from Oracle (v 8.0.17) and Access 365 (v 16.0.11904), the problem still occurs.
When the ODBC "Treat BIGINT columns as INT columns" is ticked and in Access support for Bigint is enable in options, the Linked tables with Bigint #id columns (the primary key) shows as deleted. Ruby creates these by default, so we are loathe to fiddle with that.
If we disable the above two option, Access thinks the #id column bigint is a string and shows the data. But then the field type is not bigint or int anymore.
This is quite pathetic, since this problem is almost 10 years old now.
The MySQL driver has an option to convert BIGINT values to INT. Would this solve the issue for you?

i am migrtaing database from sql server 2008 to teradata

I am migrating a database from Sql Server 2008 to Teradata
and I am facing a problem:
In Sql Server in the ddl of a table column is defined as follows:
[rowguid] uniqueidentifier ROWGUIDCOL NOT NULL CONSTRAINT [DF_Address_rowguid] DEFAULT (NEWID())
This column uses newid() function to generate and insert random varchar value in the column [rowguid] if the user doesnt provide any input.
There is no similar function in Teradata to generate this value.
What can be used instead of of NEWID() function of Sql Server while creating similar table ddls for Teradata?
There is no native equivalent for a GUID/UUID in Teradata. Teradata does offer an IDENTITY column to provide an auto-incrementing column. The IDENTITY column does not come without its own nuances and I would encourage you to read the Chapter 5 - Create Table in the SQL Data Definition Language - Detailed Topics which has a section explaining Identity Columns.
However, as part of your migration from SQL Server to Teradata you will need to understand the concept of how data is distributed in Teradata by means of the table's primary index. This may require that you review your existing data model and re-engineer how it is physically implemented in Teradata.

ODBC linked table not showing fractions of seconds

I have linked an IBM informix database table through an ODBC connection to an Access 2010 database. My issue is that the date field in this table only shows dd/mm/yy HH:nn:ss in the Access view, where the stored data is to 1000th of a second.
I can show this in Excel 2010 but not in Access 2010: is this possible? Not having this level of accuracy is preventing me making accurate calculations!
There is a similar question on another forum here. The Date/Time field type in Access does not store fractions of seconds, and linked tables implicitly cast their columns to the corresponding Access data type, so the fractions of seconds are not available in a linked table even though they are stored in the remote database.
For example, I have a SQL Server database with a table named dbo.linkedTable that has a datetime column with fractions of seconds:
If I create a linked table in Access the [datetimeCol] is mapped to the Date/Time field type in Access and the times are rounded to the nearest second
As a workaround, I can create a Pass-Through query that uses T-SQL to convert the datetime value to a string...
SELECT ID, CONVERT(varchar, datetimeCol, 21) AS strDatetime FROM dbo.linkedTable
...returning...
...and I can parse the [strDatetime] string value to retrieve the fractional seconds.

How do I make a stored procedure in MS Access?

How do I make a stored procedure in MS Access?
Access 2010 has both stored procedures, and also has table triggers. And, both features are available even when you not using a server (so, in 100% file based mode).
If you using SQL Server with Access, then of course the stored procedures are built using SQL Server and not Access.
For Access 2010, you open up the table (non-design view), and then choose the table tab. You see options there to create store procedures and table triggers.
For example:
Note that the stored procedure language is its own flavor just like Oracle or SQL Server (T-SQL). Here is example code to update an inventory of fruits as a result of an update in the fruit order table
Keep in mind these are true engine-level table triggers. In fact if you open up that table with VB6, VB.NET, FoxPro or even modify the table on a computer WITHOUT Access having been installed, the procedural code and the trigger at the table level will execute. So, this is a new feature of the data engine jet (now called ACE) for Access 2010. As noted, this is procedural code that runs, not just a single statement.
If you mean the type of procedure you find in SQL Server, prior to 2010, you can't. If you want a query that accepts a parameter, you can use the query design window:
PARAMETERS SomeParam Text(10);
SELECT Field FROM Table
WHERE OtherField=SomeParam
You can also say:
CREATE PROCEDURE ProcedureName
(Parameter1 datatype, Parameter2 datatype) AS
SQLStatement
From: http://msdn.microsoft.com/en-us/library/aa139977(office.10).aspx#acadvsql_procs
Note that the procedure contains only one statement.

Does Microsoft Access 2003 contain sets or multisets?

I'm trying to confirm or deny whether you can define a table column in MS Access 2003 as a set. It seems this is implemented in Office 2007 - you can define a column to have a 'multi-select list' in the query/lookup, but this feature appears to be unique to the new access 2007 file format as far as I can determine.
Worded another way, does MS Access 2003 have the equivalent to the SQL statement:
CREATE TABLE mytable (foo VARCHAR(10), bar VARCHAR(5) MULTISET);
Or is there a clever workaround to achieve something similar? I would accept an answer providing information on any collection constructors in Access 2003.
Are you referring to the Access Database Engine's multivalued data types? If so then yes, these are new to the ACE (2007) version of the engine and are not available in Jet 4.0 being Access2003's version of the engine.
FWIW I tried your SQL in Access2007 using ANSI-92 Query Mode (OLE DB, engine type = 5) and the MULTISET keyword wasn't recognized.
Note you may not need nor want multivalued types. One particular criticism is that Access Database SQL DML expressions service hasn't been altered to take account of multivalued types. Also, see this article Multivalued datatypes considered harmful:
both Suraj [Poozhiyil, the MS Access
Program Manager] and I agree
wholeheartedly that developers do not
need to use multi-valued fields.
People who understand databases
already have a good way of
implementing many to many
relationships and will gain no benefit
from multi-valued fields.
So, my clear and certain advice to
developers is not to use multi-valued
fields. They have nothing to offer us
except potential pain.
UPDATE:
MULTISET is a new datatype officially
beginning with SQL:2003 so I'm
guessing part of the reason for adding
it in Access 2007 is to be fully
compliant with the SQL standard
That's almost amusing. The Access Team have shown no interest in adding SQL syntax that is compliant with any SQL Standard.
[When the SQL Server team were modifying Jet for its 4.0 release they wanted to attain SQL-92 compliance but were prevented from doing so by the Windows team whose components were reliant on some features remaining non-compliant... but that's another story. The Access Team have their own private folk of the code base so they've no such excuse... unless the SharePoint Team now has undue influence? I digress...]
Consider this quote from the document about the SQL2003 Standard:
Values of a MULTISET type can be
created either by enumerating the
individual elements or by supplying
the elements through a query
expression; e.g.,
MULTISET[1, 2, 3, 4]
or
MULTISET(
SELECT grades
FROM courses
)
...Conversely, a multiset value can be
used as a table reference in the FROM
clause using the UNNEST operator.
The Access Team has not added any new expressions nor any operators to the ACE SQL DML syntax. So, no, this has nothing to do with SQL Standards and everything to do with SharePoint.
David W. Fenton: No, [support for
multivalued types] was added in the
ACCDB format (not the ACE, as
#onedaywhen says...)
Consider this quote from the Access Team's own blog:
The primary feature we added to the new
Access engine is support for “complex
data”.
It is definitely an engine feature!