Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Identify auto-incremented / generated columns in a table?

1 view
Skip to first unread message

mkleehammer

unread,
Sep 5, 2009, 2:58:37 PM9/5/09
to
Is there a way to identify columns like SQL Server identity columns?
I see you can use SQLColAttribute for result set columns, but I'm
looking for a way to tell from just a table.

In particular, I'm trying to add this functionality to the Python
pyodbc library:

http://code.google.com/p/pyodbc

Thanks.

Pak-Ming Cheung - MSFT

unread,
Sep 11, 2009, 5:33:05 AM9/11/09
to
You can try the function SQLSpecialColumns
(http://msdn.microsoft.com/en-us/library/ms714602(VS.85).aspx)

Also, for similar issue about result set / table, i think that you can
always workaround by using "SELECT * FROM myTable WHERE 0 = 1"
This will give you an empty result set with meta data filled in.

Thanks,
Ming.
WDAC Team, Microsoft.

P.S. We recommend customers to use the forum to ask questions in the future,
where you can obtain a faster response (Forum is at:
http://social.msdn.microsoft.com/forums/en-US/sqldataaccess/threads/)

0 new messages