Wednesday, March 28, 2012
How to save PDF files to SQL Server?
I have PDF files on local hard drive, and want to save them to the table in SQL Server. Can I execute by SQL Server? If yes, how to do that.
Someone said to create a table with IMAGE column, and write PDF files to this table. How about details for this way?
Thanks a lot.
ZYTWhile you can store files inside of SQL Server, I recommend against it. Files are a "complex data type", so you can't sort, index, compare, or do any other practical operations with them. You can however store a UNC name for a file in a database, and there are many parctical things you can do with that.
There are some reasons for considering storing files inside of SQL Server, but they are few and far between and all of the reasons that I know about are kludges to address application design flaws. If you can avoid the headaches associated with storing files inside your database, I'd recommend avoiding it!
-PatP|||Hi, Pat:
Thanks for reply.
I have to save PDF files to SQL Server, and then retreive/dispaly them. Because security issue, the PDF files are not allowed put in web server, so frontend code cannot read them. PDF files are in database server.
Can you offer codes that can write/read PDF to/from SQL Server? Thanks a lot.
ZYT
Wednesday, March 21, 2012
How to run a query file
400,000 lines worth of insert into statements and is so big i cannot
load in into management studio. How can I run this?On Wed, 31 Oct 2007 17:02:36 -0700, "mitchman10@.gmail.com"
<mitchman10@.gmail.comwrote:
Quote:
Originally Posted by
>I have a query file, test.sql, in the root of my C drive. It is
>400,000 lines worth of insert into statements and is so big i cannot
>load in into management studio. How can I run this?
Add a line with nothing but a GO every, oh say after every 100 INSERT
commands. Then you could TRY to execute the file using the command
line utilities OSQL or SQLCMD. I'm not sure if they will choke on a
file that size as I've never had reason to test them in that way.
Roy Harvey
Beacon Falls, CT|||Roy Harvey (SQL Server MVP) wrote:
Quote:
Originally Posted by
On Wed, 31 Oct 2007 17:02:36 -0700, "mitchman10@.gmail.com"
<mitchman10@.gmail.comwrote:
>
Quote:
Originally Posted by
>I have a query file, test.sql, in the root of my C drive. It is
>400,000 lines worth of insert into statements and is so big i cannot
>load in into management studio. How can I run this?
>
Add a line with nothing but a GO every, oh say after every 100 INSERT
commands. Then you could TRY to execute the file using the command
line utilities OSQL or SQLCMD. I'm not sure if they will choke on a
file that size as I've never had reason to test them in that way.
Failing that, split it up into multiple files (by whatever means you
like) and execute them individually.|||On Wed, 31 Oct 2007 18:38:12 -0700, Ed Murphy <emurphy42@.socal.rr.com>
wrote:
Quote:
Originally Posted by
>Roy Harvey (SQL Server MVP) wrote:
>
Quote:
Originally Posted by
>On Wed, 31 Oct 2007 17:02:36 -0700, "mitchman10@.gmail.com"
><mitchman10@.gmail.comwrote:
>>
Quote:
Originally Posted by
>>I have a query file, test.sql, in the root of my C drive. It is
>>400,000 lines worth of insert into statements and is so big i cannot
>>load in into management studio. How can I run this?
>>
>Add a line with nothing but a GO every, oh say after every 100 INSERT
>commands. Then you could TRY to execute the file using the command
>line utilities OSQL or SQLCMD. I'm not sure if they will choke on a
>file that size as I've never had reason to test them in that way.
>
>Failing that, split it up into multiple files (by whatever means you
>like) and execute them individually.
Which might be no more work than adding the GO lines.
Roy Harvey
Beacon Falls, CT