# Writing to a Database from a Script

Once a database table has been defined, Cognex Designer will automatically add a new function that can be called from a script called AddRow. This function will show up in the function list under: [DatabaseName].[TableName].AddRow

Calling this function with a value for each column will insert a new row of data into the table. For example:

    $Databases.MyData.MyTable.AddRow(DateTime.Now(),12345.67, False,"Message");