Wednesday, March 28, 2012
Put .PDF file into SQL Database
I want to put all our archive Invoices into SQL Server.
Please let me know the requirment in creating the DB.
How to load the document into the SQL Table?
How to retrieve the document from the SQL Table?
and How to re-load the document into the SQL Table?
I would like to know the different in how to handle it between a thick
client use VB.Net / C#.Net and ASP.NET.Kam
Why not just storing files on filesystem ?
http://www.aspfaq.com/show.asp?id=2149
"Kam" <Kam@.discussions.microsoft.com> wrote in message
news:F365CE62-FEE2-42BA-BFF1-95997D2C6D03@.microsoft.com...
> Every invoice printer from the AS/400 will create a .pdf file into a PC.
> I want to put all our archive Invoices into SQL Server.
> Please let me know the requirment in creating the DB.
> How to load the document into the SQL Table?
> How to retrieve the document from the SQL Table?
> and How to re-load the document into the SQL Table?
> I would like to know the different in how to handle it between a thick
> client use VB.Net / C#.Net and ASP.NET.
>|||The type of application you are describing is called a document management
system, and it is a common pattern. There are scores of examples and sample
applications on the web, so just google on "document management system and
asp.net"
http://www.asptoday.com/Content.aspx?id=2236
Binary files can be stored in a SQL Server columns of type [image].
http://msdn.microsoft.com/library/d...r />
_8orl.asp
Importing the files into SQL Server would be best handled by a DTS / SSIS
package or client side application. It sounds like perhaps this be a
background process rather than an end user managed process. However, if
uploading via the web is a requirement then:
http://msdn2.microsoft.com/en-us/library/ms227669.aspx
"Kam" <Kam@.discussions.microsoft.com> wrote in message
news:F365CE62-FEE2-42BA-BFF1-95997D2C6D03@.microsoft.com...
> Every invoice printer from the AS/400 will create a .pdf file into a PC.
> I want to put all our archive Invoices into SQL Server.
> Please let me know the requirment in creating the DB.
> How to load the document into the SQL Table?
> How to retrieve the document from the SQL Table?
> and How to re-load the document into the SQL Table?
> I would like to know the different in how to handle it between a thick
> client use VB.Net / C#.Net and ASP.NET.
>
Friday, March 23, 2012
Purging, Delete or Archive
Hi All,
I have a database that has grown to over 6 GB in the last week. This database comes with a third party application tool that was implemented in our company over 3 months ago. My team tells me it's a SQL database, and to correct the current situation we'll need to purge the database or archive the records to a different server.If we purge the records will we be able to retrieve it later if needed?Why would I purge and not archive.
Excuse my questions but we don’t have a DBA on broad and I would like to better understand options we are faced with.
Well D, we don't have DBA's on broads here either (HR would frow on that!)... Anyways, the word PURGE means it's gone... now if you archive off to a different server and TEHn purge from your main database, then you have it on the archive database... You sure the row count is high, and it's not a large file because of large autogrowths? that type of thing? Look at teh database and see how large the actual USED space is... If you are using 6GB, maybe it needs to be reviewd as to why it's taking up all those rows? Might just need a shrink... Bruce|||Don't forget to check the log file. Make sure it's backed up on a regular basis if you want the log files, or else check the box for Truncate on Checkpoint. You didn't say how large the file was 3 weeks ago to the 6 GB is is now, but check the autogrowth and the log file.
Thanks,
Angel
|||Is the 6GB really a problem? Unless the problem is as described in the posts above and you are having 'autogrowth' issues this should not be a problem if you have the right hardware and a properly designed application.
I would never purge data unless I was absolutely sure I NEVER EVER needed it again.
WesleyB
Visit my SQL Server weblog @. http://dis4ea.blogspot.com
|||Thank you all for your helpful response.
Yes the 6GB is a problem, and the time frame it took to grow to 6 GB. We are having hardware availability issues right now. We hope to rectify this problem by the end of the year.
If purging the data really boils down to permanently deleting it from the db...I don't think it the way to go. I am not sure if we'll ever need this data in the future.
Thanks,
Devon Brooks
Purging, Delete or Archive
Hi All,
I have a database that has grown to over 6 GB in the last week. This database comes with a third party application tool that was implemented in our company over 3 months ago. My team tells me it's a SQL database, and to correct the current situation we'll need to purge the database or archive the records to a different server.If we purge the records will we be able to retrieve it later if needed?Why would I purge and not archive.
Excuse my questions but we don’t have a DBA on broad and I would like to better understand options we are faced with.
Well D, we don't have DBA's on broads here either (HR would frow on that!)... Anyways, the word PURGE means it's gone... now if you archive off to a different server and TEHn purge from your main database, then you have it on the archive database... You sure the row count is high, and it's not a large file because of large autogrowths? that type of thing? Look at teh database and see how large the actual USED space is... If you are using 6GB, maybe it needs to be reviewd as to why it's taking up all those rows? Might just need a shrink... Bruce|||Don't forget to check the log file. Make sure it's backed up on a regular basis if you want the log files, or else check the box for Truncate on Checkpoint. You didn't say how large the file was 3 weeks ago to the 6 GB is is now, but check the autogrowth and the log file.
Thanks,
Angel
|||Is the 6GB really a problem? Unless the problem is as described in the posts above and you are having 'autogrowth' issues this should not be a problem if you have the right hardware and a properly designed application.
I would never purge data unless I was absolutely sure I NEVER EVER needed it again.
WesleyB
Visit my SQL Server weblog @. http://dis4ea.blogspot.com
|||Thank you all for your helpful response.
Yes the 6GB is a problem, and the time frame it took to grow to 6 GB. We are having hardware availability issues right now. We hope to rectify this problem by the end of the year.
If purging the data really boils down to permanently deleting it from the db...I don't think it the way to go. I am not sure if we'll ever need this data in the future.
Thanks,
Devon Brooks
Purging data from database every 3 months
which in turn of course mean that the data need some datetime column from which you can determine if
it is > 3 months old. Basically, the TSQL script will look something like:
DECLARE @.now datetime
SET @.now = CURRENT_TIMESTAMP
DELETE FROM tbl1 WHERE DATEDIFF(month, dtcol, @.now) > 3
DELETE FROM tbl2 WHERE DATEDIFF(month, dtcol, @.now) > 3
Make sure you check that I get the DATEDIFF right. Also, you might want to protect the delete's
inside a transaction. And if you have relationships between the tables you need to start with the
referencing table before you can delete from the referenced table (unless you have cascading foreign
keys). If you aren't well versed in TSQL, I suggest you get someone who is which can help you with
that TSQL script.
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"c1tr1cks" <anonymous@.discussions.microsoft.com> wrote in message
news:EED1D1C0-4A93-4822-AB09-1CDEBCBA6277@.microsoft.com...
> Every 3 months I need to backup that sql database and archive it off. I only want to keep 3 months
of data in the database and want to know how you can set a backup to run and then remove all the
data older than a specified date. I am guessing you will have to back it all up then run a query to
remove the data I dont want. ANy ideas if this can be done with a simple backup routine ?|||You can see an example here:
http://vyaskn.tripod.com/sql_archive_data.htm
--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
What hardware is your SQL Server running on?
http://vyaskn.tripod.com/poll.htm
"c1tr1cks" <anonymous@.discussions.microsoft.com> wrote in message
news:EED1D1C0-4A93-4822-AB09-1CDEBCBA6277@.microsoft.com...
Every 3 months I need to backup that sql database and archive it off. I only
want to keep 3 months of data in the database and want to know how you can
set a backup to run and then remove all the data older than a specified
date. I am guessing you will have to back it all up then run a query to
remove the data I dont want. ANy ideas if this can be done with a simple
backup routine ?