Tuesday, March 27, 2012
Can I give specify size for errorlog files?
Can someone tell how can I give specifically size of errorlog files those
are generate from SQL Server 2000 self? And also I want to know if I can
change the archived errorlog files number from 6 to 10?
Regards,
-Chen
You can change the number of logs using Enterprise Manager by right clicking
on SQL Server Logs and choosing configure. Here you can change the default
of 6 to a higher number. As to the size, you could set up a job to monitor
the size of the current log and call sp_cycle_errorlog if it gets too big. I
don't know of a way to set the max size explicitly.
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Chen" <Chen@.discussions.microsoft.com> wrote in message
news:36FD6FCB-557E-47B7-B983-2DBC38B423E0@.microsoft.com...
> Hi,
> Can someone tell how can I give specifically size of errorlog files those
> are generate from SQL Server 2000 self? And also I want to know if I can
> change the archived errorlog files number from 6 to 10?
> Regards,
> -Chen
>
|||Hi Chen,
As mentioned by Jasper, you can use sp_cycle_errorlog on a frequent basis to
limit the size of the error logs. This way you don't have to worry much about
the size of the file.
At our firm, we run it on a weekly basis.
Thanks
Yogish
|||Thanks Jasper and Yogish input info. It's really helped.
-Chen
"Yogish" wrote:
> Hi Chen,
> As mentioned by Jasper, you can use sp_cycle_errorlog on a frequent basis to
> limit the size of the error logs. This way you don't have to worry much about
> the size of the file.
> At our firm, we run it on a weekly basis.
> --
> Thanks
> Yogish
Can I give specify size for errorlog files?
Can someone tell how can I give specifically size of errorlog files those
are generate from SQL Server 2000 self? And also I want to know if I can
change the archived errorlog files number from 6 to 10?
Regards,
-ChenYou can change the number of logs using Enterprise Manager by right clicking
on SQL Server Logs and choosing configure. Here you can change the default
of 6 to a higher number. As to the size, you could set up a job to monitor
the size of the current log and call sp_cycle_errorlog if it gets too big. I
don't know of a way to set the max size explicitly.
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Chen" <Chen@.discussions.microsoft.com> wrote in message
news:36FD6FCB-557E-47B7-B983-2DBC38B423E0@.microsoft.com...
> Hi,
> Can someone tell how can I give specifically size of errorlog files those
> are generate from SQL Server 2000 self? And also I want to know if I can
> change the archived errorlog files number from 6 to 10?
> Regards,
> -Chen
>|||Hi Chen,
As mentioned by Jasper, you can use sp_cycle_errorlog on a frequent basis to
limit the size of the error logs. This way you don't have to worry much abou
t
the size of the file.
At our firm, we run it on a weekly basis.
Thanks
Yogish|||Thanks Jasper and Yogish input info. It's really helped.
-Chen
"Yogish" wrote:
> Hi Chen,
> As mentioned by Jasper, you can use sp_cycle_errorlog on a frequent basis
to
> limit the size of the error logs. This way you don't have to worry much ab
out
> the size of the file.
> At our firm, we run it on a weekly basis.
> --
> Thanks
> Yogish
Can I give specify size for errorlog files?
Can someone tell how can I give specifically size of errorlog files those
are generate from SQL Server 2000 self? And also I want to know if I can
change the archived errorlog files number from 6 to 10?
Regards,
-ChenYou can change the number of logs using Enterprise Manager by right clicking
on SQL Server Logs and choosing configure. Here you can change the default
of 6 to a higher number. As to the size, you could set up a job to monitor
the size of the current log and call sp_cycle_errorlog if it gets too big. I
don't know of a way to set the max size explicitly.
--
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Chen" <Chen@.discussions.microsoft.com> wrote in message
news:36FD6FCB-557E-47B7-B983-2DBC38B423E0@.microsoft.com...
> Hi,
> Can someone tell how can I give specifically size of errorlog files those
> are generate from SQL Server 2000 self? And also I want to know if I can
> change the archived errorlog files number from 6 to 10?
> Regards,
> -Chen
>|||Hi Chen,
As mentioned by Jasper, you can use sp_cycle_errorlog on a frequent basis to
limit the size of the error logs. This way you don't have to worry much about
the size of the file.
At our firm, we run it on a weekly basis.
--
Thanks
Yogish|||Thanks Jasper and Yogish input info. It's really helped.
-Chen
"Yogish" wrote:
> Hi Chen,
> As mentioned by Jasper, you can use sp_cycle_errorlog on a frequent basis to
> limit the size of the error logs. This way you don't have to worry much about
> the size of the file.
> At our firm, we run it on a weekly basis.
> --
> Thanks
> Yogishsql
CAN I GET MY DATA BACK AFTER REINSTALLING MSDE
THE NEW INSTALLATION WILL NOT RECOGNISE THESE FROM THE OLD INSTALLATION.
IS THERE ANY WAY TO REINSTATE THESE DBS OTHER THAN FROM THE BACK UP THAT I DID NOT DO?
HOPING AND PRAYING IN YOUR HANDS O LORD GURU.
Hi Lofty,
You can "reattach" the database. Take a look at the sp_attach_db stored proc
in BOL.
Basically, you can just say:
sp_attach_db 'newdbname','pathtomdffile','pathtoldsfile'
HTH,
Greg Low (MVP)
MSDE Manager SQL Tools
www.whitebearconsulting.com
"LOFTY" <anonymous@.discussions.microsoft.com> wrote in message
news:57943C4F-8CC8-4CB8-AC3F-C5B097662168@.microsoft.com...
> WHEN I REINSTALLED MSDE THE MSQL7/DATA FOLDER HAS MYDB.MDF AND MYDB.LDF
FILES IN THERE.
> THE NEW INSTALLATION WILL NOT RECOGNISE THESE FROM THE OLD INSTALLATION.
> IS THERE ANY WAY TO REINSTATE THESE DBS OTHER THAN FROM THE BACK UP THAT I
DID NOT DO?
> HOPING AND PRAYING IN YOUR HANDS O LORD GURU.
Sunday, March 25, 2012
Can I export a report as PDF files within a DOS batch file?
Is there any command line tool that helps me to export a report into a PDF
file?
I need to do that within a batch file. I am trying to avoid C# coding to do
that.
Any help would be appreciated,
Maxyes, rs.exe should do what you are trying to accomplish.
--
Shaun Beane, MCT, MCDST, MCDBA
dbageek.blogspot.com
"Maxwell2006" <alanalan@.newsgroup.nospam> wrote in message
news:eU8dFLcXGHA.3724@.TK2MSFTNGP02.phx.gbl...
> Hi,
> Is there any command line tool that helps me to export a report into a PDF
> file?
> I need to do that within a batch file. I am trying to avoid C# coding to
> do that.
> Any help would be appreciated,
> Max
>|||Great! Do you know any link to a sample that shows me how to export and save
the report into a PDF file?
"Shaun Beane" <shaun.beane@.gmail.nojunk.com> wrote in message
news:OhIWIZcXGHA.4148@.TK2MSFTNGP03.phx.gbl...
> yes, rs.exe should do what you are trying to accomplish.
> --
> Shaun Beane, MCT, MCDST, MCDBA
> dbageek.blogspot.com
> "Maxwell2006" <alanalan@.newsgroup.nospam> wrote in message
> news:eU8dFLcXGHA.3724@.TK2MSFTNGP02.phx.gbl...
>> Hi,
>> Is there any command line tool that helps me to export a report into a
>> PDF file?
>> I need to do that within a batch file. I am trying to avoid C# coding to
>> do that.
>> Any help would be appreciated,
>> Max
>>
>|||Hi Maxwell,
You can use the RS.exe Utility to export the report to the PDF file.
RS.exe will read a script file which should be written by VB.NET.
Here is a article posted some sample code, you may try to refer.
http://groups.google.com/group/microsoft.public.sqlserver.reportingsvcs/brow
se_frm/thread/e608c8fecc95d08/8a2dcc6ca82bf3fc?tvc=1&q=RS+utility+export+pdf
&hl=zh-CN#8a2dcc6ca82bf3fc
Hope this will be helpful.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.
Can I edit SDF files without full SQL Server license?
Open the file in VS 2005 Open the file in SQL Server Management StudioI don't have, and don't plan to purchase, a license to full SQL Server 2005. I do have Visual Studio 2005 Pro. When I open an SDF file in Visual Studio, I get the following (oh so informative) error:
The operation could not be completed. Unspecified error
Since I don't have full SQL server, I downloaded SQL Server Management Studio Express. There's one major problem: the Server type combo box is disabled in the "Connect to Server" dialog. Try as I might, I can find no mention anywhere as to why this is the case. I'm guessing that functionality isn't supported in the Express version of the tool, but as far as I can tell, nobody thinks it might perhaps be reasonable to document why this combo box is disabled. It certainly doesn't show up in the document that shows up when I click the help button on this dialog.
Could somebody at Microsoft please tell me if it is even possible to edit these files without buying a full SQL Server license? I'm trying to use SQL Server Compact Edition to replace legacy code that uses an MDB file (via ADO) for a desktop application. From everything I have read, this is the officially recommended thing to do. But if I now have to buy a full SQL Server lincense to accomplish what used to be a simple double click on an MDB file, then there's something seriously wrong.
It turns out that my problem was the fact that I didn't have Service Pack 2 installed for SQL Server Management Studio Express, although installing that (along with making sure everything else on my system was up-to-date via Microsoft Update) didn't solve the Visual Studio error. I do have SP 1 installed for VS 2005.
sql
Can I disable all exporting formats but Excel worksheets?
Hi, there
Some of the reports I am generating have tens of columns so the management decides to use Excel files only.
Is there any way that for a single report (not the whole project) I can disable printing and most of the exporting options (including PDF, HTML, TXT ...) and only leave the xls files available?
Thanks a lot.
Heng
Hi hengm,
Here is a useful site http://www.exceluser.com/index.htm
sqlThursday, March 22, 2012
Can I disable all exporting formats but Excel spreadsheets?
Hi, there
Some of the reports I am generating have tens of columns so the management decides to use Excel files only.
Is there any way that for a single report (not the whole project) I can disable printing and most of the exporting options (including PDF, HTML, TXT ...) and only leave the xls files available?
Thanks a lot.
Heng
Hi hengm,
Here is a useful site http://www.exceluser.com/index.htm
Can I delete BAK and TRN files?
backup a customer database. The backup works file, but
none of the old backup and transaction files are removed
after each backup, so it is consuming a lot of disk
space. I have BAK and TRN files dating back 3 months.
Before I deleted any of the old files, I wanted to make
sure I am okay to do so. Does anyone know of a problem
with manually most of these files, leaving only the most
recent week or two of backups?
Thanks,
Jason... and if the backups are created by a SQL Server maintenance plan, you can
modify it to have the files older than a specified period removed. It's on
the Complete Backup and Transaction Log Backup tabs respectively, Remove
files older than item.
"Linchi Shea" <linchi_shea@.NOSPAMml.com> wrote in message
news:0b4a01c3d932$260faea0$a001280a@.phx.gbl...
> As far as whether deleting the old backup files will do
> any damage to the backup setup (e.g. your maintanance
> plans) is concerned, there is no problem. But you do need
> to make sure that if you ever need them, you can get them
> back (e.g. from your tape backup facility).
> Linchi
> >--Original Message--
> >I have an implementation of SQL Server 2000 with a job to
> >backup a customer database. The backup works file, but
> >none of the old backup and transaction files are removed
> >after each backup, so it is consuming a lot of disk
> >space. I have BAK and TRN files dating back 3 months.
> >Before I deleted any of the old files, I wanted to make
> >sure I am okay to do so. Does anyone know of a problem
> >with manually most of these files, leaving only the most
> >recent week or two of backups?
> >
> >Thanks,
> >
> >Jason
> >.
> >sql
Can I delete BAK and TRN files?
backup a customer database. The backup works file, but
none of the old backup and transaction files are removed
after each backup, so it is consuming a lot of disk
space. I have BAK and TRN files dating back 3 months.
Before I deleted any of the old files, I wanted to make
sure I am okay to do so. Does anyone know of a problem
with manually most of these files, leaving only the most
recent week or two of backups?
Thanks,
JasonAs far as whether deleting the old backup files will do
any damage to the backup setup (e.g. your maintanance
plans) is concerned, there is no problem. But you do need
to make sure that if you ever need them, you can get them
back (e.g. from your tape backup facility).
Linchi
quote:|||... and if the backups are created by a SQL Server maintenance plan, you ca
>--Original Message--
>I have an implementation of SQL Server 2000 with a job to
>backup a customer database. The backup works file, but
>none of the old backup and transaction files are removed
>after each backup, so it is consuming a lot of disk
>space. I have BAK and TRN files dating back 3 months.
>Before I deleted any of the old files, I wanted to make
>sure I am okay to do so. Does anyone know of a problem
>with manually most of these files, leaving only the most
>recent week or two of backups?
>Thanks,
>Jason
>.
>
n
modify it to have the files older than a specified period removed. It's on
the Complete Backup and Transaction Log Backup tabs respectively, Remove
files older than item.
"Linchi Shea" <linchi_shea@.NOSPAMml.com> wrote in message
news:0b4a01c3d932$260faea0$a001280a@.phx.gbl...[QUOTE]
> As far as whether deleting the old backup files will do
> any damage to the backup setup (e.g. your maintanance
> plans) is concerned, there is no problem. But you do need
> to make sure that if you ever need them, you can get them
> back (e.g. from your tape backup facility).
> Linchi
>
Can I copy database files without dismounting them
from a different location.
I want to maintain two identical copies.
Thanks.Hello!
Yes, of course you can do that by using BACKUP \ RESTORE.
Back up your database and restore it on the other instance or SQL Server.
You may get more information about BACKUP and RESTORE from the following
address:
http://msdn2.microsoft.com/en-us/library/ms187048.aspx
--
Ekrem Önsoy
<war_wheelan@.yahoo.com> wrote in message
news:1189434972.953100.269150@.r34g2000hsd.googlegroups.com...
> Can I copy database files without dismounting them and attach them
> from a different location.
> I want to maintain two identical copies.
> Thanks.
>|||Why can't I copy the db files (mdf/ldf) to a new location without
detaching the database?
Why won't this work?
On Sep 10, 11:25 am, Ekrem =D6nsoy <ek...@.btegitim.com> wrote:
> Hello!
> Yes, of course you can do that by using BACKUP \ RESTORE.
> Back up your database and restore it on the other instance or SQL Server.
> You may get more information about BACKUP and RESTORE from the following
> address:http://msdn2.microsoft.com/en-us/library/ms187048.aspx
> --
> Ekrem =D6nsoy
> <war_whee...@.yahoo.com> wrote in message
> news:1189434972.953100.269150@.r34g2000hsd.googlegroups.com...
> > Can I copy database files without dismounting them and attach them
> > from a different location.
> > I want to maintain two identical copies.
> > Thanks.|||Because attaching is only guaranteed if you have a consistent state of the database, which is what
you get by detaching it.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
<war_wheelan@.yahoo.com> wrote in message
news:1189527362.768605.200480@.w3g2000hsg.googlegroups.com...
Why can't I copy the db files (mdf/ldf) to a new location without
detaching the database?
Why won't this work?
On Sep 10, 11:25 am, Ekrem Önsoy <ek...@.btegitim.com> wrote:
> Hello!
> Yes, of course you can do that by using BACKUP \ RESTORE.
> Back up your database and restore it on the other instance or SQL Server.
> You may get more information about BACKUP and RESTORE from the following
> address:http://msdn2.microsoft.com/en-us/library/ms187048.aspx
> --
> Ekrem Önsoy
> <war_whee...@.yahoo.com> wrote in message
> news:1189434972.953100.269150@.r34g2000hsd.googlegroups.com...
> > Can I copy database files without dismounting them and attach them
> > from a different location.
> > I want to maintain two identical copies.
> > Thanks.sql
Tuesday, March 20, 2012
Can I copy a DTS Package?
9 db tables populated by 9 Excel Import Files via DTS.
Will I need to create a DTS package for each import? Columns are identical in all 9 - the only thing different is the destination table name and source file name.
I've had to map over 80 columns using DTS and don't want to do it for each instance!
Any help would be appreciated..1. Rightclick the DTS-package in Enterprise Manager
2. Choose "design package"
3. Make the changes you want
4. Go to menuitem "Package" and choose "Save as"
5. You now have a copy of your DTS-package|||Nice one! Cheers.|||This is not the best way -
Dude - create a table in the destination db called tblFileSource that has:
ID, SourceFile, DestinationTable, importDate
Define FileSource and DestinationTable as Global Variables in the package.
Then, the first step of you package use a Execute SQL task that will set you global Varaiables to the result of
select top 1 SourceFile, DestinationTable
from tblFileSource
where importDate is null
Then, use a Dynamic Properties Task to change the source and destination in the Data Transformation Step.
Then, after the Transformation, do another Execute SQL Task (on Success):
Update tblFileSource
Set importDate = getDate()
where SourceFile = ?
Where the ? is the global Variable FileSource.
Isn't this a more professional method - comes in handy when the number of files increases.
Monday, March 19, 2012
can i add more files to the filegroup?
2 CPU , 1G memory , the storage device is Disk Array
(RAID5)
The PRIMARY filegroup contains one datafile , i want to
add more files to the PRIMARY and rebuild the index in
another filegroup FGINDX (contains more files) to get
better performance
Can i need to modify the database to get better
management and better performance '
Thanks in advance.Rainbow
You can have more than one datafile in the same filegroup.
What you can not do is have one data file in more than one
filegroup.
Be aware you can only place non-clustered indexes in a
seperate filegroup.
Hope this helps
John|||i wanna better performance , expand the data to more
file '
>--Original Message--
>Rainbow
>You can have more than one datafile in the same
filegroup.
>What you can not do is have one data file in more than
one
>filegroup.
>Be aware you can only place non-clustered indexes in a
>seperate filegroup.
>Hope this helps
>John
>.
>|||Yes you may add more data files to a filegroup.
If you wish existing data to be spread across the new files, you must re-add
the data ( perhaps dropping/re-creating the clust index).
Wayne Snyder, MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
www.computeredservices.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"rainbow" <genghongjie@.163.com> wrote in message
news:061701c38e03$4c9a42d0$a401280a@.phx.gbl...
> i wanna better performance , expand the data to more
> file '
> >--Original Message--
> >Rainbow
> >
> >You can have more than one datafile in the same
> filegroup.
> >What you can not do is have one data file in more than
> one
> >filegroup.
> >
> >Be aware you can only place non-clustered indexes in a
> >seperate filegroup.
> >
> >Hope this helps
> >
> >John
> >.
> >
Wednesday, March 7, 2012
Can BULK INSERT be used like TEXTCOPY?
Hello all!
Is there any way to use BULK INSERT like TEXTCOPY? I have a series of files (on disk),
and I'd like to squirt them in to a table that has an IMAGE column. I could "shell" out
to use TEXTCOPY, but was wondering if I could leverage some built-in SQL construct. BULK
INSERT looked close, but it also looks like the built-in analogue to BCP. That is, it
processes the contents of the file, and I really just want to squirt the file in to the
column verbatim.
Thanks for any help you can provide!
John PetersonYes. You can use bulk insert but you need a format file.
e.g.
1 SQLIMAGE 0 999999 "" 2 coln ""
1= entire file
SQLIMAGE= datatype
0= prefix length
999999= file length/size
""= no terminator
2= column ordinal
coln= column name
""= no collation
Thus, the bulk insert looks like this:
bulk insert tb
from 'file.img'
with(formatfile='fmt.fmt')
"John Peterson" <j0hnp@.comcast.net> wrote in message
news:OtfVd1TvEHA.908@.TK2MSFTNGP11.phx.gbl...
> (SQL Server 2000, SP3a)
> Hello all!
> Is there any way to use BULK INSERT like TEXTCOPY? I have a series of
files (on disk),
> and I'd like to squirt them in to a table that has an IMAGE column. I
could "shell" out
> to use TEXTCOPY, but was wondering if I could leverage some built-in SQL
construct. BULK
> INSERT looked close, but it also looks like the built-in analogue to BCP.
That is, it
> processes the contents of the file, and I really just want to squirt the
file in to the
> column verbatim.
> Thanks for any help you can provide!
> John Peterson
>|||John,
See this thread for an example:
http://groups.google.com/groups?q=405F-B2C5-7256A4B9870A
Steve Kass
Drew University
John Peterson wrote:
>(SQL Server 2000, SP3a)
>Hello all!
>Is there any way to use BULK INSERT like TEXTCOPY? I have a series of files (on disk),
>and I'd like to squirt them in to a table that has an IMAGE column. I could "shell" out
>to use TEXTCOPY, but was wondering if I could leverage some built-in SQL construct. BULK
>INSERT looked close, but it also looks like the built-in analogue to BCP. That is, it
>processes the contents of the file, and I really just want to squirt the file in to the
>column verbatim.
>Thanks for any help you can provide!
>John Peterson
>
>|||Thanks oj and Steve! I think that'll do the trick, even if it's a little awkward. :-)
BTW: Do you need an *exact* binary file size in the format file, as Steve's link
suggests? Or will "oversizing" it suffice?
Thanks again!
"John Peterson" <j0hnp@.comcast.net> wrote in message
news:OtfVd1TvEHA.908@.TK2MSFTNGP11.phx.gbl...
> (SQL Server 2000, SP3a)
> Hello all!
> Is there any way to use BULK INSERT like TEXTCOPY? I have a series of files (on disk),
> and I'd like to squirt them in to a table that has an IMAGE column. I could "shell" out
> to use TEXTCOPY, but was wondering if I could leverage some built-in SQL construct.
> BULK INSERT looked close, but it also looks like the built-in analogue to BCP. That is,
> it processes the contents of the file, and I really just want to squirt the file in to
> the column verbatim.
> Thanks for any help you can provide!
> John Peterson
>|||John,
It's got to be exact. If you oversize it, you get an unexpected
end-of-file:
Server: Msg 4832, Level 16, State 1, Line 1
Bulk Insert: Unexpected end-of-file (EOF) encountered in data file.
Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'STREAM' reported an error. The provider did not give
any information about the error.
OLE DB error trace [OLE/DB Provider 'STREAM' IRowset::GetNextRows
returned 0x80004005: The provider did not give any information about
the error.].
The statement has been terminated.
SK
John Peterson wrote:
>Thanks oj and Steve! I think that'll do the trick, even if it's a little awkward. :-)
>BTW: Do you need an *exact* binary file size in the format file, as Steve's link
>suggests? Or will "oversizing" it suffice?
>Thanks again!
>
>"John Peterson" <j0hnp@.comcast.net> wrote in message
>news:OtfVd1TvEHA.908@.TK2MSFTNGP11.phx.gbl...
>
>>(SQL Server 2000, SP3a)
>>Hello all!
>>Is there any way to use BULK INSERT like TEXTCOPY? I have a series of files (on disk),
>>and I'd like to squirt them in to a table that has an IMAGE column. I could "shell" out
>>to use TEXTCOPY, but was wondering if I could leverage some built-in SQL construct.
>>BULK INSERT looked close, but it also looks like the built-in analogue to BCP. That is,
>>it processes the contents of the file, and I really just want to squirt the file in to
>>the column verbatim.
>>Thanks for any help you can provide!
>>John Peterson
>>
>>
>
>|||Thanks, Steve!
One other option I'm exploring is using a stored procedure with an IMAGE parameter. But,
I have very little experiencing in using VBScript (this is going to be called from a Web
page) and ADO Parameter objects for an IMAGE data. I've been searching on the Web, and
I've seen a few snippets -- but not a comprehensive example. Do you have any
recommendations/links on that route, perchance?
"Steve Kass" <skass@.drew.edu> wrote in message
news:OfadH8WvEHA.2616@.TK2MSFTNGP10.phx.gbl...
> John,
> It's got to be exact. If you oversize it, you get an unexpected end-of-file:
> Server: Msg 4832, Level 16, State 1, Line 1
> Bulk Insert: Unexpected end-of-file (EOF) encountered in data file.
> Server: Msg 7399, Level 16, State 1, Line 1
> OLE DB provider 'STREAM' reported an error. The provider did not give any information
> about the error.
> OLE DB error trace [OLE/DB Provider 'STREAM' IRowset::GetNextRows returned 0x80004005:
> The provider did not give any information about the error.].
> The statement has been terminated.
> SK
> John Peterson wrote:
>>Thanks oj and Steve! I think that'll do the trick, even if it's a little awkward. :-)
>>BTW: Do you need an *exact* binary file size in the format file, as Steve's link
>>suggests? Or will "oversizing" it suffice?
>>Thanks again!
>>
>>"John Peterson" <j0hnp@.comcast.net> wrote in message
>>news:OtfVd1TvEHA.908@.TK2MSFTNGP11.phx.gbl...
>>(SQL Server 2000, SP3a)
>>Hello all!
>>Is there any way to use BULK INSERT like TEXTCOPY? I have a series of files (on disk),
>>and I'd like to squirt them in to a table that has an IMAGE column. I could "shell"
>>out to use TEXTCOPY, but was wondering if I could leverage some built-in SQL construct.
>>BULK INSERT looked close, but it also looks like the built-in analogue to BCP. That
>>is, it processes the contents of the file, and I really just want to squirt the file in
>>to the column verbatim.
>>Thanks for any help you can provide!
>>John Peterson
>>
>>
>>|||John,
I haven't done this myself, but you should be able to pass the image
data with a adLongVarBinary parameter.
You might need to create the parameter 1 byte longer than the length of
the data you're storing, according to
http://support.microsoft.com/default.aspx?scid=kb;en-us;190450
I also saw one suggestion that this meant you have to read back all but
the last byte of the stored image
value when retrieving the data, so you should be watchful:
http://groups.google.com/groups?hl=en&lr=&safe=off&threadm=uMwa0SoD%24GA.235%40cppssbbsa02.microsoft.com&rnum=6&prev=/groups%3Fhl%3Den%26lr%3D%26safe%3Doff%26q%3Dsqlserver%2Bstored%2Bprocedure%2Bimage%2Badlongvarbinary
SK
John Peterson wrote:
>Thanks, Steve!
>One other option I'm exploring is using a stored procedure with an IMAGE parameter. But,
>I have very little experiencing in using VBScript (this is going to be called from a Web
>page) and ADO Parameter objects for an IMAGE data. I've been searching on the Web, and
>I've seen a few snippets -- but not a comprehensive example. Do you have any
>recommendations/links on that route, perchance?
>
>"Steve Kass" <skass@.drew.edu> wrote in message
>news:OfadH8WvEHA.2616@.TK2MSFTNGP10.phx.gbl...
>
>>John,
>> It's got to be exact. If you oversize it, you get an unexpected end-of-file:
>>Server: Msg 4832, Level 16, State 1, Line 1
>>Bulk Insert: Unexpected end-of-file (EOF) encountered in data file.
>>Server: Msg 7399, Level 16, State 1, Line 1
>>OLE DB provider 'STREAM' reported an error. The provider did not give any information
>>about the error.
>>OLE DB error trace [OLE/DB Provider 'STREAM' IRowset::GetNextRows returned 0x80004005:
>>The provider did not give any information about the error.].
>>The statement has been terminated.
>>SK
>>John Peterson wrote:
>>
>>Thanks oj and Steve! I think that'll do the trick, even if it's a little awkward. :-)
>>BTW: Do you need an *exact* binary file size in the format file, as Steve's link
>>suggests? Or will "oversizing" it suffice?
>>Thanks again!
>>
>>"John Peterson" <j0hnp@.comcast.net> wrote in message
>>news:OtfVd1TvEHA.908@.TK2MSFTNGP11.phx.gbl...
>>
>>(SQL Server 2000, SP3a)
>>Hello all!
>>Is there any way to use BULK INSERT like TEXTCOPY? I have a series of files (on disk),
>>and I'd like to squirt them in to a table that has an IMAGE column. I could "shell"
>>out to use TEXTCOPY, but was wondering if I could leverage some built-in SQL construct.
>>BULK INSERT looked close, but it also looks like the built-in analogue to BCP. That
>>is, it processes the contents of the file, and I really just want to squirt the file in
>>to the column verbatim.
>>Thanks for any help you can provide!
>>John Peterson
>>
>>
>>
>>
>
>|||Great stuff! Thanks again, Steve! :-)
"Steve Kass" <skass@.drew.edu> wrote in message
news:eXQUuyjvEHA.2804@.TK2MSFTNGP14.phx.gbl...
> John,
> I haven't done this myself, but you should be able to pass the image data with a
> adLongVarBinary parameter.
> You might need to create the parameter 1 byte longer than the length of the data you're
> storing, according to
> http://support.microsoft.com/default.aspx?scid=kb;en-us;190450
> I also saw one suggestion that this meant you have to read back all but the last byte of
> the stored image
> value when retrieving the data, so you should be watchful:
> http://groups.google.com/groups?hl=en&lr=&safe=off&threadm=uMwa0SoD%24GA.235%40cppssbbsa02.microsoft.com&rnum=6&prev=/groups%3Fhl%3Den%26lr%3D%26safe%3Doff%26q%3Dsqlserver%2Bstored%2Bprocedure%2Bimage%2Badlongvarbinary
> SK
>
> John Peterson wrote:
>>Thanks, Steve!
>>One other option I'm exploring is using a stored procedure with an IMAGE parameter.
>>But, I have very little experiencing in using VBScript (this is going to be called from
>>a Web page) and ADO Parameter objects for an IMAGE data. I've been searching on the
>>Web, and I've seen a few snippets -- but not a comprehensive example. Do you have any
>>recommendations/links on that route, perchance?
>>
>>"Steve Kass" <skass@.drew.edu> wrote in message
>>news:OfadH8WvEHA.2616@.TK2MSFTNGP10.phx.gbl...
>>John,
>> It's got to be exact. If you oversize it, you get an unexpected end-of-file:
>>Server: Msg 4832, Level 16, State 1, Line 1
>>Bulk Insert: Unexpected end-of-file (EOF) encountered in data file.
>>Server: Msg 7399, Level 16, State 1, Line 1
>>OLE DB provider 'STREAM' reported an error. The provider did not give any information
>>about the error.
>>OLE DB error trace [OLE/DB Provider 'STREAM' IRowset::GetNextRows returned 0x80004005:
>>The provider did not give any information about the error.].
>>The statement has been terminated.
>>SK
>>John Peterson wrote:
>>
>>Thanks oj and Steve! I think that'll do the trick, even if it's a little awkward.
>>:-)
>>BTW: Do you need an *exact* binary file size in the format file, as Steve's link
>>suggests? Or will "oversizing" it suffice?
>>Thanks again!
>>
>>"John Peterson" <j0hnp@.comcast.net> wrote in message
>>news:OtfVd1TvEHA.908@.TK2MSFTNGP11.phx.gbl...
>>
>>(SQL Server 2000, SP3a)
>>Hello all!
>>Is there any way to use BULK INSERT like TEXTCOPY? I have a series of files (on
>>disk), and I'd like to squirt them in to a table that has an IMAGE column. I could
>>"shell" out to use TEXTCOPY, but was wondering if I could leverage some built-in SQL
>>construct. BULK INSERT looked close, but it also looks like the built-in analogue to
>>BCP. That is, it processes the contents of the file, and I really just want to
>>squirt the file in to the column verbatim.
>>Thanks for any help you can provide!
>>John Peterson
>>
>>
>>
>>
Can BULK INSERT be used like TEXTCOPY?
Hello all!
Is there any way to use BULK INSERT like TEXTCOPY? I have a series of files (on disk),
and I'd like to squirt them in to a table that has an IMAGE column. I could "shell" out
to use TEXTCOPY, but was wondering if I could leverage some built-in SQL construct. BULK
INSERT looked close, but it also looks like the built-in analogue to BCP. That is, it
processes the contents of the file, and I really just want to squirt the file in to the
column verbatim.
Thanks for any help you can provide!
John Peterson
Yes. You can use bulk insert but you need a format file.
e.g.
1 SQLIMAGE 0 999999 "" 2 coln ""
1= entire file
SQLIMAGE= datatype
0= prefix length
999999= file length/size
""= no terminator
2= column ordinal
coln= column name
""= no collation
Thus, the bulk insert looks like this:
bulk insert tb
from 'file.img'
with(formatfile='fmt.fmt')
"John Peterson" <j0hnp@.comcast.net> wrote in message
news:OtfVd1TvEHA.908@.TK2MSFTNGP11.phx.gbl...
> (SQL Server 2000, SP3a)
> Hello all!
> Is there any way to use BULK INSERT like TEXTCOPY? I have a series of
files (on disk),
> and I'd like to squirt them in to a table that has an IMAGE column. I
could "shell" out
> to use TEXTCOPY, but was wondering if I could leverage some built-in SQL
construct. BULK
> INSERT looked close, but it also looks like the built-in analogue to BCP.
That is, it
> processes the contents of the file, and I really just want to squirt the
file in to the
> column verbatim.
> Thanks for any help you can provide!
> John Peterson
>
|||John,
See this thread for an example:
http://groups.google.com/groups?q=40...5-7256A4B9870A
Steve Kass
Drew University
John Peterson wrote:
>(SQL Server 2000, SP3a)
>Hello all!
>Is there any way to use BULK INSERT like TEXTCOPY? I have a series of files (on disk),
>and I'd like to squirt them in to a table that has an IMAGE column. I could "shell" out
>to use TEXTCOPY, but was wondering if I could leverage some built-in SQL construct. BULK
>INSERT looked close, but it also looks like the built-in analogue to BCP. That is, it
>processes the contents of the file, and I really just want to squirt the file in to the
>column verbatim.
>Thanks for any help you can provide!
>John Peterson
>
>
|||Thanks oj and Steve! I think that'll do the trick, even if it's a little awkward. :-)
BTW: Do you need an *exact* binary file size in the format file, as Steve's link
suggests? Or will "oversizing" it suffice?
Thanks again!
"John Peterson" <j0hnp@.comcast.net> wrote in message
news:OtfVd1TvEHA.908@.TK2MSFTNGP11.phx.gbl...
> (SQL Server 2000, SP3a)
> Hello all!
> Is there any way to use BULK INSERT like TEXTCOPY? I have a series of files (on disk),
> and I'd like to squirt them in to a table that has an IMAGE column. I could "shell" out
> to use TEXTCOPY, but was wondering if I could leverage some built-in SQL construct.
> BULK INSERT looked close, but it also looks like the built-in analogue to BCP. That is,
> it processes the contents of the file, and I really just want to squirt the file in to
> the column verbatim.
> Thanks for any help you can provide!
> John Peterson
>
|||John,
It's got to be exact. If you oversize it, you get an unexpected
end-of-file:
Server: Msg 4832, Level 16, State 1, Line 1
Bulk Insert: Unexpected end-of-file (EOF) encountered in data file.
Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'STREAM' reported an error. The provider did not give
any information about the error.
OLE DB error trace [OLE/DB Provider 'STREAM' IRowset::GetNextRows
returned 0x80004005: The provider did not give any information about
the error.].
The statement has been terminated.
SK
John Peterson wrote:
>Thanks oj and Steve! I think that'll do the trick, even if it's a little awkward. :-)
>BTW: Do you need an *exact* binary file size in the format file, as Steve's link
>suggests? Or will "oversizing" it suffice?
>Thanks again!
>
>"John Peterson" <j0hnp@.comcast.net> wrote in message
>news:OtfVd1TvEHA.908@.TK2MSFTNGP11.phx.gbl...
>
>
>
|||Thanks, Steve!
One other option I'm exploring is using a stored procedure with an IMAGE parameter. But,
I have very little experiencing in using VBScript (this is going to be called from a Web
page) and ADO Parameter objects for an IMAGE data. I've been searching on the Web, and
I've seen a few snippets -- but not a comprehensive example. Do you have any
recommendations/links on that route, perchance?
"Steve Kass" <skass@.drew.edu> wrote in message
news:OfadH8WvEHA.2616@.TK2MSFTNGP10.phx.gbl...[vbcol=seagreen]
> John,
> It's got to be exact. If you oversize it, you get an unexpected end-of-file:
> Server: Msg 4832, Level 16, State 1, Line 1
> Bulk Insert: Unexpected end-of-file (EOF) encountered in data file.
> Server: Msg 7399, Level 16, State 1, Line 1
> OLE DB provider 'STREAM' reported an error. The provider did not give any information
> about the error.
> OLE DB error trace [OLE/DB Provider 'STREAM' IRowset::GetNextRows returned 0x80004005:
> The provider did not give any information about the error.].
> The statement has been terminated.
> SK
> John Peterson wrote:
|||John,
I haven't done this myself, but you should be able to pass the image
data with a adLongVarBinary parameter.
You might need to create the parameter 1 byte longer than the length of
the data you're storing, according to
http://support.microsoft.com/default...b;en-us;190450
I also saw one suggestion that this meant you have to read back all but
the last byte of the stored image
value when retrieving the data, so you should be watchful:
http://groups.google.com/groups?hl=e...dlongvarbinary
SK
John Peterson wrote:
>Thanks, Steve!
>One other option I'm exploring is using a stored procedure with an IMAGE parameter. But,
>I have very little experiencing in using VBScript (this is going to be called from a Web
>page) and ADO Parameter objects for an IMAGE data. I've been searching on the Web, and
>I've seen a few snippets -- but not a comprehensive example. Do you have any
>recommendations/links on that route, perchance?
>
>"Steve Kass" <skass@.drew.edu> wrote in message
>news:OfadH8WvEHA.2616@.TK2MSFTNGP10.phx.gbl...
>
>
>
|||Great stuff! Thanks again, Steve! :-)
"Steve Kass" <skass@.drew.edu> wrote in message
news:eXQUuyjvEHA.2804@.TK2MSFTNGP14.phx.gbl...[vbcol=seagreen]
> John,
> I haven't done this myself, but you should be able to pass the image data with a
> adLongVarBinary parameter.
> You might need to create the parameter 1 byte longer than the length of the data you're
> storing, according to
> http://support.microsoft.com/default...b;en-us;190450
> I also saw one suggestion that this meant you have to read back all but the last byte of
> the stored image
> value when retrieving the data, so you should be watchful:
> http://groups.google.com/groups?hl=e...dlongvarbinary
> SK
>
> John Peterson wrote:
Can BULK INSERT be used like TEXTCOPY?
Hello all!
Is there any way to use BULK INSERT like TEXTCOPY? I have a series of files
(on disk),
and I'd like to squirt them in to a table that has an IMAGE column. I could
"shell" out
to use TEXTCOPY, but was wondering if I could leverage some built-in SQL con
struct. BULK
INSERT looked close, but it also looks like the built-in analogue to BCP. T
hat is, it
processes the contents of the file, and I really just want to squirt the fil
e in to the
column verbatim.
Thanks for any help you can provide!
John PetersonYes. You can use bulk insert but you need a format file.
e.g.
1 SQLIMAGE 0 999999 "" 2 coln ""
1= entire file
SQLIMAGE= datatype
0= prefix length
999999= file length/size
""= no terminator
2= column ordinal
coln= column name
""= no collation
Thus, the bulk insert looks like this:
bulk insert tb
from 'file.img'
with(formatfile='fmt.fmt')
"John Peterson" <j0hnp@.comcast.net> wrote in message
news:OtfVd1TvEHA.908@.TK2MSFTNGP11.phx.gbl...
> (SQL Server 2000, SP3a)
> Hello all!
> Is there any way to use BULK INSERT like TEXTCOPY? I have a series of
files (on disk),
> and I'd like to squirt them in to a table that has an IMAGE column. I
could "shell" out
> to use TEXTCOPY, but was wondering if I could leverage some built-in SQL
construct. BULK
> INSERT looked close, but it also looks like the built-in analogue to BCP.
That is, it
> processes the contents of the file, and I really just want to squirt the
file in to the
> column verbatim.
> Thanks for any help you can provide!
> John Peterson
>|||John,
See this thread for an example:
http://groups.google.com/groups?q=4...C5-7256A4B9870A
Steve Kass
Drew University
John Peterson wrote:
>(SQL Server 2000, SP3a)
>Hello all!
>Is there any way to use BULK INSERT like TEXTCOPY? I have a series of file
s (on disk),
>and I'd like to squirt them in to a table that has an IMAGE column. I coul
d "shell" out
>to use TEXTCOPY, but was wondering if I could leverage some built-in SQL co
nstruct. BULK
>INSERT looked close, but it also looks like the built-in analogue to BCP.
That is, it
>processes the contents of the file, and I really just want to squirt the fi
le in to the
>column verbatim.
>Thanks for any help you can provide!
>John Peterson
>
>|||Thanks oj and Steve! I think that'll do the trick, even if it's a little aw
kward. :-)
BTW: Do you need an *exact* binary file size in the format file, as Steve's
link
suggests? Or will "oversizing" it suffice?
Thanks again!
"John Peterson" <j0hnp@.comcast.net> wrote in message
news:OtfVd1TvEHA.908@.TK2MSFTNGP11.phx.gbl...
> (SQL Server 2000, SP3a)
> Hello all!
> Is there any way to use BULK INSERT like TEXTCOPY? I have a series of fil
es (on disk),
> and I'd like to squirt them in to a table that has an IMAGE column. I cou
ld "shell" out
> to use TEXTCOPY, but was wondering if I could leverage some built-in SQL c
onstruct.
> BULK INSERT looked close, but it also looks like the built-in analogue to
BCP. That is,
> it processes the contents of the file, and I really just want to squirt th
e file in to
> the column verbatim.
> Thanks for any help you can provide!
> John Peterson
>|||John,
It's got to be exact. If you oversize it, you get an unexpected
end-of-file:
Server: Msg 4832, Level 16, State 1, Line 1
Bulk Insert: Unexpected end-of-file (EOF) encountered in data file.
Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'STREAM' reported an error. The provider did not give
any information about the error.
OLE DB error trace [OLE/DB Provider 'STREAM' IRowset::GetNextRows
returned 0x80004005: The provider did not give any information about
the error.].
The statement has been terminated.
SK
John Peterson wrote:
>Thanks oj and Steve! I think that'll do the trick, even if it's a little a
wkward. :-)
>BTW: Do you need an *exact* binary file size in the format file, as Steve'
s link
>suggests? Or will "oversizing" it suffice?
>Thanks again!
>
>"John Peterson" <j0hnp@.comcast.net> wrote in message
>news:OtfVd1TvEHA.908@.TK2MSFTNGP11.phx.gbl...
>
>
>|||Thanks, Steve!
One other option I'm exploring is using a stored procedure with an IMAGE par
ameter. But,
I have very little experiencing in using VBScript (this is going to be calle
d from a Web
page) and ADO Parameter objects for an IMAGE data. I've been searching on t
he Web, and
I've seen a few snippets -- but not a comprehensive example. Do you have an
y
recommendations/links on that route, perchance?
"Steve Kass" <skass@.drew.edu> wrote in message
news:OfadH8WvEHA.2616@.TK2MSFTNGP10.phx.gbl...[vbcol=seagreen]
> John,
> It's got to be exact. If you oversize it, you get an unexpected end-of-f
ile:
> Server: Msg 4832, Level 16, State 1, Line 1
> Bulk Insert: Unexpected end-of-file (EOF) encountered in data file.
> Server: Msg 7399, Level 16, State 1, Line 1
> OLE DB provider 'STREAM' reported an error. The provider did not give any
information
> about the error.
> OLE DB error trace [OLE/DB Provider 'STREAM' IRowset::GetNextRows retu
rned 0x80004005:
> The provider did not give any information about the error.].
> The statement has been terminated.
> SK
> John Peterson wrote:
>|||John,
I haven't done this myself, but you should be able to pass the image
data with a adLongVarBinary parameter.
You might need to create the parameter 1 byte longer than the length of
the data you're storing, according to
http://support.microsoft.com/defaul...kb;en-us;190450
I also saw one suggestion that this meant you have to read back all but
the last byte of the stored image
value when retrieving the data, so you should be watchful:
http://groups.google.com/groups?hl=...
dlongvarbinary
SK
John Peterson wrote:
>Thanks, Steve!
>One other option I'm exploring is using a stored procedure with an IMAGE pa
rameter. But,
>I have very little experiencing in using VBScript (this is going to be call
ed from a Web
>page) and ADO Parameter objects for an IMAGE data. I've been searching on
the Web, and
>I've seen a few snippets -- but not a comprehensive example. Do you have a
ny
>recommendations/links on that route, perchance?
>
>"Steve Kass" <skass@.drew.edu> wrote in message
>news:OfadH8WvEHA.2616@.TK2MSFTNGP10.phx.gbl...
>
>
>|||Great stuff! Thanks again, Steve! :-)
"Steve Kass" <skass@.drew.edu> wrote in message
news:eXQUuyjvEHA.2804@.TK2MSFTNGP14.phx.gbl...[vbcol=seagreen]
> John,
> I haven't done this myself, but you should be able to pass the image data
with a
> adLongVarBinary parameter.
> You might need to create the parameter 1 byte longer than the length of th
e data you're
> storing, according to
> http://support.microsoft.com/defaul...kb;en-us;190450
> I also saw one suggestion that this meant you have to read back all but th
e last byte of
> the stored image
> value when retrieving the data, so you should be watchful:
> http://groups.google.com/groups?hl=...adlongvarbinary
> SK
>
> John Peterson wrote:
>
Saturday, February 25, 2012
Can anyone explain me this please
Can anyone explain me what the persons means by
saying: "multiple files"... how do i do this'
If your database is very large and very busy, multiple
files can be used to increase performance. Here is one
example of how you might use multiple files. Let's say you
have a single table with 10 million rows that is heavily
queried. If the table is in a single file, such as a
single database file, then SQL Server would only use one
thread to perform a read of the rows in the table. But if
the table were divided into three physical files (all part
of the same filegroup), then SQL Server would use three
threads (one per physical file) to read the table, which
potentially could be faster. In addition, if each file
were on its own separate physical disk or disk array, the
performance gain would even be greater.
Thanxs for your patience,
CC
What did you mean by
> But if the table were divided into three physical files (all part
> of the same filegroup) ?
You can place heavily accessed tables and the nonclustered indexes belonging
to those tables on different filegroups. This will improve performance, due
to parallel I/O if the files are located on different physical disks
"C" <anonymous@.discussions.microsoft.com> wrote in message
news:06a801c3ce01$93fcc010$a101280a@.phx.gbl...
> Hi,
> Can anyone explain me what the persons means by
> saying: "multiple files"... how do i do this'
> If your database is very large and very busy, multiple
> files can be used to increase performance. Here is one
> example of how you might use multiple files. Let's say you
> have a single table with 10 million rows that is heavily
> queried. If the table is in a single file, such as a
> single database file, then SQL Server would only use one
> thread to perform a read of the rows in the table. But if
> the table were divided into three physical files (all part
> of the same filegroup), then SQL Server would use three
> threads (one per physical file) to read the table, which
> potentially could be faster. In addition, if each file
> were on its own separate physical disk or disk array, the
> performance gain would even be greater.
> Thanxs for your patience,
> C|||Actually, what your paragraph is talking about is putting several data files
in a single filegroup..
You can use SEM to add more data files to the Primary filegroup.
AFTER you have multiple files in the filegroup, THEN load the data... SQL
Server will stripe the data across all of the data files. and when you do a
query, SQL will automatically use parallel IO Threads ( one for each file)
to get the data..
This can allow better performance for a single user's query....
If all of the files are in a single raid array, the rule of thumb is not
more than 8 files, and not more than one file per hard drive... So if you
are using a 4 drive raid array, create 4 data files...
Wayne Snyder, MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
www.computeredservices.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"C" <anonymous@.discussions.microsoft.com> wrote in message
news:06a801c3ce01$93fcc010$a101280a@.phx.gbl...
> Hi,
> Can anyone explain me what the persons means by
> saying: "multiple files"... how do i do this'
> If your database is very large and very busy, multiple
> files can be used to increase performance. Here is one
> example of how you might use multiple files. Let's say you
> have a single table with 10 million rows that is heavily
> queried. If the table is in a single file, such as a
> single database file, then SQL Server would only use one
> thread to perform a read of the rows in the table. But if
> the table were divided into three physical files (all part
> of the same filegroup), then SQL Server would use three
> threads (one per physical file) to read the table, which
> potentially could be faster. In addition, if each file
> were on its own separate physical disk or disk array, the
> performance gain would even be greater.
> Thanxs for your patience,
> C
Friday, February 24, 2012
Can any one help me with this SQLXML 3.0 SP3 Problem?
application to manipulate xml files and import them into an SQL Server
database.
Every time I run the application, the import fails. The error log
contains the following xml:
<code>
<?xml version="1.0"?>
<Result State="FAILED">
<Error>
<HResult>0x80004005I32</HResult>
<Description><![CDATA[Error connecting to the data
source.]]></Description>
<Source>XML BulkLoad for SQL Server</Source>
<Type>FATAL</Type>
</Error>
</Result State>
</code>
I'm at a complete loss as to what's going on here. Any input would be
greatly appreciated. I've included most of my code for reference. If
anything else is needed, please let me know.
The code that is supposed to be connecting to the database and executing
the bulk transfer is as follows:
<code>
Private Function importToSQL(ByVal importXML As String)
(where importXML = C:\SQL EXCHANGE\IDS\IN\filename.xml)
Dim noErrors As Boolean
Dim connectionString As String = "PROVIDER=SQLOLEDB; Server=(local);
database=database; user id=username; password=password"
Dim errorLog As String = importXML & ".errlog"
Dim dataSchema As String = "C:\SQL EXCHANGE\IDS\IN\IDS XML Importer\IDS
XML Importer.xsd"
Dim bulkLoad As New SQLXMLBULKLOADLib.SQLXMLBulkLoad3
Try
bulkLoad.KeepIdentity = False
bulkLoad.KeepNulls = True
bulkLoad.ErrorLogFile = errorLog
bulkLoad.ConnectionString = connectionString
bulkLoad.Execute(dataSchema, importXML)
Catch ex As Exception
noErrors = False
End Try
End Function
</code>
Lastly, a snippet of the .xsd file that I'm using to show that its
structure:
<code>
<?xml version="1.0" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:sql="urn:schemas-microsoft-com:mapping-schema">
<xsd:element name="File">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="CLAIM" sql:relation="IMPORT_IHS_DENTAL_CLAIMS">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="CLAIM_NUM" type="xsd:string"
sql:field="CLAIM_NUM" />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~
<xsd:element name="_240_TREATMENT_ZIP" type="xsd:string"
sql:field="_240_TREATMENT_ZIP" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</code>
Thanks in advance.
--
Grant Smith
A+, Net+, MCP x 2Try a semicolon after the password.
Rick Sawtell
MCT, MCSD, MCDBA
"Grant Smith - eNVENT Technologies" <grant.smith@.envent-tech.com> wrote in
message news:4Yudf.327077$084.13767@.attbi_s22...
> I'm having a problem with SQLXML. I have written a small VB.NET
> application to manipulate xml files and import them into an SQL Server
> database.
> Every time I run the application, the import fails. The error log
> contains the following xml:
> <code>
> <?xml version="1.0"?>
> <Result State="FAILED">
> <Error>
> <HResult>0x80004005I32</HResult>
> <Description><![CDATA[Error connecting to the data
> source.]]></Description>
> <Source>XML BulkLoad for SQL Server</Source>
> <Type>FATAL</Type>
> </Error>
> </Result State>
> </code>
> I'm at a complete loss as to what's going on here. Any input would be
> greatly appreciated. I've included most of my code for reference. If
> anything else is needed, please let me know.
> The code that is supposed to be connecting to the database and executing
> the bulk transfer is as follows:
> <code>
> Private Function importToSQL(ByVal importXML As String)
> (where importXML = C:\SQL EXCHANGE\IDS\IN\filename.xml)
> Dim noErrors As Boolean
> Dim connectionString As String = "PROVIDER=SQLOLEDB; Server=(local);
> database=database; user id=username; password=password"
> Dim errorLog As String = importXML & ".errlog"
> Dim dataSchema As String = "C:\SQL EXCHANGE\IDS\IN\IDS XML Importer\IDS
> XML Importer.xsd"
> Dim bulkLoad As New SQLXMLBULKLOADLib.SQLXMLBulkLoad3
> Try
> bulkLoad.KeepIdentity = False
> bulkLoad.KeepNulls = True
> bulkLoad.ErrorLogFile = errorLog
> bulkLoad.ConnectionString = connectionString
> bulkLoad.Execute(dataSchema, importXML)
> Catch ex As Exception
> noErrors = False
> End Try
> End Function
> </code>
> Lastly, a snippet of the .xsd file that I'm using to show that its
> structure:
> <code>
> <?xml version="1.0" ?>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:sql="urn:schemas-microsoft-com:mapping-schema">
> <xsd:element name="File">
> <xsd:complexType>
> <xsd:choice maxOccurs="unbounded">
> <xsd:element name="CLAIM" sql:relation="IMPORT_IHS_DENTAL_CLAIMS">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element name="CLAIM_NUM" type="xsd:string"
> sql:field="CLAIM_NUM" />
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~
> <xsd:element name="_240_TREATMENT_ZIP" type="xsd:string"
> sql:field="_240_TREATMENT_ZIP" />
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
> </xsd:choice>
> </xsd:complexType>
> </xsd:element>
> </xsd:schema>
> </code>
> Thanks in advance.
> --
> Grant Smith
> A+, Net+, MCP x 2|||Hi
The error implies that you have not connected correctly to your database.
Make sure that your connection string is correct. Check out the examples at
http://www.perfectxml.com/articles/XML/ImportXMLSQL.asp
John
"Grant Smith - eNVENT Technologies" <grant.smith@.envent-tech.com> wrote in
message news:4Yudf.327077$084.13767@.attbi_s22...
> I'm having a problem with SQLXML. I have written a small VB.NET
> application to manipulate xml files and import them into an SQL Server
> database.
> Every time I run the application, the import fails. The error log contains
> the following xml:
> <code>
> <?xml version="1.0"?>
> <Result State="FAILED">
> <Error>
> <HResult>0x80004005I32</HResult>
> <Description><![CDATA[Error connecting to the data
> source.]]></Description>
> <Source>XML BulkLoad for SQL Server</Source>
> <Type>FATAL</Type>
> </Error>
> </Result State>
> </code>
> I'm at a complete loss as to what's going on here. Any input would be
> greatly appreciated. I've included most of my code for reference. If
> anything else is needed, please let me know.
> The code that is supposed to be connecting to the database and executing
> the bulk transfer is as follows:
> <code>
> Private Function importToSQL(ByVal importXML As String)
> (where importXML = C:\SQL EXCHANGE\IDS\IN\filename.xml)
> Dim noErrors As Boolean
> Dim connectionString As String = "PROVIDER=SQLOLEDB; Server=(local);
> database=database; user id=username; password=password"
> Dim errorLog As String = importXML & ".errlog"
> Dim dataSchema As String = "C:\SQL EXCHANGE\IDS\IN\IDS XML Importer\IDS
> XML Importer.xsd"
> Dim bulkLoad As New SQLXMLBULKLOADLib.SQLXMLBulkLoad3
> Try
> bulkLoad.KeepIdentity = False
> bulkLoad.KeepNulls = True
> bulkLoad.ErrorLogFile = errorLog
> bulkLoad.ConnectionString = connectionString
> bulkLoad.Execute(dataSchema, importXML)
> Catch ex As Exception
> noErrors = False
> End Try
> End Function
> </code>
> Lastly, a snippet of the .xsd file that I'm using to show that its
> structure:
> <code>
> <?xml version="1.0" ?>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:sql="urn:schemas-microsoft-com:mapping-schema">
> <xsd:element name="File">
> <xsd:complexType>
> <xsd:choice maxOccurs="unbounded">
> <xsd:element name="CLAIM" sql:relation="IMPORT_IHS_DENTAL_CLAIMS">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element name="CLAIM_NUM" type="xsd:string" sql:field="CLAIM_NUM" />
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~
> <xsd:element name="_240_TREATMENT_ZIP" type="xsd:string"
> sql:field="_240_TREATMENT_ZIP" />
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
> </xsd:choice>
> </xsd:complexType>
> </xsd:element>
> </xsd:schema>
> </code>
> Thanks in advance.
> --
> Grant Smith
> A+, Net+, MCP x 2|||John Bell wrote:
> Hi
> The error implies that you have not connected correctly to your database.
> Make sure that your connection string is correct. Check out the examples a
t
> http://www.perfectxml.com/articles/XML/ImportXMLSQL.asp
> John
> "Grant Smith - eNVENT Technologies" <grant.smith@.envent-tech.com> wrote in
> message news:4Yudf.327077$084.13767@.attbi_s22...
>
>
>
Thanks for the input John, but I changed my connection string to match
PerfecXML (which is what I started with, i might add) save for making
UID and PWD appropriate for my server, and I still got the same results.
Grant Smith
A+, Net+, MCP x 2
Quality Production Liaison
Hewlett Packard Company
Database Administrator
Renaissance Systems and Services, LLC|||Rick Sawtell wrote:
> Try a semicolon after the password.
> Rick Sawtell
> MCT, MCSD, MCDBA
>
> "Grant Smith - eNVENT Technologies" <grant.smith@.envent-tech.com> wrote in
> message news:4Yudf.327077$084.13767@.attbi_s22...
>
>
>
I added a semicolon as you directed and still got the same results.
Grant Smith
A+, Net+, MCP x 2
Quality Production Liaison
Hewlett Packard Company
Database Administrator
Renaissance Systems and Services, LLC|||Rick Sawtell wrote:
> Try a semicolon after the password.
> Rick Sawtell
> MCT, MCSD, MCDBA
>
> "Grant Smith - eNVENT Technologies" <grant.smith@.envent-tech.com> wrote in
> message news:4Yudf.327077$084.13767@.attbi_s22...
>
>
>
I tried this and got the same results.
Any more ideas?
Grant Smith
A+, Net+, MCP x 2
Quality Production Liaison
Hewlett Packard Company
Database Administrator
Renaissance Systems and Services, LLC|||John Bell wrote:
> Hi
> The error implies that you have not connected correctly to your database.
> Make sure that your connection string is correct. Check out the examples a
t
> http://www.perfectxml.com/articles/XML/ImportXMLSQL.asp
> John
> "Grant Smith - eNVENT Technologies" <grant.smith@.envent-tech.com> wrote in
> message news:4Yudf.327077$084.13767@.attbi_s22...
>
>
>
I changed my connection string to exactly what PerfectXML had as an example
(by the way, I started with this connection string originally) save for
the username and password values and still got the same results.
Anything else you can think of?
Grant Smith
A+, Net+, MCP x 2
Quality Production Liaison
Hewlett Packard Company
Database Administrator
Renaissance Systems and Services, LLC|||Hi
If the connection string
PROVIDER=SQLOLEDB. 1;SERVER=(local);DATABASE=database;UID=u
sername;PWD=passwo
rd;
does not work, then you may want to check conectivity in general
through query analyser.
John
Grant Smith - eNVENT Technologies wrote:
> Rick Sawtell wrote:
> I added a semicolon as you directed and still got the same results.
> --
> Grant Smith
> A+, Net+, MCP x 2
> Quality Production Liaison
> Hewlett Packard Company
> Database Administrator
> Renaissance Systems and Services, LLC
Tuesday, February 14, 2012
Can 98SE read files from NTFS Drives?
drives in a network. Is this true? TIA, Jim.http://groups.google.co.uk/groups?h...news.dfncis.de
Simon|||"Jim Richards" wrote:
> I have been told by a local PC club technician that 98SE cannot read
> NTFS drives in a network. Is this true? TIA, Jim.
In addition to the excellent thread linked to in another message, please
allow me to clarify the situation.
Forgive me if you know all this, but perhaps someone else reading this
thread in the future won't. Also, lest this be seen as OT, I think there
are plenty of people that end up in situations managing SQL Server even
though they've never been trained on things like hardware and OS
operations... So, to make a long story, er, less long:
All (modern) OS's use layers of abstraction. A Windows computer has a
driver to talk to the physical disk drive via the bus it's connected to
(SCSI, ATA/IDE, SATA, etc). A file system driver sits "on top" of that to
organize the disk into a logical view. Without the file system driver, you
have to access the disk by "block": I've seen mainframe programs based
around this and *trust* me, it's ugly :) FAT32, NTFS, ext3, ReiserFS, et al
are file systems that allow you to view a physical disk as directories and
files. Without them, you couldn't load the system library
c:\windows\system32\user32.dll... You'd need to know to read blocks 345-392
to get that DLL (and that's vastly oversimplified).
This often confuses people because Windows allows you to map a drive to a
network share. However, that mapped drive is *not* sending commands
directly to the disk device on the server. The mapped drive is presented by
a driver that talks to the server over a network instead of directly to a
physical drive. Not only is this far better, but it's really the only
option... Can you imagine 100 client computers all trying to physically move
the drive heads around on your server?
Another way to think of it is that network file servers work like SQL
Server: you send a request and you get a response. You don't really care if
the server read your file from a single IDE drive formatted with FAT32, a
7TB RAID 1+0 disk array formatted with NTFS 5, or from a special interface
to thousands of trained orangutans with legal pads (which is how we run our
servers at my company ;).
The problem with Win9x is that there's no NTFS file system driver available
from Microsoft (although it wouldn't surprise me if someone on the Internet
had hacked one together). So Win9x can't talk to a physical drive formatted
with NTFS. But this doesn't matter on the network because the server is in
charge of the NTFS drive.
So, the PC tech is completely wrong. But...
There's a protocol known as iSCSI that allows you send SCSI bus commands
over TCP/IP. It allows you to use a network as the bus to a drive array.
If for some bizarre reason you managed to get a hold of an iSCSI driver for
a Windows 98 computer so that you could access a networked drive array,
you'd need a FAT16 or FAT32 partition on the array since the Win98 computer
would be sending physical commands to the array. But... that's mostly
theoretical: I can't imagine that happening unless your were a masochist,
had tons of cash, and then got drunk and decided to hire some systems
programmers to put together incredibly bizarre systems :)
Craig