Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

read notepad file in sql server 2005 Expand / Collapse
Author
Message
Posted Wednesday, September 1, 2010 5:43 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Tuesday, March 13, 2012 3:58 AM
Points: 42, Visits: 234
Hi,

i have attached notepad file. i have one problem , how can i read the notepad file in sql server 2005.
Please reply.







  Post Attachments 
test.txt (19 views, 12.60 KB)
Post #978666
Posted Wednesday, September 1, 2010 6:24 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, April 22, 2014 1:02 AM
Points: 227, Visits: 666
Hi Grasshopper,

You're going to struggle to work with the file in the format it's in. SQL needs your data to be organised into discrete entities with rows and columns. Your file is organised with data on alternate rows and has metadata embedded within the data structure itself.

If it was me, I'd write a VB script to process the data first. But then, I'm a bit old fashioned

Regards, Iain
Post #978694
Posted Wednesday, September 1, 2010 8:54 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Tuesday, May 10, 2011 2:08 PM
Points: 405, Visits: 2,670
Does this help you?

SELECT BulkColumn FROM OPENROWSET (BULK 'C:\test.txt', SINGLE_CLOB) AS Z

Post #978860
Posted Thursday, September 2, 2010 9:26 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Tuesday, March 13, 2012 3:58 AM
Points: 42, Visits: 234
irobertson (9/1/2010)
Hi Grasshopper,

You're going to struggle to work with the file in the format it's in. SQL needs your data to be organised into discrete entities with rows and columns. Your file is organised with data on alternate rows and has metadata embedded within the data structure itself.

If it was me, I'd write a VB script to process the data first. But then, I'm a bit old fashioned

Regards, Iain


Thanks for reply.
Can you please tell me how can i read it by script.
Post #980016
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse