First of all congratulation, it's a nice work/script, end very useful for many of uss!One thing that's missing, and I hope you will add to the script is the case of IDETITY column.Yes I know what to do or, what to change in the destination table to make the script working, but for many others it will be a huge help to resolve that issue in the script.

Very nice job! I modified the script a bit to make it a stored proc that spits out the insert statements automatically. I'm always writing scripts such as this or looking for them on the internet to make my job easier - you did a nice job with this one.

Summary ======= Script to create a SELECT statement to script all data of a specified table

Parameters ==========

@table_name The name of the table to be scripted

@handle_big_binary If set to 1 the user defined function udf_varbintohexstr_big will be used to convert BINARY, VARBINARY and IMAGE data. For futher information see remarks.

@column_names If set to 0 only the values to be inserted will be scripted; the column names wont. This saves memory but the destination tables needs exactly the same columns in same order. If set to 1 also the names of the columns to insert the values into will be scripted.

Remarks ======= Attention: In case of colums of type BINARY, VARBINARY or IMAGE you either need the user defined function udf_varbintohexstr_big and option @handle_big_binary set to 1 or you risk a loss of data if the data of a cell are larger than 3998 bytes