I'm using PowerShell and Log Parser to import CSV data into a series of SQL Server tables. It's working in as much as I'm selecting all columns with the default datatypes using the following query:
$query = "SELECT * INTO [dbo].[$table] FROM 'c:\myfile.csv'"
I plan on specifying the individual columns though in order to avoid importing the Filename and RowNumber. If the csv date column is in the format of 'dd/mm/yyyy 00:00' how would I import it as a datetime datatype in SQL Server?
Thanks in advance
Adam