February 12, 2008 at 2:17 am
Hi guys,
I am facing some problem while inserting the date in to particular table using csv format file
Can anyone help me out.
February 12, 2008 at 12:34 pm
It's going to take more info than that to help you.... As in - what issue are you running into? What does you data look like? What do you want the output to look like?
Help us help you.
----------------------------------------------------------------------------------
Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?
February 12, 2008 at 1:26 pm
- What statement are you using ?
did you test using :
BULK INSERT mydb.myschema.myobject
from '\\UNC_path\myobjectdata.txt'
WITH
( FIELDTERMINATOR = ''
--,CODEPAGE = 'raw'
, FIRSTROW = 2
)
(Check bol for more info)
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data/code to get the best help[/url]
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution 😀
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
February 12, 2008 at 1:49 pm
Is the column you are inserting into smalldatetime or datetime? Are you getting an overflow error? I have seen problems because of bad dates in legacy systems like 1/1/0007 which will overflow smalldatetime and datetime.
As Matt said, without more information about your problem I can't provide anymore help.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
February 13, 2008 at 10:38 pm
Check OPENROWSET, OpenDataSource help.
It may help you.
February 16, 2008 at 6:47 pm
You can use Import Data feature to insert data from csv file to a table. In the Data Source. You have to choose "Text File" from the dropdown list. If you use the table name as your csv filename, you even do not need to change the Destination table name.
--------------------------------------------------------------
DBA or SQL Programmer? Who Knows. :unsure:
February 16, 2008 at 8:47 pm
Often we have problems with American date formats vs ISO formats vs rest of world formats 🙂 (we in Australia use dd/mm/yyyy). Check which format you're using. You could always treat the column as a string column, get the data into some temporary/scratch/staging table and then use some string manipulation or appropriate convert statements to get the date.
February 16, 2008 at 9:51 pm
OP has "left the building"... 😛
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply