Showing posts with label working. Show all posts
Showing posts with label working. Show all posts

Thursday, March 29, 2012

Filter double results from query

We are working on an application which aggregates news articles from various sources. The problem is, when querying the database, is that there are a lot of double results because some of the sources get their news from the same press agency. To clarify things a bit here's a link to an example:

http://84.244.146.27/Zoekresultaten.aspx?SearchQuery=Amsterdam

As you can see, there are a lot of the same results. What we want is to filter out the double results irrespective of the source. In other words; when the query encounters the first result, display that and leave out the other same results.

I've tried filtering them out by using DISTINCT on the 'news header' / results, but that does not seem to work. Any ideas on how to get this done?

Any help is greatly appreciated!

Providing the aggregator select is an infrequent action, you can use a CURSOR within it to select just the first record to a buffer table which the page will read.

|||

Thanks Tatworth for your answer! I'm afraid that it sounds a bit like Chinese to me though...

The aggregator is run every couple of minutes and of course it would be best to filter the results in that step, then filtering on querying results. There's a slight problem though with the aggregator script. It's in PHP :( and PHP and MSSQL don't play along that nicely with eachother as far as I have experienced.

Is there a way to filter within the select query?

|||

Yes, as an example:

14-11-2007

10:52

Marokkaanse vaders in actie in Amsterdam-West

BNdestem BNdestem

|||

If your answer is 2005 or Express, and you want the earliest record, this syntax will do it for you:

SELECT *

FROM (

SELECT {the fields from your original query},row_number() OVER (PARTITION BY {the list of key fields} ORDER BY {Your datetime field} ASC) AS TheRank

{the rest of your original query}

) t1

WHERE TheRank=1

Example:

SELECT *FROM (SELECT NewsDate,NewsTitle,NewsLink,row_number()OVER (PARTITIONBY NewsTitleORDER BY NewsDateASC)AS TheRankFROM NewsTable) t1WHERE TheRank=1
|||

Thanks very much Motley! It works like a charm!

Tuesday, March 27, 2012

FiltDump.exe Errors

Hi All
I cannot get Filtdump.exe to run. I have a server where MS SQL FullText
search is working perfectly (PDF, Office, HTML etc.) but when I run
FiltDump.exe on one of the PDFs I the following message:
C:\>temp\Filtdump.exe test.pdf
FILE: test.pdf
load filter search log++++:
Error 0xc0000005 loading IFilter
I copied tquery.dll and dFastlog.dll into the temp folder to get it to
at least run. We have Windowss 2003 Server but SPS is not installed.
Can anyone suggest a solution?
Jack
Jack the fact that it works on most PDFs and other documents indicates a
problem with this doc. Can you open it up in a text editor to see if its
mainly binary or mainly text - most PDFs contain text formating and are
readable in a text editor.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Jack" <cawoodm@.gmail.com> wrote in message
news:1139410975.992268.270530@.f14g2000cwb.googlegr oups.com...
> Hi All
> I cannot get Filtdump.exe to run. I have a server where MS SQL FullText
> search is working perfectly (PDF, Office, HTML etc.) but when I run
> FiltDump.exe on one of the PDFs I the following message:
> C:\>temp\Filtdump.exe test.pdf
> FILE: test.pdf
> load filter search log++++:
> Error 0xc0000005 loading IFilter
> I copied tquery.dll and dFastlog.dll into the temp folder to get it to
> at least run. We have Windowss 2003 Server but SPS is not installed.
> Can anyone suggest a solution?
> Jack
>
|||Hi Hillary
I can't get Filtdump.exe to work on any pdfs - even those which are
happily indexed by MS SQL. I am wondering if I installed filtdump
correctly.
Jack
|||Well Jack, I can get it working on some and not on others - I don't get an
error code though. I understand that some PDFs are largely textual, where
others have mainly binary content in them i.e. gifs, bmps, and jpgs. So
perhaps this is your problem.
FiltDump uses Indexing Services components to work off - perhaps this is
another problem - it does not require Indexing Services to be running, and I
am not even sure if it needs it to be installed.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Jack" <cawoodm@.gmail.com> wrote in message
news:1139581769.858949.149710@.f14g2000cwb.googlegr oups.com...
> Hi Hillary
> I can't get Filtdump.exe to work on any pdfs - even those which are
> happily indexed by MS SQL. I am wondering if I installed filtdump
> correctly.
> Jack
>

Friday, March 23, 2012

Fill a dataset in Visual Studio 2005

this may seem like a real newbie question, but I got no clue how to solve this problem. When I was working in Visual Studio 2003, whatever I wanted to fill a dataset with data, I was using a SqlDataAdapter that I created like this

adapTest.Fill(dsTest);

But now, I cant seem to find the sqldataadapter anywhere, I can just create (on the visual interface of one of my page of my aspx project) dataset, but cant find anywhere a adapter to put an SQL instruction into...maybe theres a new way to do this in Visual Studio 2005 that I dont know about. Im not sure if I was clear enough, but what I want in the end is to be able to use my dataset like that

dsTest.Tables.Rows[0]["a column"].ToString()

by filling the dataset with data like I was able to do in VS2003. Thanks for taking the time to read this.

Hey,

The preferred way now is the DataSource controls, which are great. You could use this by calling the Select method: http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.sqldatasource.select.aspx

Maybe not as graceful; I think you can cast the returned object as a DataView, which could be useful. You may want to use those objects in code-behind.

|||I read about those DataSource controls. It seems all good and all, problem is, it seems I can only use them (at least that's the only way I found), with Data-Bound Controls. But I need to use the data literally in my code behind (like in a "if" or "for" instruction), without having to Bind it to a controls. Like you said, it may be possible to returns a dataview object (from what I can read on the link you gave me, its an object that will be always called Table), but can't seem to find how...Did I miss something? Is there a way to have access to the Data in a DataSource object without having to bind it on a control? Thanks again for taking the time to read this.|||

Hey,

Sure, when you call select, it returns an IEnumerable object, which you can then convert to DataView, if it is indeed a dataview. From that, you can use you if/for logic. I believe it is, but I don't do that alot. You can also code the results in your page, using the SqlConnection and SqlDataAdapter, or Enterprise Library.

sql

Wednesday, March 21, 2012

FileIOPermission

I got my custom assembly working fine until I add writing to a log
file. Then I get a FileIOPermission error.
I have the following code in my policy file:
<PermissionSet
class="NamedPermissionSet"
version="1"
Name="ReportHelperFilePermissionSet"
Description="A special permission set that grants read access to my
currency rates file.">
<IPermission
class="FileIOPermission"
version="1"
All="C:\ReportHelper.log"/>
<IPermission
class="SecurityPermission"
version="1"
Flags="Execution, Assertion"/>
</PermissionSet>
<CodeGroup class="UnionCodeGroup"
version="1"
PermissionSetName="ReportHelperFilePermissionSet"
Name="MyNewCodeGroup"
Description="A special code group for my custom assembly.">
<IMembershipCondition
class="UrlMembershipCondition"
version="1"
Url="D:\Program Files\Microsoft SQL Server\MSSQL\Reporting
Services\ReportServer\bin\ReportHelper.dll"/>
</CodeGroup>
<CodeGroup
class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust"
Name="AWCLibrary">
<IMembershipCondition
class="UrlMembershipCondition"
version="1"
Url="D:\Program Files\Microsoft SQL Server\MSSQL\Reporting
Services\ReportServer\bin\ReportHelper.dll"/>
</CodeGroup>
I write to my log file as follows:
public static void WriteLogFile(String msg)
{
FileIOPermission perm1 = new
FileIOPermission(FileIOPermissionAccess.Write, @."C:\ReportHelper.log");
perm1.Assert();
//try
//{
FileStream fs = new FileStream(@."C:\ReportHelper.log",
FileMode.OpenOrCreate, FileAccess.ReadWrite);
StreamWriter w = new StreamWriter(fs);
w.BaseStream.Seek(0, SeekOrigin.End);
w.Write("{0} {1} ", DateTime.Now.ToLongTimeString(),
DateTime.Now.ToLongDateString());
w.Write(msg + "\r\n");
w.Flush();
w.Close();
}
What am I missing here? Any help would be appreciated.
Thanks!Check this
http://www.c-sharpcorner.com/Code/2005/June/CustomAssemblyinRS.asp
HTH
If still you face the issue, let me know (bkkrishnan [at] hotmail [dot] com)
Thanks
Balaji
Siwy wrote:
>I got my custom assembly working fine until I add writing to a log
>file. Then I get a FileIOPermission error.
>I have the following code in my policy file:
><PermissionSet
> class="NamedPermissionSet"
> version="1"
> Name="ReportHelperFilePermissionSet"
> Description="A special permission set that grants read access to my
>currency rates file.">
> <IPermission
> class="FileIOPermission"
> version="1"
> All="C:\ReportHelper.log"/>
> <IPermission
> class="SecurityPermission"
> version="1"
> Flags="Execution, Assertion"/>
></PermissionSet>
><CodeGroup class="UnionCodeGroup"
> version="1"
> PermissionSetName="ReportHelperFilePermissionSet"
> Name="MyNewCodeGroup"
> Description="A special code group for my custom assembly.">
> <IMembershipCondition
> class="UrlMembershipCondition"
> version="1"
> Url="D:\Program Files\Microsoft SQL Server\MSSQL\Reporting
>Services\ReportServer\bin\ReportHelper.dll"/>
></CodeGroup>
><CodeGroup
> class="UnionCodeGroup"
> version="1"
> PermissionSetName="FullTrust"
> Name="AWCLibrary">
> <IMembershipCondition
> class="UrlMembershipCondition"
> version="1"
> Url="D:\Program Files\Microsoft SQL Server\MSSQL\Reporting
>Services\ReportServer\bin\ReportHelper.dll"/>
></CodeGroup>
>I write to my log file as follows:
>public static void WriteLogFile(String msg)
> {
> FileIOPermission perm1 = new
>FileIOPermission(FileIOPermissionAccess.Write, @."C:\ReportHelper.log");
> perm1.Assert();
> //try
> //{
> FileStream fs = new FileStream(@."C:\ReportHelper.log",
>FileMode.OpenOrCreate, FileAccess.ReadWrite);
> StreamWriter w = new StreamWriter(fs);
> w.BaseStream.Seek(0, SeekOrigin.End);
> w.Write("{0} {1} ", DateTime.Now.ToLongTimeString(),
> DateTime.Now.ToLongDateString());
> w.Write(msg + "\r\n");
> w.Flush();
> w.Close();
> }
>What am I missing here? Any help would be appreciated.
>Thanks!
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server-reporting/200507/1|||Hi Balaji,
I followed the article and it still doesn't work. I added [assembly:
AllowPartiallyTrustedCallers] to my assembly and removed extra
PermissionSet and CodeGroup sections from my policy file (I left the
"FullTrust" one) and I still get FileIOPermission error.
Thanks,
Kris
BALAJI via SQLMonster.com wrote:
> Check this
> http://www.c-sharpcorner.com/Code/2005/June/CustomAssemblyinRS.asp
> HTH
> If still you face the issue, let me know (bkkrishnan [at] hotmail [dot] com)
> Thanks
> Balaji
>
> Siwy wrote:
> >I got my custom assembly working fine until I add writing to a log
> >file. Then I get a FileIOPermission error.
> >
> >I have the following code in my policy file:
> >
> ><PermissionSet
> > class="NamedPermissionSet"
> > version="1"
> > Name="ReportHelperFilePermissionSet"
> > Description="A special permission set that grants read access to my
> >currency rates file.">
> > <IPermission
> > class="FileIOPermission"
> > version="1"
> > All="C:\ReportHelper.log"/>
> > <IPermission
> > class="SecurityPermission"
> > version="1"
> > Flags="Execution, Assertion"/>
> ></PermissionSet>
> >
> ><CodeGroup class="UnionCodeGroup"
> > version="1"
> > PermissionSetName="ReportHelperFilePermissionSet"
> > Name="MyNewCodeGroup"
> > Description="A special code group for my custom assembly.">
> > <IMembershipCondition
> > class="UrlMembershipCondition"
> > version="1"
> > Url="D:\Program Files\Microsoft SQL Server\MSSQL\Reporting
> >Services\ReportServer\bin\ReportHelper.dll"/>
> ></CodeGroup>
> ><CodeGroup
> > class="UnionCodeGroup"
> > version="1"
> > PermissionSetName="FullTrust"
> > Name="AWCLibrary">
> > <IMembershipCondition
> > class="UrlMembershipCondition"
> > version="1"
> > Url="D:\Program Files\Microsoft SQL Server\MSSQL\Reporting
> >Services\ReportServer\bin\ReportHelper.dll"/>
> ></CodeGroup>
> >
> >I write to my log file as follows:
> >
> >public static void WriteLogFile(String msg)
> > {
> > FileIOPermission perm1 = new
> >FileIOPermission(FileIOPermissionAccess.Write, @."C:\ReportHelper.log");
> > perm1.Assert();
> > //try
> > //{
> > FileStream fs = new FileStream(@."C:\ReportHelper.log",
> >FileMode.OpenOrCreate, FileAccess.ReadWrite);
> > StreamWriter w = new StreamWriter(fs);
> > w.BaseStream.Seek(0, SeekOrigin.End);
> > w.Write("{0} {1} ", DateTime.Now.ToLongTimeString(),
> > DateTime.Now.ToLongDateString());
> > w.Write(msg + "\r\n");
> > w.Flush();
> >
> > w.Close();
> > }
> >
> >What am I missing here? Any help would be appreciated.
> >
> >Thanks!
>
> --
> Message posted via SQLMonster.com
> http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server-reporting/200507/1

Wednesday, March 7, 2012

File System Task Error - Process in use

Hi,

In the integration services package i'm working on i connect to an excel database and have two data flows which deal with two work sheets in the excel spreadsheet. The data flows do some transformation and then write the data out to a SQL database (two differnet tables). This is all working great however what i want to do once both data flows are complete is to move the directory which contains the current file that is being looped through. At present there is a foreach loop going through a number of directories. I have tried to implement the File System Task object to move the directory but get the following error:

[File System Task] Error: An error occurred with the following error message: "The process cannot access the file because it is being used by another process.".

I've read a similar post where by the problem was due to not closing the excel connection before doing the File System Task. I cannot seem to find where i would be able to do this.

If anyone has any ideas i'm looking forward to hearing them.

Many thanks in advance,

Grant

i'm not sure what's causing your problem. however, my hunch is that a data flow task is still executing when control is passed to the file system task. you need make sure that both data flow tasks have completed before control is passed to the next task. one way to do this is to place both data flow tasks within a single sequence container, and then link this container to the next task. that way, control won't proceed to the next task until both data flow tasks have completed.

i hope this helps.

|||

Hi Duane,

Thanks for the response. I had the same thought that the task hadn't released the file when it came to the moving of the directory. I have tried the suggestion of using the sequence container but i still get the same result. The move directory task still thinks it is being used by another process.

Any further suggestion would be welcomed. I thinking there must be a way to get round this or i'm sure it could be a common problem.

Many Thanks,

Grant

|||Hi Duane,

Further to my last post. After some debugging i have found that it is the directory itself that seems to be in use by another process. I can remove the contents of the file no proble at all. Does this shed any more light on the matter?

Cheers,

Grant|||Hi,

I have found what i believe to be my problem and can't believe i didn't see it earlier. I'm doing all of my file and directory processing within a foreach loop. Hence when i come to moving the current directory i'm sure the foreach loop is still using the folder as it enumerated value. I need to be able to somehow call the move directory task outwith the loop so that it doesn't have control of the process. Could anyone suggest a way of doing this?

Thanks in advance.

Grant|||

if i understand you correctly, you want both data flows to finish before control proceeds to moving the files. also, you want this process to repeat once for each file that you have. i'm also assuming that you have two seperate directories of files that you want to process.

if my understanding above is correct, then you need to do the following: place two sequence containters inside a foreach loop container. connect an on success constraint from one sequence container to the other. there should be two seperate data flow tasks inside the first sequence container. only when this sequence container succeeds will control flow to the second sequence container. the second sequence container should contain two seperate file system tasks. only when this sequence container succeeds will control flow to the next iteration of the foreach loop container.

i hope this helps.

|||Hi,

I'll clarify what i have set up at present.

There is a root directory in which a number of directories are stored. Within each of these directories are two files (one CSV and one XLS). We can ignore the CSV file just now. I have two data flow tasks, one which extracts transforms and loads data from one worksheet into a SQL table and another which does a similar process but from a different worksheet and to a different SQL table. Upon completion of both these tasks (which are now in a Sequence container) i want to move the directory containing both the files to an archive location. regardless of whether the file system tasks are in a sequence container there is still an error relating to the directory move. It still believes that the process is in use.
I still think that because the foreach loop is looping through the directories looking for each XLS file it is taking a hold on the directory itself and will not release it until the current directory until the next iteration of the loop.

With this thought in mind i thought that i could do something at the beginning of the loop to remove the directory that was referenced in the proevious iteration (possibly set a variable at the end of each iteration). The only problem i encouter when i try this is that because the variable has to be used as a source/destination value i cannot have this as a blank value when starting i get errors when this is attempted. I need to really skip the move directory on the first iteration and add an additional one at the end of the foreach loop.

My other thought is to just copy the directories during the loop and delete them after the loop has completed. I am aware however that using this method i run the risk that if something causes the package to crashh mid way through it might duplicate directories between the processing and archive directories.

Does this make any more sense.

Cheers,

Grant|||I have the problem resolved.

I have added the move directory task to the start of the foreach loop. A script bypasses the task on the first loop as there isn't a previous folder to archive. The archive folder path is assigned to the variable later in the loop. The next iteration the loop then has a folder to move in the variable which works no problem. After the loop is finished one final move task is added to deal with the final processed folder.

The reason it wouldn't allow an empty string as a connection source to begin with was because the "Delay Validation" property was set to false. If this is set to true the problem doesn't exist.

Thanks for all your help on this matter.

Grant

File System Task

hi friends

I PLACED A FILE SYSTEM OBJECT WICH IS USED TO (COPY FILE/MOVE FILE SO ON )

Once copy file working fine second time copy file gives an errors

we need to check the condition if that folder contrain the dest.txt file we dont require to copy a file

other wise we need to copy

so i need a controle for checking a folder contrain the dest.txt file or not

regards

koti

Hi Koti,

You need to check whether the file already there or not. You can use File.Exists("dest.txt")=False. if it returns false then you can proceed with your Copy process.

Atanu

|||

ok but in my desk top contain the check dir exisit or not i have to check

variable contrain this path ok

check_dir = C:\Documents and Settings\Koteswara.Chava\Desktop\check\one.txt

I was written the code here ok then Please

Dim DTSVariables As Variables

If System.IO.File.Exists((CStr(DTSVariables("check_dir").Value))) Then

MsgBox("YES FILE EXIST")

Else

MsgBox("NO FILE NOT EXIST")

End If

PRE COMPILED BINAY SCRIPT NOT EXIST ERROR I AM GETTING BROTHER

REGARDS

KOTI

File System and MSDB folders gone

This is terrible thing to happed at 4:30 pm on Friday!

I was working yesterday on some of deployment packages using file system (by the way, my msdb can not expand )

and just an hour ago I wanted to try some parent child deployment using file system.

but,

The only two folders I see in Integration services are Running Packages and Stored Packages. Nothing under those ones...

I have checked default location for File System (C:\Program Files\Microsoft SQL Server\90\DTS\Packages) and there are three packages there but these do not show in IServices.

And another question, if I execute package by double clicking on .dstx file should that make it show under File System?

thanks

Have you talked to the DBA? Sounds like access permissions, to me.|||

Hi Ljiljana,

1) Answer to Phils question - Yes ? goto (2). No ? Contact your Admin for the Privilleges mentioned by Phil.

2) Open the Services window, Restart your Integration Service Instance. Successful ? goto (3), No ? Check if the Service account has necessary privileges.

3) Log into your SSMS using your Integration Services Instance, You might see List of Packages in your Folder - Yes ? End of the Step, No ? goto 4)

4) Are you running Integration Services in a Cluster Environment (Note that IS is not cluster aware). Yes? Configure your Integration Services as described here.

Reply, if you are still having issues

Thanks

Subhash Subramanyam

|||

Hi and thanks all!

Subhash, direction you gave me with msDTSsrvr.ini.xml helped.

This is an article I came across before when I wanted to resolve issue with msdb not being able to expand.

I wanted to add that my previous question was no so clear as I was able to see File System and MSDB (not expandable) and the Friday afternoon they disappeared.

Now that I think about what I have done was following;

I copied piece of code under Configuration File for a Named Instance of SQL Server from http://msdn2.microsoft.com/en-us/library/ms137789.aspx and added my server info. However, this has not changed anything for me as I forgot to restart SSIS.

Then on Friday mid day I shut down my PC and that is when that file kicked in creating more issues for me.

So I asked my coworker to send me his file and, except for server name where I had my info he had dot (.) the only other difference was following code (two last lines from the above link)

<?xml version="1.0" encoding="utf-8"?>
<DtsServiceConfiguration xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

So I took these lines out, left my server info, restarted SSIS and it worked. All of it, including MSDB which I can expand now.

made me happy...

|||

Sorry, I do not know why part of the post is this bold and large; I was not yellingSmile

Sunday, February 26, 2012

File script exist or not checking

hi frineds i was checked the file exist in a dir or not it's working file

if file not exist i want to create a file and directory with the bellow condition

i was placed the file system object for dir and file it working fine indepenedent but now

we have to club with file check condition and if not exist we have to create how please tell me

If System.IO.File.Exists((CStr(Dts.Variables("ProductBuyListFileLocation").Value) + (CStr(Dts.Variables("ProductBuyListFileName").Value)))) Then

Dts.Variables("FileFound").Value = 1

'MsgBox("FILE FOUND")

Else

Dts.Variables("FileFound").Value = 0

'MsgBox("FILE NOT FOUND")

End If

regards

koti

Cool i got it

koti

File Protection

Hi -
I'm building a VB.NET application using an MSDE database. I'm working on an
install program for the app, and I'm running into an error with the MSDE
install.
I'm installing MSDE by executing the MSDE setup:
setup.exe INSTANCENAME="test601" BLANKSAPWD=1
DATADIR="d:\data\test601\Data\" TARGETDIR="d:\data\test601\"
DISABLENETWORKPROTOCOLS=0 SECURITYMODE=SQL /L*v
"d:\data\test601\MSDE601.log"
The install works without error on my WinXP Pro development machine. But I
get a Windows File Protection error on a 'fresh' WinXP Home computer.
I create the WinXP Home environment by installing WinXP Home from the MSDN
DVDs and then applying all of the Windows Updates from the MS site (except
for SP2; I'll test that one separately). I then install MSDE by running the
above setup, and I get the following Windows File Protection error:
"Files that are required for Windows to run properly have been replaced by
unrecognized versions. To maintain system stability, Windows must restore
the original versions of these files. Insert your Windows XP Home Edition
CD-ROM now."
How can I prevent this error message from appearing? (MSDE appears to have
installed fine, other than displaying this error.) Or, perhaps more
importantly, how can I install MSDE in a way that does not threaten "system
stability?"
Thanks for your help.
- Jeff
A have the some problem.
Your sistem is hacked by a virus.
"Jeff" <jeff_nospam@.eNetPortals.com> wrote in message news:uNrgd.13498$ta5.4810@.newsread3.news.atl.earth link.net...
Hi -
I'm building a VB.NET application using an MSDE database. I'm working on an
install program for the app, and I'm running into an error with the MSDE
install.
I'm installing MSDE by executing the MSDE setup:
setup.exe INSTANCENAME="test601" BLANKSAPWD=1
DATADIR="d:\data\test601\Data\" TARGETDIR="d:\data\test601\"
DISABLENETWORKPROTOCOLS=0 SECURITYMODE=SQL /L*v
"d:\data\test601\MSDE601.log"
The install works without error on my WinXP Pro development machine. But I
get a Windows File Protection error on a 'fresh' WinXP Home computer.
I create the WinXP Home environment by installing WinXP Home from the MSDN
DVDs and then applying all of the Windows Updates from the MS site (except
for SP2; I'll test that one separately). I then install MSDE by running the
above setup, and I get the following Windows File Protection error:
"Files that are required for Windows to run properly have been replaced by
unrecognized versions. To maintain system stability, Windows must restore
the original versions of these files. Insert your Windows XP Home Edition
CD-ROM now."
How can I prevent this error message from appearing? (MSDE appears to have
installed fine, other than displaying this error.) Or, perhaps more
importantly, how can I install MSDE in a way that does not threaten "system
stability?"
Thanks for your help.
- Jeff
|||Thanks for your response -
While it may be true that a virus was at work here, I was able to get a
different cause ("known issue") from MS (see below). Just curious: what
virus did your computer have?
- Jeff
Response from MS:
I found that it turned out to be a known issue in MSDE setup or SP3a Setup
that File Protection will pop-up . The root cause is the protected system
file sqlunirl.dll was not restored to its original, valid version because
the Windows File Protection restoration process was cancelled by user
interaction. However on computers with Windows XP SP1 if the dllcache
folder is missing or the contents of the dllcache are empty, then you might
still get the pop-ups even with sp3a.
First of all, upgrade your Windows XP to the latest MDAC 2.8
Microsoft Data Access Components (MDAC) 2.8
http://www.microsoft.com/downloads/d...fe3-c795-4b7d-
b037-185d0506396c&DisplayLang=en
Secondly, if above doesn't work, the workaround for this issue is
1. First manually run the dahotfix.exe, which will install/copy the correct
copy of SQLUNIRL.DLL (2000.80.728.0) into the dllcache. (I got the
dahotfix.exe from the sqlredis.exe that ships with SQL2KSP3 in the
x86\other folder. Just right click on this sqlredis.exe and extract the exe
to a local folder. This will give you mdac_qfe.exe. Then again, right click
on mdac_qfe.exe and extract the contents of this exe into another local sub
folder. This should give you a dahotfix.exe)
2. Then run the setup, which should complete successfully with no errors.
"news.microsoft.com" <x> wrote in message
news:uqpxmFdzEHA.2716@.TK2MSFTNGP14.phx.gbl...
A have the some problem.
Your sistem is hacked by a virus.
"Jeff" <jeff_nospam@.eNetPortals.com> wrote in message
news:uNrgd.13498$ta5.4810@.newsread3.news.atl.earth link.net...
Hi -
I'm building a VB.NET application using an MSDE database. I'm working on an
install program for the app, and I'm running into an error with the MSDE
install.
I'm installing MSDE by executing the MSDE setup:
setup.exe INSTANCENAME="test601" BLANKSAPWD=1
DATADIR="d:\data\test601\Data\" TARGETDIR="d:\data\test601\"
DISABLENETWORKPROTOCOLS=0 SECURITYMODE=SQL /L*v
"d:\data\test601\MSDE601.log"
The install works without error on my WinXP Pro development machine. But I
get a Windows File Protection error on a 'fresh' WinXP Home computer.
I create the WinXP Home environment by installing WinXP Home from the MSDN
DVDs and then applying all of the Windows Updates from the MS site (except
for SP2; I'll test that one separately). I then install MSDE by running the
above setup, and I get the following Windows File Protection error:
"Files that are required for Windows to run properly have been replaced by
unrecognized versions. To maintain system stability, Windows must restore
the original versions of these files. Insert your Windows XP Home Edition
CD-ROM now."
How can I prevent this error message from appearing? (MSDE appears to have
installed fine, other than displaying this error.) Or, perhaps more
importantly, how can I install MSDE in a way that does not threaten "system
stability?"
Thanks for your help.
- Jeff

Friday, February 24, 2012

File name with sp_xml_preparedocument - Not working ?

Is it legal to give filename to sp_xml_preparedocument

Can i do

DECLARE @.hdoc int DECLARE @.doc varchar(1000) SET @.doc ='C:/XML/myXmlFile.xml' --Create an internal representation of the XML document. EXEC sp_xml_preparedocument @.hdoc OUTPUT, @.doc -- Remove the internal representation. exec sp_xml_removedocument @.hdoc

I know the XML is well formed because when the paste the file in @.doc above it worksI tried doing it and i get the following error: The XML parse error 0xc00ce556 occurred on line number 1, near the XML text "C:\XML_Processing\Test.xml".Msg 6602, Level 16, State 2, Procedure sp_xml_preparedocument, Line 1The error description is 'Invalid at the top level of the document.'.Msg 6607, Level 16, State 3, Procedure sp_xml_removedocument, Line 1sp_xml_removedocument: The value supplied for parameter number 1 is invalid. The XML is :<ROOT>
<Customer CustomerID="VINET" ContactName="Paul Henriot">
<Order CustomerID="VINET" EmployeeID="5" OrderDate="1996-07-04T00:00:00">
<OrderDetail OrderID="10248" ProductID="11" Quantity="12"/>
<OrderDetail OrderID="10248" ProductID="42" Quantity="10"/>
</Order>
</Customer>
<Customer CustomerID="LILAS" ContactName="Carlos Gonzlez">
<Order CustomerID="LILAS" EmployeeID="3" OrderDate="1996-08-16T00:00:00">
<OrderDetail OrderID="10283" ProductID="72" Quantity="3"/>
</Order>
</Customer>
</ROOT>

Hemanshu:

I think the argument to the sp_xml_preparedocument stored procedure is that actual XML text and NOT a file reference. Please give a look to the SP_XML_PREPAREDOCUMENT stored procedure in books online.

You might be able to do something like:

Code Snippet

select * from openrowset( BULK 'C:/XML/myXmlFile.xml' SINGLE_BLOB)

to fetch the data. Give a look to OPENROWSET in books online.

File Manipulation from MS SQL Server

I am working on an application which uses DTS to move data into temporary tables. I would like to be able to rename/relocate the source file in order to maintain a historical reference. The process which creates the source file is not flexible at all. Is there a way to manipulate the file's name and/or relocate the file by using SQL Server.

Thanks in advance!

Daniel
Austin, TexasTry looking into xp_cmdshell stored proc in BOL. This will allow you to use DOS commands from a TSQL script. We had to use this stored proc to rename delimited files we created from a DTS to be exported to a marketing company. Works pretty good.

HTH

DMW|||Hi DMW,

Thank you very much! I will give this a try.

Sincerely,

Daniel
Austin, Texas|||USE Northwind
GO

SET NOCOUNT ON
CREATE TABLE myTable99(RowNum int IDENTITY(1,1), Data varchar(8000))
GO

INSERT INTO myTable99(Data) EXEC master..xp_cmdshell 'Dir C:\*.*'

SELECT * FROM myTable99
GO

SET NOCOUNT OFF
DROP TABLE myTable99
GO|||I use sp_oaxxx with FileSystemObject, because xp_cmdshell will require for a user to have privileges on the target file system.