How do you use a binarywriter to write the correct MS SQL native format for the Money data type?
I’d like to take a value in .net, read from a file as string representation of a decimal amount (actually an exported ‘Money’ data type from SQL, but that is unimportant).
How can I use a binary writer to write the value so that you can use BCP or BULK INSERT in native format mode to read the value in successfully?
(where w is a binary writer previously instantiated)
There may be cleaner or better ways, but this seems to be ok
as a heads up, this format is only for NON NULL money columns, I think you have to write a length byte first or something to that effect for nullable money columns