SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Store a file & Retrive it in Sql Server


Store a file & Retrive it in Sql Server

Author
Message
Vimal Lohani
Vimal Lohani
SSChasing Mays
SSChasing Mays (660 reputation)SSChasing Mays (660 reputation)SSChasing Mays (660 reputation)SSChasing Mays (660 reputation)SSChasing Mays (660 reputation)SSChasing Mays (660 reputation)SSChasing Mays (660 reputation)SSChasing Mays (660 reputation)

Group: General Forum Members
Points: 660 Visits: 659
Comments posted to this topic are about the item Store a file & Retrive it in Sql Server

Vimal Lohani
SQL DBA | MCP (70-461,70-462)

==============================
The greatest barrier to success is the fear of failure
** Success is a journey not a destination
**

Think before you print, SAVE TREES, Protect Mother Nature
programmertripatsingh
programmertripatsingh
Grasshopper
Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)

Group: General Forum Members
Points: 16 Visits: 12
Sir
I am trying to use your script but i found.....
this error......

Msg 102, Level 15, State 1, Line 12
Incorrect syntax near 'show advanced options'.
Msg 15123, Level 16, State 1, Procedure sp_configure, Line 51
The configuration option 'Ole Automation Procedures' does not exist, or it may be an advanced option.
Msg 102, Level 15, State 1, Line 41
Incorrect syntax near 'sp_configure'.
Configuration option 'show advanced options' changed from 0 to 0. Run the RECONFIGURE statement to install.
Vimal Lohani
Vimal Lohani
SSChasing Mays
SSChasing Mays (660 reputation)SSChasing Mays (660 reputation)SSChasing Mays (660 reputation)SSChasing Mays (660 reputation)SSChasing Mays (660 reputation)SSChasing Mays (660 reputation)SSChasing Mays (660 reputation)SSChasing Mays (660 reputation)

Group: General Forum Members
Points: 660 Visits: 659
--Configure advance options
sp_configure 'show advanced options', 1;
go
reconfigure;
go
sp_configure 'Ole Automation Procedures', 1;
go
reconfigure;
go



execute above code first. Then use this script, modify the script according to need like path. remove above code and below code

sp_configure 'Ole Automation Procedures', 0;
go
reconfigure;
go
sp_configure 'show advanced options', 0;
go
reconfigure;
go



Vimal Lohani
SQL DBA | MCP (70-461,70-462)

==============================
The greatest barrier to success is the fear of failure
** Success is a journey not a destination
**

Think before you print, SAVE TREES, Protect Mother Nature
Dan Bragg
Dan Bragg
SSC Journeyman
SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)

Group: General Forum Members
Points: 77 Visits: 73
Does the file's source have to be on the server where SQL Server is installed? or, can this retrieve a file from a remote location, like a user's local computer accessed through an IIS web session?
Vimal Lohani
Vimal Lohani
SSChasing Mays
SSChasing Mays (660 reputation)SSChasing Mays (660 reputation)SSChasing Mays (660 reputation)SSChasing Mays (660 reputation)SSChasing Mays (660 reputation)SSChasing Mays (660 reputation)SSChasing Mays (660 reputation)SSChasing Mays (660 reputation)

Group: General Forum Members
Points: 660 Visits: 659
It could be any where, but both place should be accessible by sql server account. It will work on a network path too or a remote location.

Vimal Lohani
SQL DBA | MCP (70-461,70-462)

==============================
The greatest barrier to success is the fear of failure
** Success is a journey not a destination
**

Think before you print, SAVE TREES, Protect Mother Nature
Iwas Bornready
Iwas Bornready
One Orange Chip
One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)

Group: General Forum Members
Points: 25226 Visits: 885
Thanks for the script. I need to look at it closer before trying it.
vesa.juvonen
vesa.juvonen
SSC Veteran
SSC Veteran (204 reputation)SSC Veteran (204 reputation)SSC Veteran (204 reputation)SSC Veteran (204 reputation)SSC Veteran (204 reputation)SSC Veteran (204 reputation)SSC Veteran (204 reputation)SSC Veteran (204 reputation)

Group: General Forum Members
Points: 204 Visits: 145
sp_configure 'Ole Automation Procedures', 0;
go
reconfigure;
go
sp_configure 'show advanced options', 0;
go
reconfigure;
go


This kind of feature disabling is dangerous, if you have other functionality on the server that relies on that,
those will stop working.
I would add code to check the configuration status first and at the end
restore status whatever it was.
trimjib
trimjib
SSC Journeyman
SSC Journeyman (75 reputation)SSC Journeyman (75 reputation)SSC Journeyman (75 reputation)SSC Journeyman (75 reputation)SSC Journeyman (75 reputation)SSC Journeyman (75 reputation)SSC Journeyman (75 reputation)SSC Journeyman (75 reputation)

Group: General Forum Members
Points: 75 Visits: 316
Great code but difficult to implement with security concerns.

If available to you: Polybase (SQL 2016) or FileTable(SQL 2012)

I have not yet the pleasure of using Polybase, but have implemented a FileTable production system currently with 20,000 folders and 100,000 files.

FileTable: IMO, far more functionality with more or less the same effort. Think of FileTable as integrating Windows Explorer within SQL. Security is integrated. SQL sees file events as triggers.

Some resources
http://www.sqlservercentral.com/blogs/basits-sql-server-tips/2012/06/24/using-sql-server-2012-filetables/

https://www.simple-talk.com/sql/database-administration/full-text-searches-on-documents-in-filetables/
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search