मुझे एक SQL सर्वर में एक बड़ी सीएसवी फ़ाइल आयात करने की आवश्यकता है। मैं इसका उपयोग कर रहा हूँ:
BULK
INSERT CSVTest
FROM 'c:\csvfile.txt'
WITH
(
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)
GO
समस्या यह है कि मेरे सभी फ़ील्ड उद्धरण ("") से घिरे हुए हैं, इसलिए एक पंक्ति वास्तव में दिखती है:
"1","","2","","sometimes with comma , inside", ""
क्या मैं किसी भी तरह थोक आयात कर सकता हूं और उद्धरणों का उपयोग फ़ील्ड डिलीमीटर के रूप में करने के लिए कह सकता हूं?
Edit: The problem with using '","' as delimiter, as in the examples suggested is that :
What most examples do, is they import the data including the first " in the first column and the last " in the last, then they go ahead and strip that out. Alas my first (and last) column are datetime and will not allow a "20080902 to be imported as datetime.
जो मैं पढ़ रहा हूं उससे मुझे लगता है कि फॉर्मेटफ़ाइल जाने का तरीका है, लेकिन दस्तावेज़ीकरण (एमएसडीएन समेत) बहुत ही अनुपयोगी है।