How to Get Description of Column_Flags by function GetSchema

Mansour_Dalir 1,571 Reputation points
2024-04-15T17:21:22.44+00:00

User's image

hi . What are these numbers and how can they be translated?

   Dim cn As New OleDb.OleDbConnection(Conn_String_Access)
        cn.Open()
        Dim dtSheama As New DataTable
        dtSheama = cn.GetSchema("Tables") 'indexes'columns'Tables
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,741 questions
VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,575 questions
0 comments No comments
{count} votes

Accepted answer
  1. Jiachen Li-MSFT 26,666 Reputation points Microsoft Vendor
    2024-04-16T02:34:25.9433333+00:00

    Hi @Mansour_Dalir ,

    For details about the meaning of Column_Flags values, see DBSCHEMA_COLUMNS.

            Using connection As New SqlConnection(connectionString)
                connection.Open()
    
                Dim tableSchema As DataTable = connection.GetSchema("Columns", New String() {Nothing, Nothing, tableName})
    
                For Each row As DataRow In tableSchema.Rows
                    Dim columnName As String = row("COLUMN_NAME").ToString()
                    Dim columnFlags As Integer = Convert.ToInt32(row("COLUMN_FLAGS"))
    
                    Console.WriteLine($"Column Name: {columnName}, Column Flags: {columnFlags}")
                Next
            End Using
    
    

    Best Regards.

    Jiachen Li


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful