Click here to Skip to main content
15,905,967 members
Home / Discussions / Database
   

Database

 
GeneralRe: T-SQL: How to force rows insertion ignoring transactions? Pin
Yuval Naveh20-Jan-10 2:58
Yuval Naveh20-Jan-10 2:58 
AnswerRe: T-SQL: How to force rows insertion ignoring transactions? Pin
debrah.h4819-Jan-10 19:00
debrah.h4819-Jan-10 19:00 
GeneralRe: T-SQL: How to force rows insertion ignoring transactions? Pin
Yuval Naveh20-Jan-10 2:59
Yuval Naveh20-Jan-10 2:59 
QuestionCentralized Query Optimization Pin
AmbiguousName19-Jan-10 6:34
AmbiguousName19-Jan-10 6:34 
AnswerRe: Centralized Query Optimization Pin
Eddy Vluggen19-Jan-10 9:43
professionalEddy Vluggen19-Jan-10 9:43 
GeneralRe: Centralized Query Optimization Pin
AmbiguousName19-Jan-10 21:14
AmbiguousName19-Jan-10 21:14 
GeneralRe: Centralized Query Optimization Pin
Eddy Vluggen20-Jan-10 0:15
professionalEddy Vluggen20-Jan-10 0:15 
QuestionBULK INSERT problem with SQL Server 2008 DATE format Pin
Gawiz19-Jan-10 6:16
professionalGawiz19-Jan-10 6:16 
SQL Server 2008 has the new 3-byte DATE format that I would like to use, being as I don't need the extra overhead of storing TIME.

I used bcp to generate the following format file from my table definition:

"<?xml version="1.0"?>
<BCPFORMAT xmlns="http://schemas.microsoft.com/sqlserver/2004/bulkload/format" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<RECORD>
   <FIELD ID="1" xsi:type="CharTerm" TERMINATOR="\t" MAX_LENGTH="10" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
   <FIELD ID="2" xsi:type="CharTerm" TERMINATOR="\r\n" MAX_LENGTH="11"/>
</RECORD>
<ROW>
   <COLUMN SOURCE="1" NAME="Symbol" xsi:type="SQLVARYCHAR"/>
   <COLUMN SOURCE="2" NAME="myDate" xsi:type="SQLDATE"/>
</ROW>
</BCPFORMAT>"

xsi:type="SQLDATE" is used to define the transformation for the date in my ascii file to the DATE in the table.

A snippet from the input file is:

AAI     19940101
ACL     19981231
AKA     20091208

BULK INSERT interprets all of these dates to be 1900-01-01, which would be the default value I suppose.

But if I change my input file to:

AAI     1994-01-01
ACL     1998-12-31
AKA     2009-12-08

BULK INSERT inserts the correct date values into my table.

This is peculiar because if I define the table to be SMALLDATETIME instead of DATE and SQLDATETIM4 instead of SQLDATE, then either input file works OK.

It wouldn't be such a big issue for me except that I have thousands of files each with thousands of rows and converting them all before importing is going to be time consuming.

I think this is a bug in SS2008.   I tried to report it to Microsoft, but to open a support ticket costs $99Confused | :confused:

1) Is there a free/simple way to report the bug to Microsoft
2) Is there an updated version of bcp.exe (I can't find one)
3) Is there a workaround that doesn't involve pre-formatting the input

Thanks

Steve
AnswerRe: BULK INSERT problem with SQL Server 2008 DATE format Pin
Eddy Vluggen19-Jan-10 11:04
professionalEddy Vluggen19-Jan-10 11:04 
QuestionOpening A Database Connection [SOLVED] Pin
#realJSOP19-Jan-10 4:24
professional#realJSOP19-Jan-10 4:24 
AnswerRe: Opening A Database Connection Pin
loyal ginger19-Jan-10 4:34
loyal ginger19-Jan-10 4:34 
GeneralRe: Opening A Database Connection [modified] Pin
#realJSOP19-Jan-10 4:57
professional#realJSOP19-Jan-10 4:57 
GeneralRe: Opening A Database Connection Pin
Eddy Vluggen19-Jan-10 5:08
professionalEddy Vluggen19-Jan-10 5:08 
GeneralRe: Opening A Database Connection Pin
#realJSOP19-Jan-10 5:26
professional#realJSOP19-Jan-10 5:26 
AnswerRe: Opening A Database Connection Pin
Luc Pattyn19-Jan-10 5:52
sitebuilderLuc Pattyn19-Jan-10 5:52 
GeneralRe: Opening A Database Connection Pin
#realJSOP19-Jan-10 6:18
professional#realJSOP19-Jan-10 6:18 
GeneralRe: Opening A Database Connection Pin
#realJSOP19-Jan-10 7:15
professional#realJSOP19-Jan-10 7:15 
GeneralRe: Opening A Database Connection Pin
#realJSOP19-Jan-10 8:37
professional#realJSOP19-Jan-10 8:37 
AnswerRe: Opening A Database Connection Pin
Shameel19-Jan-10 8:04
professionalShameel19-Jan-10 8:04 
GeneralRe: Opening A Database Connection [modified] Pin
#realJSOP19-Jan-10 8:25
professional#realJSOP19-Jan-10 8:25 
QuestionConsuming a web service using a stored procedure Pin
Mohammad Al Hoss19-Jan-10 3:10
Mohammad Al Hoss19-Jan-10 3:10 
AnswerRe: Consuming a web service using a stored procedure Pin
Eddy Vluggen19-Jan-10 5:06
professionalEddy Vluggen19-Jan-10 5:06 
QuestionFloating Point Numbers Stored as Text with Integration Services Pin
moon_stick19-Jan-10 2:22
moon_stick19-Jan-10 2:22 
AnswerRe: Floating Point Numbers Stored as Text with Integration Services Pin
Eddy Vluggen19-Jan-10 11:15
professionalEddy Vluggen19-Jan-10 11:15 
QuestionSQL Application - stuck on the way I should update my Table Pin
ps0f0r18-Jan-10 22:24
ps0f0r18-Jan-10 22:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.