Stored procedure to Insert any type of file in to sql server from the path ?

Hi,
I have a table "FileMGT" and storing files in to disks. 
FileMGT Columns :
FileName
FilePath
 020324.doc
f:\cfs\Claims Document
 5013.tif
f:\Addendums
 2790.msg
t:\Treatycfs
Now I would like to store all files from above table in to sql sever by adding content column ( VARBINARY ) datatype.
Please help me do solve this.
Thank you.

Why do you want to store files in SQL Server? If your version is SQL Server 2012, then you can try with FILETable.
Please refer the below link for the same
http://technet.microsoft.com/en-us/library/ff929144.aspx
The FileTable feature brings support for the Windows file namespace and compatibility with Windows applications to the
file data stored in SQL Server. FileTable lets an application integrate its storage and data management components, and provides integrated SQL Server services -
including full-text search and semantic search - over unstructured data and metadata.

Similar Messages

  • How to create stored procedure for insert update and delete operations with input output paramters?

    I  have the follwing table is called master table contain the follwing fields,
    So here i need to create  three Stored procedures 
    1.Insert operations(1 o/p paramter,and  14 input paramters)              - uspInsert
    2.Update operations(1 o/p paramter,and  14 input paramters)          - uspUpdate
    3.Delete Operations(1 o/p paramter,and  14 input paramters)          
     - uspdelte
    The following is the table ,so using this to make the three sp's ,Here we will use Exception machanism also.
    Location 
    Client Name
    Owner 
    ConfigItemID
    ConfigItemName
    DeploymentID
    IncidentID
    Package Name
    Scope 
    Stage
    Type 
    Start Date
    End Date
    Accountable 
    Comments
    So can u pls help me out for this ,bcz i knew to stored procedure's creation.

    I  have the follwing table is called master table contain the follwing fields,
    So here i need to create  three Stored procedures 
    1.Insert operations(1 o/p paramter,and  14 input paramters)              - uspInsert
    2.Update operations(1 o/p paramter,and  14 input paramters)          - uspUpdate
    3.Delete Operations(1 o/p paramter,and  14 input paramters)            - uspdelte
    The following is the table ,so using this to make the three sp's ,Here we will use Exception machanism also.
    Location 
    Client Name
    Owner 
    ConfigItemID
    ConfigItemName
    DeploymentID
    IncidentID
    Package Name
    Scope 
    Stage
    Type 
    Start Date
    End Date
    Accountable 
    Comments
    So can u pls help me out for this ,bcz i knew to stored procedure's creation.
    Why you have to pass 14 parameters for DELETE and UPDATE? Do you have any Primary Key?  If you do NOT have primary key in your table then in case you have duplicate information, SQL will update both or delete them together. You need to provide DDL of
    you table. What are the data types of fields?
    Best Wishes, Arbi; Please vote if you find this posting was helpful or Mark it as answered.

  • Stored Procedures - Basic Insert?

    Trying to do a basic INSERT Store Procedure that isn't
    working.
    Created the SP in the database and went to Dreamweaver.
    -----------------My Stored Procedure-----------------
    CREATE PROCEDURE dbo.spAddShippingAddress (@OneA varchar(50))
    AS
    INSERT INTO aXOne (OneA)
    VALUES (@OneA)
    GO
    -----------------My Stored Procedure-----------------
    aXOne is the Table and OneA is the Column
    So which do I use in Dreamweaver, "Stored Procedure" or
    "INSERT"?
    Also, since this is an insert, I have a form page that
    submits to the
    page with the Command on it.
    Nothing seems to work. Any ideas welcome. Thanks

    Procedure is close. It will work as-is, but get in the habit
    of adding
    certain commands to every procedure; these will prevent
    issues in certain
    situations. Also, do not use "sp" as a prefix - that's
    reserved for system
    procedures and changes the way SQL Server looks up the
    procedure name. The
    "web-friendly" version:
    CREATE PROCEDURE [dbo].[AddShippingAddress]
    @OneA VARCHAR(50)
    AS
    BEGIN
    SET NOCOUNT ON;
    INSERT INTO dbo.aXOne(OneA)
    VALUES (@OneA)
    END
    GO
    As for the rest of it:
    - Use the "stored procedure" option in Dreamweaver. The
    "insert" option is
    what you would use if you were executing the actual insert
    query without the
    procedure as a wrapper (keep the procedure - it's just nicer
    for everyone in
    the end).
    - There's nothing wrong with the form submitting to the page
    with the
    command on it. Make sure you've got the parameters set up
    properly (form
    method="post", then Request.Form; method="get" then
    Request.QueryString) and
    double-check your data types.
    By "doesn't work", please be specific - is there an error, or
    does the page
    execute normally while not inserting the record or inserting
    a blank record,
    or...
    "Lee" <[email protected]> wrote in message
    news:eqvt5u$a0l$[email protected]..
    > Trying to do a basic INSERT Store Procedure that isn't
    working.
    >
    > Created the SP in the database and went to Dreamweaver.
    > -----------------My Stored Procedure-----------------
    > CREATE PROCEDURE dbo.spAddShippingAddress (@OneA
    varchar(50))
    > AS
    > INSERT INTO aXOne (OneA)
    > VALUES (@OneA)
    > GO
    >
    > -----------------My Stored Procedure-----------------
    >
    > aXOne is the Table and OneA is the Column
    >
    > So which do I use in Dreamweaver, "Stored Procedure" or
    "INSERT"?
    >
    > Also, since this is an insert, I have a form page that
    submits to the page
    > with the Command on it.
    >
    > Nothing seems to work. Any ideas welcome. Thanks

  • Whenever I open a file of any type, that file will open, as well as multiple other files I do not wish to open.  How do I prevent this from happening.

    Whenever I try to open a file of any type, that file will open, as well as several other files I do not wish to open.  How do I prevent this from happening?

    Dealing With The Resume Feature of Lion
    Managing Mac OS X Lion's application resume feature.
    If you shutdown your computer you should get a dialog asking if you want applications to resume on the next startup. Simply uncheck the box to prevent that from occurring. Open General preferences and uncheck the option to Restore windows when quitting and re-opening apps. You can also install a third-party utility to control resume features on individual applications: RestoreMeNot or Application State Cleaner.
    It is possible to completely stop the Resume feature although I'm unconvinced that it is that annoying. Nevertheless see the following:
    If you have not yet done so you must first make your /Home/Library/ folder visible. Open the Terminal application in the Utilities folder. At the prompt paste the following command line:
    chflags nohidden ~/Library
    Press RETURN. Quit the Terminal application.
    In the Finder navigate to the /Home/Library/Saved Application State/ folder. Delete the contents of the folder. Back up to the /Home/Library/ folder. Select the Saved Application State folder. Press COMMAND-I to open the Get Info window. In the Sharing and Permissions panel at the bottom click on the lock icon and authenticate. Set each of the listed entries to Read Only. Close the Get Info window.
    Quit all open programs except the Finder (this is very important.) Next, navigate to the /Home/Library/Preferences/ByHost/ folder. Look for a .plist file with "com.apple.loginwindow." in the file name followed by some numbers in hexadecimal. Select the file. Press COMMAND-I to open the Get Info window and in the Sharing and Permissions panel click on the lock icon and authenticate. Set each of the listed entries to Read Only. Close the Get Info window. If you also find a file with the same filename but with a last extension of ".lockfile," then you should delete it.
    The above should eliminate the Resume feature system-wide. Note that any future system updates or upgrades will likely undo these changes. You will then need to repeat this procedure assuming there are no major changes in OS X related to it.

  • Issue using SQL stored procedure to insert/update

    With help I finally managed to execute the stored procedure to insert/ update the sql database with the below stored procedure
    ALTER PROCEDURE [dbo].[uspInsertorUpdate]
    @dp char(32),
    @dv char(32),
    @e_num char(12),
    @mail varchar(50),
    @emerg char(32),
    @opt1 char(16),
    @stat char(20),
    @e_id char(35),
    @e_tit varchar(64),
    @e_date datetime
    AS
    BEGIN
    SET NOCOUNT ON;
    IF EXISTS (SELECT 1 FROM [dbo].[sampleemployee] WHERE e_id= @e_id)
    BEGIN
    UPDATE [dbo].[sampleemployee]
    SET dp = @dp,
    dv = @dv,
    e_num = @e_num,
    mail = @mail,
    emerg = @emerg,
    opt1 = @opt1,
    stat = @stat,
    e_tit = @e_tit,
    e_date = @e_date
    WHERE e_id = @e_id
    END
    ELSE
    BEGIN
    INSERT INTO [dbo].[sampleemployee]( dp, dv, e_num, mail, emerg, opt1, stat, e_id, e_tit, e_date)
    VALUES ( @dp, @dv, @e_num, @mail, @emerg, @opt1, @stat, @e_id, @e_tit, @e_date );
    END
    END;
    But the issue here is it just insert only one row and update that row only, even if there are some no.of rows need to be inserted . Not sure why

    Hi Sid_siv,
    To pass a table value to stored procedure, you can refer to the sample query below.
    create type FileDetailsType as table
    FileName varchar(50),
    CreatedDate varchar(50),
    Size decimal(18,0)
    create procedure InsertFileDetails
    @FileDetails FileDetailsType readonly
    as
    insert into
    FileDetails (FileName, CreatedDate, Size)
    select FileName, CreatedDate, Size
    from
    @FileDetails;
    Reference
    http://www.codeproject.com/Articles/22392/SQL-Server-Table-Valued-Parameters
    http://forum.codecall.net/topic/75547-sql-server-2008-passing-table-parameter-to-stored-procedure/
    Regards,
    Charlie Liao
    TechNet Community Support

  • I am trying to upload a file to an accounting website for work. It will not allow me to select any type of file, they are all greyed out.

    I am trying to upload a file to an accounting website for work. My computer will not allow me to select any type of file, they are all greyed out.

    Try using a different browser. If it works, then the problem is most likely Safari. If the other browser doesn't work, perhaps it is the web site.
    Firefox

  • Excel or Any type of file upload in WebDynpro ABAP

    Hi All,
    I need to upload two files in my requirement, where one file is always going to be an excel sheet and another file could be of any type of file.
    I am using below code for cracking the same but it is not behaving the expected way. It is working fine for TXT, CSV and PDF file but not for XLS files.
      DATA: lc_file TYPE string.
    get element via lead selection
      lo_el_context = wd_context->get_element(  ).
    get single attribute
      lo_el_context->get_attribute(
    EXPORTING
          name =  `FILE_CONTENT`
    IMPORTING
          value = lv_file_content ).
      CALL FUNCTION 'ECATT_CONV_XSTRING_TO_STRING'
        EXPORTING
          im_xstring  = lv_file_content
         im_encoding = 'UTF-8'
        IMPORTING
          ex_string   = lc_file.
    I would appreciate if any one could suggest me some other way to achieve the desired functionality.
    Regds,
    Ashish

    Hi,
    Please try to use the UI element "Office Control" of a web dynpro view.
    For more details, refer to the web dynpro component: IOS_TEST_HELLOWORLD_MS.
    Best regards,
    Shalini.

  • How can I attach any type of file in forms runtime

    Hi Friends,
    I need some help from any one of you.
    Is there any possibility to attach any type of file in forms runtime?
    If there is, how can. Please let me know the code.
    Thanks

    I think that you are going to have to explain what you want to do more clearly...

  • While downlaoding any type of file instead of showing the file size 'unknown time remaining' is showing?

    While downlaoding any type of file instead of showing the file size 'unknown time remaining' is showing? Please suggest solution to these problems?

    I followed ALL the Above suggestions to NO AVAIL!
    When I start a download, if I then Click PAUSE, it WILL NOT CANCEL & IT WILL NOT RESUME, just sits there stating "unknown time remaining"
    and I CAN'T GET RID OF IT!
    It would seem that Something Changed with the latest Firefox Beta Update that is causing this Anomalie.. Please FIX ASAP as I find this Very Annoying.
    With ANY Download in Limbo the Firefox Taskbar Icon displays a Partial Download Progress THAT NEVER CHANGES and I can not tell what Other Downloads are doing - It also Warns me that X-Number of Downloads are Still Pending when I go to Close Firefox, but as I stated, these Downloads are DOING NOTHING & CAN'T BE REMOVED!
    HELP! - BJ

  • Stored procedure to insert/update data ?

    Hi,
    i have a stored procedure which checks for a specified user and a specified timespan (from - to) its allocations on tasks. The timespan is cut into 30-minute fragments by the SP.
    Very abstract model
    TASK (zero to many) REQUIRED_RESOURCE (zero to many) ALLOCATED_USERThe stored procedure returns a ref cursor with the following columns. The TASK_ID can be null which means there is no allocation between that START_TIME and STOP_TIME. Otherwise the user is allocated on that specific task. Because the data is cut into 30-minute fragments, STOP_TIME is always 30 minutes after START_TIME.
    START_TIME, STOP_TIME, USER_ID, TASK_IDAll good so far.
    I would like to store the data returned by the SP in a table. This allows me for more flexible use of the data. I'm thinking of storing the data as follows (STOP_TIME isn't really needed for storing...):
    START_TIME   (pk)
    USER_ID        (pk)
    TASK_ID       (null)**How can I somehow 'process' the ref-cursor returned by the SP, so that data in my new table is inserted if the START_TIME + USER_ID combination doesn't exist yet or updated if it already exists?**
    Thanks for thinking along!
    This is the SP for reference (TRUNC30 is a function that Truncates a DateTime value to the nearest 30-minute part):
    create or replace
    PROCEDURE REPORT_PLAN_AV_USER
    from_dt IN date,
    to_dt IN date,
    sysur_key IN number,
    v_reservations OUT INTRANET_PKG.CURSOR_TYPE
    IS
    BEGIN
    OPEN v_reservations FOR
      with 
          MONTHS as (select FROM_DT + ((ROWNUM-1) / (24*2)) as DT from DUAL connect by ROWNUM <= ((TO_DT - FROM_DT) * 24*2) + 1),
          TIMES as (select DT as START_TIME,(DT + 1/48) as STOP_TIME from MONTHS where TO_NUMBER(TO_CHAR(DT,'HH24')) between 8 and 15 and TO_NUMBER(TO_CHAR(DT,'D')) not in (1,7))
      select
        TIMES.START_TIME,
        TIMES.STOP_TIME,
        T.TASK_ID,
        sysur_key USER_ID,
      from
        TIMES
        left outer join (ALLOCATED_USER u INNER JOIN REQUIRED_RESOURCE r ON u.AU_ID = r.RR_ID INNER JOIN TASK t ON r.TASK_ID = t.TASK_ID)
          ON u.USER_ID = sysur_key AND t.PLAN_TYPE = 3 AND TIMES.start_time >= TRUNC30(t.START_DATE) AND TIMES.start_time < TRUNC30(t.FINISH_DATE)
      where u.USER_ID is null OR u.USER_ID = sysur_key
      order by START_TIME ASC;
    END;

    Hi,
    user574699 wrote:
    So I should MERGE ON (start_time AND user_id) if i'm correct?Right: the ON condition will be a compound condition; both the time and the user_id have to be the same if the rows match.
    Oh, and is is possible to 'encapsulate' the MERGE statement in the SP? Or should I write another SP that selects from the output cursor as input for the MERGE statement?There's no need for a cursor or a second procedure.
    If the query you posted is producing what you want, just put it in the USING clause as it is, except that you won't need an ORDER BY clause.

  • My firefox 17.0.1 on Win 7 64 bit SP1 still crashes when I download ANY type of file EVEN browser.download.manager.scanWhenDone is false ... WHY ???

    my firefox 17.0.1 on Win 7 64 bit SP1 still crashes when I download ANY type of file EVEN browser.download.manager.scanWhenDone is false ... WHY ???

    If that plugin isn't working properly then its developer needs to fix this via an update.
    Try to ask advice at the Free Download Manager forum
    *http://www.freedownloadmanager.org/board/

  • In JDBC Sender Adapter , the server is Microsoft SQL .I need to pass current date as the input column while Executing stored procedure, which will get me 10 Output Columns. Kindly suggest me the SQL Query String

    In JDBC Sender Adapter , the server is Microsoft SQL .I need to pass current date as the input column while Executing stored procedure, which will get me 10 Output Columns. Kindly suggest me the SQL Query String , for executing the Stored Procedure with Current date as the input .

    Hi Srinath,
    The below blog might be useful
    http://scn.sap.com/community/pi-and-soa-middleware/blog/2013/03/06/executing-stored-procedure-from-sender-adapter-in-sap-pi-71
    PI/XI: Sender JDBC adapter for Oracle stored procedures in 5 days
    regards,
    Harish

  • TS1402 I can not copy any files from the server & from the Finder. System MAC OS 10.7.5

    I can not copy any files from the server & from the Finder. System MAC OS 10.7.5
    <Email Edited by Host>

    Hi, what is the no boot directory found about???
    Can you give details step by step of what you're trying?

  • How can I load a .xlsx File into a SQL Server Table using a Foreach Loop Container in SSIS?

    I know I've REALLY struggled with this before. I just don't understand why this has to be soooooo difficult.
    I can very easily do a straight Data Pump of a .xlsX File into a SQL Server Table using a normal Excel Connection and a normal Excel Source...simply converting Unicode to DT_STR and then using an OLE DB Destination of the SQL Server Table.
    If I want to make the SSIS Package a little more flexible by allowing multiple .xlsX spreadsheets to be pumped in by using a Foreach Loop Container, the whole SSIS Package seems to go to hell in a hand basket. I simply do the following...
    Put the Data Flow Task within the Foreach Loop Container
    Add the Variable Mapping Variable User::FilePath that I defined as a Variable and a string within the FOreach Loop Container
    I change the Excel Connection and its Expression to be ExcelFilePath ==> @[User::FilePath]
    I then try and change the Excel Source and its Data Access Mode to Table Name or view name variable and provide the Variable Name User::FilePath
    And that's when I run into trouble...
    Exception from HRESULT: 0xC02020E8
    Error at Data Flow Task [Excel Source [56]]:SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occured. Error code: 0x80004005.
    Error at Data Flow Task [Excel Source [56]]: Opening a rowset for "...(the EXACT Path and .xlsx File Name)...". Check that the object exists in the database. (And I know it's there!!!)
    I don't understand by adding a Foreach Loop Container to try and make this as efficient as possible has caused such an error unless I'm overlooking something. I have even tried delaying my validations and that doesn't seem to help.
    I have looked hard in Google and even YouTube to try and find a solution for this but for the life of me I cannot seem to find anything on pumping a .xlsX file into SQL Server using a Foreach Loop Container.
    Can ANYONE please help me out here? I'm at the end of my rope trying to get this to work. I think the last time I was in this quandry, trying to pump a .xlsX File into a SQL Server Table using a Foreach Loop Container in SSIS, I actually wrote a C# Script
    to write the contents of the .xlsX File into a .csv File and then Actually used the .csv File to pump the data into a SQL Server Table.
    Thanks for your review and am hoping and praying for a reply and solution.

    Hi ITBobbyP,
    If I understand correctly, you want to load data from multiple sheets in an .xlsx file into a SQL Server table.
    If in this scenario, please refer to the following tips:
    The Foreach Loop container should be configured as shown below:
    Enumerator: Foreach ADO.NET Schema Rowset Enumerator
    Connection String: The OLE DB Connection String for the excel file.
    Schema: Tables.
    In the Variable Mapping, map the variable to Sheet_Name, and change the Index from 0 to 2.
    The connection string for Excel Connection Manager is the original one, we needn’t make any change.
    Change Table Name or View name to the variable Sheet_Name.
    If you want to load data from multiple sheets in multiple .xlsx files into a SQL Server table, please refer to following thread:
    http://stackoverflow.com/questions/7411741/how-to-loop-through-excel-files-and-load-them-into-a-database-using-ssis-package
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • URGENT-CREATE A HTML FILE WITH AN STRING INPUT FROM THE RUNNING JSP

    I am designing a web page where the user enters a page after entering his/her login and password.The User should now be provided with a display page containing the servers that he has permissions for access.The servers that he has permissions are maintained in a database(a normal text file in UNIX).
    Till now the program has been complete for displaying the servers that are available to him.
    I need to create a HTML form containing these servers names in a check box so that when the user clicks thcheck box against the server name it should go to the server and get the password for the required server.
    THe intention from me is to create a HTML file that dynamically takes values from the running JSP means the server names as a string value to its input and then i can continue
    Please guide me in creating a HTML form based on the string output from the running JSP
    FileInputStream fs = new FileInputStream("/root/Auth_Application/User_Access_List");
    DataInputStream in1 = new DataInputStream(fs);
    int fl=0;
    while (in1.available() !=0)
    String str1=in1.readLine();
    StringTokenizer st1 = new StringTokenizer(str1);
    String usernam=st1.nextToken();
    if (usernam.equals(uname))
    String ip=st1.nextToken();
    String host=st1.nextToken();
    fl=1;
    out.println("<tr><td>                                                                                              "+ host + "</td><td> " + ip +"</td></tr>");
    if (fl == 0)
    out.println("YOU HAVE NO SEVRER IN YOUR PROFILE !");
    in1.close();
    The host string here is the server name
    the ip is the ip address of the server
    Need to input these values to another HTML page that contains the check box list of the servers .
    once these are clicked i think i can pass on this to another JSP and retreive passwords
    Please guide me in this

    FileInputStream fs = new FileInputStream("/root/Auth_Application/User_Access_List");
                                    DataInputStream in1 = new DataInputStream(fs);
                                    int fl=0;
                                    while (in1.available() !=0)
                                    String str1=in1.readLine();
                                    StringTokenizer st1 = new StringTokenizer(str1);
                                    String usernam=st1.nextToken();
                                    if (usernam.equals(uname))
                                    String ip=st1.nextToken();
                                    String host=st1.nextToken();
                                    fl=1;
                                    out.println("<tr><td>                                                                                              "+ host + "</td><td>          " + ip +"</td></tr>");
                                    if (fl == 0)
                                    out.println("YOU HAVE NO SERVER IN YOUR PROFILE !");
                                    in1.close();I feel sorry for the inconvenience that is caused as i am new to using these forums.
    I have here used a simple program to retreive the names of the servers that the users have acess to..
    I have here read the servername and server ip stored from a file in UNIX in the running JSP.Now i need to pass these string variables to HTML file and display it in a Check box format.the strings host and ip have to be passed to the input of the HTML file so that they can further be processed once they are clicked using another JSP.
    Can anybody please help me in Passing these strings from the running JSP and display it in a check box format

Maybe you are looking for

  • Captivate 7.0 fail to launch or register

    I'm running windows 7. Just purchased Captivate 7 online, and have a serial number. Downloaded the Bundle (32bit) – good. Ran exe file after download –good. Extracted Files – good. Initializing Installer – good Install screen- chose I have purchased

  • Mail program is retrieving every e-mail from the server every time I open it.

    Each time I open my mail, it retrieves every e-mail that is on the server.  I know that the problem is not with Comcast, because I downloaded Thunderbird and it works just fine.  Once a message has been retrieved, it does not retrieve it again. My iM

  • Flashplayer freezes for 5 seconds on changing volume or any other setting

    On changing volume or any other setting while watching video, Flashplayer freezes for about 5 seconds then continues as normal. (Windows 7 and Mozilla Firefox)

  • I am looking functioanl specification

    Hi Guru's I am looking functioanl specification on following 1) For creating new report 2) For any screen field change at the movement i am looking this, by any change if i get all functional specifications i will be happy. the main reasin that i am

  • ACLS file errors after Time Machine Restore

    Hi All. Does anyone know, Is there any way to get the ACL's in files to restore to their defaults?. Everything was great except I had a few files that ACL found but not expected errors that were supposedly "repaired" by Disk Utility but never were. U