Showing posts with label html. Show all posts
Showing posts with label html. Show all posts

Monday, March 26, 2012

import HTML table into SQL table

Hi Everybody,
I need to import a table from HTML into a SQL table using VBScript. I
can figure out how to get to the correct table tag using a regular
expression, but I don't know how to import the column values into a SQL
table.
Also, how do I stop when I get to the end of the HTML table? There is
an unknown number of rows in my HTML files, but always four columns.
As always, thanks for the help.
Eric BragasUse vbscript and write the content of the html table to a csv. Then it would
be a piece of cake to bcp/import the table into sqlserver.
-oj
"Eric Bragas" <ericbragas@.yahoo.com> wrote in message
news:1126539668.829200.142170@.g43g2000cwa.googlegroups.com...
> Hi Everybody,
> I need to import a table from HTML into a SQL table using VBScript. I
> can figure out how to get to the correct table tag using a regular
> expression, but I don't know how to import the column values into a SQL
> table.
> Also, how do I stop when I get to the end of the HTML table? There is
> an unknown number of rows in my HTML files, but always four columns.
> As always, thanks for the help.
> Eric Bragas
>sql

import html string into sql database

Hi guys,

Here is the html string that I want to transfer it to another variable so, I can post it to my sql server database

<span style=\""font: 12px arial; color : #000000; text-decoration : none;\""><br>MODEL- USB01000C01CL VENDOR- ACTIONTEC ELECTRONICS<br> <br>FEATURES- VoSKY Chatterbox for Skype<br> Plug-and-Play Speakerphone for Skype!<br> VoSKY Chatterbox from Actiontec is the go-anywhere speakerphone <br> solution for Skype! No software or special drivers required. Simply <br> plug your VoSKY Chatterbox into any computer and you are ready to <br> start talking! <br> Make Skype Calls on a Speakerphone Plug Chatterbox into your <br> computer, and make or receive a Skype call as you normally would. <br> Then talk to your Skype contacts, hands-free and without wearing <br> headsets! <br> You do not need to download any additional drivers or software. Just<br> take Chatterbox, plug it into any computer, and you are ready to <br> go! <br> Chatterbox offers superb sound quality with the latest technology in<br> full duplex audio, DSP-enhanced sound quality, and echo <br> cancellation. <br>* Verified by and certified for Skype <br>* Replaces your headset/microphone <br>* Small, lightweight device goes anywhere you go <br>* Full duplex speakerphone with adjustable volume and mute control <br>* DSP-enhanced sound quality <br> <br> -- SPECIFICATIONs -----------<br>CONNECTORs - (1) USB 2.0/1.1 port<br> (1) 2.5mm Headset Jack<br>INDICATORS - LEDs for Ready, Microphone Mute<br>FUNCTION KEYS- Volume Up, Volume Down, Microphone Mute <br>SPEAKER - 1w peak, 40 mm, 4 ohm, 120 Hz to 6 KHz, 120 dB <br>MICROPHONE - Voice pick-up range up to 4 meters <br>APPROVALS - FCC, CE<br>REQUIREMENTS - PC running Windows 2000/XP with one available USB port. <br>DIMENSIONS - 7.7cm x 5.8cm x 2.1cm WT. 50 grams<br> <br><br>MANUFACTURER WARRANTY: 1 YEAR</span>

however If I just do;

dim myvariable as string = htmlvalueatabove

after importing the myvariable value to the sqlserver my asp.net detailview control only able to show only first 17 letters . Up until "fo"

I am sorry if I am not able to provide you clear question. I am so frastrated at the moment, after 6 coffie and 2 minutes bathroom break I can't write anymore. I will shutup and wait for one you and respond.

thanks

Cemal

SQL Server treats an single quote ' as a delimiter character so to properly store it in the database you have to use double quotes ''

|||

Thank you very much for trying to answer my question, Even though you might be correct on your answer for another user problem, in my case this was another story. I simply forget and defined the sql variable as 255 character lenght. All I had do was; go back to my sql stored procudure and change the limited character varibale to text.

afterwards everything worked out fine.

again thank you.

import html file error

Im trying to import an html file using dts. When I click on the file when
using dts designer, I get the message:
External table is not in the expected format.
Any ideas?
SQL2K SP3
TIA, ChrisR
In message <udOcQh54EHA.936@.TK2MSFTNGP12.phx.gbl>, ChrisR
<bla@.noemail.com> writes
>Im trying to import an html file using dts. When I click on the file when
>using dts designer, I get the message:
>External table is not in the expected format.
>Any ideas?
>--
>SQL2K SP3
>TIA, ChrisR
>
Does the error not say it all? The HTML connection cannot
parse/recognise a valid html table in that file. No table, no import.
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com
PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org

import html file error

Im trying to import an html file using dts. When I click on the file when
using dts designer, I get the message:
External table is not in the expected format.
Any ideas?
--
SQL2K SP3
TIA, ChrisRIn message <udOcQh54EHA.936@.TK2MSFTNGP12.phx.gbl>, ChrisR
<bla@.noemail.com> writes
>Im trying to import an html file using dts. When I click on the file when
>using dts designer, I get the message:
>External table is not in the expected format.
>Any ideas?
>--
>SQL2K SP3
>TIA, ChrisR
>
Does the error not say it all? The HTML connection cannot
parse/recognise a valid html table in that file. No table, no import.
--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com
PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org

Import HTML and Tab delimited into SQL

Hi,
I need to import files from either HTML or Tab delimited format into SQL
Server. I imagine this would involve DTS and/or a DSN, but I'm not sure of
the details. I'm able to standardize the filename and directory using code,
so that's not a problem. Any ideas?
HTML? I don't think so. Tab delimited, you bet.
Yes, you would set up a DTS packages using the
Import / Export wizard.
If you want to script this and run it, check out this
VBScript code sample:
http://www.eggheadcafe.com/articles/20030923.asp
2005 Microsoft MVP C#
Robbe Morris
http://www.masterado.net
http://www.mastervb.net
"Eric" <Eric@.discussions.microsoft.com> wrote in message
news:C603F79A-3654-4785-B144-84909C69473E@.microsoft.com...
> Hi,
> I need to import files from either HTML or Tab delimited format into SQL
> Server. I imagine this would involve DTS and/or a DSN, but I'm not sure of
> the details. I'm able to standardize the filename and directory using
> code,
> so that's not a problem. Any ideas?