Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Ravi Shankar
Starting Member
3 Posts |
Posted - 2008-03-31 : 09:08:20
|
| pls send me some code samples to import a html/txt file using the sp_oacreate proceduream getting the error number -2147221005please let me know |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2008-03-31 : 09:11:51
|
| Can you post the code you have at the moment.sp_oacreate just instantiates a com object so which one are you trying to use.Have you thought about using bulk insert?==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
Ravi Shankar
Starting Member
3 Posts |
Posted - 2008-03-31 : 09:25:46
|
| hi, thanks for the speedy reply,infact i have a html file which i need to insert into a table with html tagsi was surfing for sp_oacreateso suggest me a approriate wayi need to do this activity from SQL Server endRegardsRavi |
 |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2008-03-31 : 09:35:29
|
| You mean you have an text file on your disk which you want to import into a column?try something likecreate table #a(s varchar(max))bulk insert #a from 'c:\myfile.html' with (fieldterminator='%^*O&^£$',columnterminator='!"£"%^^')==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
Ravi Shankar
Starting Member
3 Posts |
Posted - 2008-04-01 : 01:50:13
|
| Hi,Infact the html file with the entire source has to be inserted into a single column.there is no delimitors, as i said the entire source pls let me knowand also any help on sp_oacreate way of using file system objectregards |
 |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2008-04-01 : 05:43:04
|
| Did you look at my previous pot? That should do it.See http://www.nigelrivett.net/SQLTsql/CheckIfFileExists.htmlfor an example of using file system object.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
|
|
|