Modifying big files

  • Thread starter Thread starter Microsoft
  • Start date Start date
M

Microsoft

I was thinking...

The SQL Server work with big files (like 30Mb or 30Gb) and when i use
"UPDATE..." or "INSERT..." it updates the MDF instantly.
I think it just find the correct place in the file and update the record.
But it doesn't create another file (or create?) after it performs the update
of one especific record.

Well, i want to do it too. :)

How can i do it if I'm using .Net?

Thanks,

David

david[a]siscorp.com.br
 
The SQL Server work with big files (like 30Mb or 30Gb) and when i use
"UPDATE..." or "INSERT..." it updates the MDF instantly.
I think it just find the correct place in the file and update the record.
But it doesn't create another file (or create?) after it performs the update
of one especific record.

Well, i want to do it too. :)


Read "Inside SQL Server 2000". It goes into great depth (hence the name) on
how SQL server works internally.

Amazon:

http://www.amazon.com/exec/obidos/t...pd_ka_1/104-4748908-0909547?v=glance&n=507846


HTH,
Jeremy
 
Jeremy,

Thank you for your reply.

But my interest isn't on how SQL works. My real interest is how can I
modify a file in a specific "address" without use another file.

I would like to know if there is a different way to update a file without
having to create new one.

To be more specific, when you have to update a data into one text file, we
have find out this data, update it and then create a new file with this
modification, killing the original one. I'm pretty sure that SQL Server
doesn't work like that. I think there is a way to update file like SQL
Server does.

Thank you again,

David
 
SQL is not using managed code to do that. In Win32 it's pretty trivial, you
open the file (using CreateFile), call SetFilePointer[Ex] and call WriteFile
to write data at that position, overwriting any existing data.

Jerry
 
Nice!

Then can I do it using .NET?

Maybe using FileStream?

Jerry III said:
SQL is not using managed code to do that. In Win32 it's pretty trivial, you
open the file (using CreateFile), call SetFilePointer[Ex] and call WriteFile
to write data at that position, overwriting any existing data.

Jerry

David said:
Jeremy,

Thank you for your reply.

But my interest isn't on how SQL works. My real interest is how can I
modify a file in a specific "address" without use another file.

I would like to know if there is a different way to update a file without
having to create new one.

To be more specific, when you have to update a data into one text file, we
have find out this data, update it and then create a new file with this
modification, killing the original one. I'm pretty sure that SQL Server
doesn't work like that. I think there is a way to update file like SQL
Server does.

Thank you again,

David

name)
http://www.amazon.com/exec/obidos/tg/detail/-/0735609985/qid=1078325405//ref
=pd_ka_1/104-4748908-0909547?v=glance&n=507846
 
Back
Top