Showing posts with label developed. Show all posts
Showing posts with label developed. Show all posts

Friday, March 30, 2012

reading a text file as it is written

A remote office developed a PC-based app that writes its data to a text
file. We want to maintain this data at the main office, and in SQL Server,
due to the significance of the data. A typical day's file may have a couple
hundred records, written over an eight hour shift. Rather than changing the
application to connect to our SQL Server, and worrying about network
connectivity and impact on productivity, is there a reasonable means to have
SQL Server detect when this text file is updated, and add the most current
record(s) to our SQL Server table? Please also reply to my email address,
gregstigers@.spamcop.net. Thanks.
Greg Stigers, MCSA
remember to vote for the answers you like
NT has file change notifications. You can write some C# to receive these
notifications and then kick off the script which updates the database.
Check out System.IO.FileSystemWatcher
(http://msdn.microsoft.com/library/de...classtopic.asp)
However, reading the file while it is still open and being written to is
tricky... it actually depends on how the application doing the writing
opened the file. It can specify whether it wants to allow people to read it
while it is being written. If it said that it doesn't want to share with
anybody, then there isn't much you can do other than change that
application.
John Gallardo
SQL Server Engine
Microsoft Corp
[This posting is provided "AS IS" with no warranties, and confers no
rights.]
"Greg Stigers, MCSA" <gregstigers+wmsn@.spamcop.net> wrote in message
news:Ot6Ibr0$EHA.608@.TK2MSFTNGP15.phx.gbl...
>A remote office developed a PC-based app that writes its data to a text
>file. We want to maintain this data at the main office, and in SQL Server,
>due to the significance of the data. A typical day's file may have a couple
>hundred records, written over an eight hour shift. Rather than changing the
>application to connect to our SQL Server, and worrying about network
>connectivity and impact on productivity, is there a reasonable means to
>have SQL Server detect when this text file is updated, and add the most
>current record(s) to our SQL Server table? Please also reply to my email
>address, gregstigers@.spamcop.net. Thanks.
> --
> Greg Stigers, MCSA
> remember to vote for the answers you like
>

reading a text file as it is written

A remote office developed a PC-based app that writes its data to a text
file. We want to maintain this data at the main office, and in SQL Server,
due to the significance of the data. A typical day's file may have a couple
hundred records, written over an eight hour shift. Rather than changing the
application to connect to our SQL Server, and worrying about network
connectivity and impact on productivity, is there a reasonable means to have
SQL Server detect when this text file is updated, and add the most current
record(s) to our SQL Server table? Please also reply to my email address,
gregstigers@.spamcop.net. Thanks.
--
Greg Stigers, MCSA
remember to vote for the answers you likeNT has file change notifications. You can write some C# to receive these
notifications and then kick off the script which updates the database.
Check out System.IO.FileSystemWatcher
(http://msdn.microsoft.com/library/d...rclasstopic.asp)
However, reading the file while it is still open and being written to is
tricky... it actually depends on how the application doing the writing
opened the file. It can specify whether it wants to allow people to read it
while it is being written. If it said that it doesn't want to share with
anybody, then there isn't much you can do other than change that
application.
John Gallardo
SQL Server Engine
Microsoft Corp
[This posting is provided "AS IS" with no warranties, and confers no
rights.]
"Greg Stigers, MCSA" <gregstigers+wmsn@.spamcop.net> wrote in message
news:Ot6Ibr0$EHA.608@.TK2MSFTNGP15.phx.gbl...
>A remote office developed a PC-based app that writes its data to a text
>file. We want to maintain this data at the main office, and in SQL Server,
>due to the significance of the data. A typical day's file may have a couple
>hundred records, written over an eight hour shift. Rather than changing the
>application to connect to our SQL Server, and worrying about network
>connectivity and impact on productivity, is there a reasonable means to
>have SQL Server detect when this text file is updated, and add the most
>current record(s) to our SQL Server table? Please also reply to my email
>address, gregstigers@.spamcop.net. Thanks.
> --
> Greg Stigers, MCSA
> remember to vote for the answers you like
>sql

Saturday, February 25, 2012

RDA problem with SQL Server 2005

My company just converted to SQL Server 2005. I have a pocket PC application, developed with Visual Studio 2003, that is now giving me an RDA problem.

Two tables push fine but the third gives me the error:

"ERR: Push for Table Events: System.Data.SqlServerCe.SqlCeError: The OLE DB data type information in the SQL Server CE columns does not match the information in the SQL Server columns for the RDA table. [Client type, Server type,,Table name,,]"

This is despite dropping all the tables and doing an RDA pull from the database. I don't see anything different on this third table than the other two.

Any suggestions would be appreicaed.

Correct error handling should tell you which data type are in conflict from the error parameters collection, see http://msdn2.microsoft.com/en-us/library/ms174079.aspx|||

My error parameters are as follows:

Error Paramaters

(0)=""

(1)=""

(2)=""

NumericError Parameters

(0) = 0

(1) = 0

(2) = 0

Can anyone help me understand if this is of help!

|||This is obviously not very helpful at all! Could you try to make a "Create table" script of the problematic table, so we can see how it is defined.|||

I'm not sure what you mean by this script, but here is my table definition out of Sql Server 2005:

Event Number(PK, varchar(13), not null)

TransfectionNumber (FK, varchar(13), not null)

type (nvarchar(1), not null)

HHDeleteDate(smalldatetime, null)

Note(nvarchar(255), null)

Keys

PK_Events

FK_Events_Transfections

I pull this table, and all the others, using RDA so the definition should be coming over fine.

I use similar column definitions on other tables without problems

Thanks,

Ron

|||

With some further testing, it's possible my problem is occuring because of the name "type" in the table. Is there a way to change the name in the SQL CE database easily. Otherwise, I'll need to reenter data captured over the last week.

Ron

|||

That sounds like it, Ron. '

SQL CE's SQL syntax does not allow you to rename a column.
You must save the column data, drop the column, add the new column, and restore the old data in the new column.

Some of the tools from www.primeworks-mobile.com will also be able to help you.