Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

Log Parser - Specify DateTime Datatype

$
0
0

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


Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>