To store recorded data in an Adaptive Server table by using bcp, you must first create a table for each view defined for the session. In the table, create a separate column for each of the data items that comprise the view. The first column for each table, which stores the date and time of the sample, must be of the datetime datatype.

If no data is returned for a view during a sample interval while Historical Server is recording, a placeholder record is written to the view’s data file. This record contains the timestamp of the sample followed by a comma-separated list of empty values. For this reason, it is recommended that all but the first column be defined to allow nulls.

You may simplify the process of creating tables by having the Historical Server create a script file for you. Use the script_type parameter of the hs_create_recording_session command.

After you create the table(s) on Adaptive Server, you can use the bcp utility to import data from the view data files to their respective tables. Run the following command once for each data file for which you want to import the data into an Adaptive Server table:

bcp [[database_name.]owner.]table_name in view_data_file -c [ -e errfile] [-U username] 
 [-P password] [-S sqlserver] -t,


The default row terminator when using the -c option is a \n (new line) character used by data files. Therefore, you do not need to specify the -r option. If you do specify the record terminator option (-r), be sure to avoid the special significance the backslash (\) character has by including another backslash, i.e., -r\\n.

For more information about bcp, see the Adaptive Server Utilities Guide.