Uploading Multiple Files To Sqlserver

Feb 6, 2007

Hi Every One,



I want to upload 100 pdf files to database with a single button click. i dont want to use file input control at design mode.I want to create a instance of fle input control at run time and with a loping concerpt 100 more files should be uploaded to database.

Is there any way to upload without using file input control at design mode and upload all files with a single button click.......



thanks In Advance

Saroj Nanda

Software Engineer

Eilisys Technologies Pvt. ltd

View 1 Replies


ADVERTISEMENT

IMPORT Multiple CSV Files To SQLSERVER Table

Jan 21, 2005

Dear All,

I am importing all the files from a particular folder to a table on my database KB. It is working perfectly if i use it on the same system where the DB exists and not working from the network.


USE TESTDB

--Table Creation Starts here

Create table Account([ID] int IDENTITY PRIMARY KEY, Name Varchar(100),
AccountNo varchar(100), Balance money)

Create table logtable (id int identity(1,1),
Query varchar(1000),
Importeddate datetime default getdate())

--Table Creation ends here

---Stored Procedure Starts here

Create procedure usp_ImportMultipleFiles @filepath varchar(500),
@pattern varchar(100), @TableName varchar(128)
as
set quoted_identifier off
declare @query varchar(1000)
declare @max1 int
declare @count1 int
Declare @filename varchar(100)
set @count1 =0
create table #x (name varchar(200))
set @query ='master.dbo.xp_cmdshell "dir '+@filepath+@pattern +' /b"'
insert #x exec (@query)
delete from #x where name is NULL
select identity(int,1,1) as ID, name into #y from #x
drop table #x
set @max1 = (select max(ID) from #y)
--print @max1
--print @count1
While @count1 <= @max1
begin
set @count1=@count1+1
set @filename = (select name from #y where [id] = @count1)
set @query ='BULK INSERT '+ @Tablename + ' FROM "'+ @Filepath+@Filename+'"
WITH ( FIELDTERMINATOR = ",",ROWTERMINATOR = "")'
--print @query
exec (@query)
insert into logtable (query) select @query
end

drop table #y

--sp ends here

Exec usp_ImportMultipleFiles 'c:myimport', '*.csv', 'Account'

If i use the above Exec like

Exec usp_ImportMultipleFiles '\kb-02C$MyImport', '*.csv', 'Account'
I am getting the following error:

Could not bulk insert because file '\kb-02C$MyImportAccess is denied.' could not be opened.
Operating system error code 5(Access is denied.).

C Drive and MyImport folder is shared on system kb-02

Would appreciate your valuable HELP.

thanking your valuable help in advance.
K006B

View 2 Replies View Related

Uploading Files To SQL Database

Mar 19, 2006

I was following an example from the book "ASP.net unleashed" in Chapter 14, where it describes how to upload a file directly into the database.
I got it to insert the file into my database as described, and with changes created a master and detail form to select the file and display it.. (which I assume had worked).
Except, when attempting to access the file it gives two different errors. For a ppt file it gives:


The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.


An invalid character was found in text content. Error processing resource 'http://localhost:3870/SeminarOrganiser/view_file...


and for a simple txt file:


The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.


Invalid at the top level of the document. Error processing resource 'http://localhost:3870/SeminarOrganiser/view_file.aspx?...SELECT suggestEvent.suggestID, suggestEvent.uID, users.uFirstName, users.uLastName, users.uEmail, suggestEvent.suggestTitle,...From these two errors, I cannot really make sense of what has gone wrong or even why XML has even been mentioned. Looking around on the net has not allowed me any further progress.In any case, would anyone be able to explain to me what might have gone wrong?Alternatively, any links that may help would be greatly appreciated.Thank you very much in advance.

View 1 Replies View Related

Bulk Uploading RDL Files

Apr 6, 2007

Scenario: I have 80 RDL files which will be delivered to a customer to upload into their SSRS database.

Issue: Is it possible to bulk upload RDL files into SSRS instad of loading each file individually ?

If anyone has found any information on this and can direct me to it, I would be very grateful.


Thanks.

View 1 Replies View Related

Uploading Image Files

May 25, 2007

I have a directory of files that I would like to upload with some datato a table so that I can store the files in the db. I'm not trying toparse files into rows, I want to stick the actual file in the column.Is there some kind of insert script, or bulk copy that I can use?I have about 150 docs and I would rather not go through the whole app,pick the file, upload it. etc.thx,M@

View 1 Replies View Related

Connection String For Big Uploading Files

Oct 6, 2006

I have a webpage where I want to upload pdf files to my database (arround 2 MB). Putting them inside the database is the choice based on audit definitions the client has.The problem is that for big file uploads, I get the "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding." error.I believe the solution is expanding the connection timeout time in the SQL connection. But I don't want to do that in web.config, as a small timeout is good for every page except this one.What I was thinking about was something like, on button command:- "create new connection string"- use that connection string to upload the file using the datatables and tableadapters- turn back to the default connection string. How do I explicitly tell the system to "use THIS connection string on the next task" ?Alternatively, another way of doing is also appreciated!

View 4 Replies View Related

Uploading Different Kinda Files Into SQL Database :((

Apr 6, 2005

Hi everyone!
 i am working on an web application database(asp.net,c# and sql server), wherein i wanna upload and retrieve different kinda files .
so guys, plz do, give me some info abt how exactly i can carry out the task and if possible give me the snippet too(hmm,, very lazy....)
thanx in advance
regards
kiran 

View 1 Replies View Related

Uploading Pdf Files In SQL2005 And Performing Full Text Search

Jun 2, 2007

Can anyone show me how to upload a pdf file to SQL 2005 and perform a Full Text Search on it and to extract record based on a word in the pdf. I have looked all over the web and I couldn't get any thing working as mentioned in other forums. Please mail me a small example if possible on salman.anwar@wmich.edu ASAP.

View 1 Replies View Related

Uploading Multiple Images Into SQL

May 2, 2006

Hello,
I have 3000 images to upload in SQL. I have a page that does it in ASP.net 2.0 1 by 1 but i am looking for a faster way. The targeted table look like this
*ID (int)  ImgSize  (int)  ImgContentType  (nvarchar 50)  ImgFile  (image)
Thanks for the help.

View 1 Replies View Related

Integration Services :: Import Multiple Files Into Multiple Tables Using SSIS

Jun 16, 2015

I have a requirement where in i have around 15 different flat files , filenames are fixed but folder path can be changed(i think i should use a variable for folder path). These 15 files data should go to their respective tables in the database.

Whether I need to create separate data flow task for each file or separate package? In addition to these, example : while importing product data into product table, if product ID already exists, we need to ignore it and upload only the new records.

View 4 Replies View Related

Importing Multiple Flat Files To Multiple Tables In SSIS

Jun 27, 2006

I have a couple of hundred flat files to import into database tables using SSIS.

The files can be divided into groups by the format they use. I understand that I could import each group of files that have a common format at the same time using a Foreach Loop Container.

However, the example for the Foreach Loop Container has multiple files all being imported into the same database table. In my case, each file needs to be imported into a different database table.

Is it possible to import each set of files with the same format into different tables in a simple loop? I can't see a way to make a Data Flow Destination item accept its table name dynamically, which seems to prevent me doing this.

I suppose I could make a different Data Flow Destination item for each file, in the Data Flow. Would that be a reasonable solution, or is there a simpler solution, or should I just resign myself to making a separate Data Flow for every single file?

View 9 Replies View Related

SQL Tools :: How To Restore Multiple Databases From Multiple BAK Files At Once

Aug 14, 2012

I am trying to restore multiple .bak backup SQL database files onto a new server. However, I have found that it will not allow me to restore multiple databases at once. Is there a way to do this so that I do not have to manually upload one at a time? I tried adding all the .bak files at once to the backup device window but it only did the first one listed. It would be so much easier to restore them all at once so that I do not have to continue this manual process. I am restoring them via device.

View 13 Replies View Related

Bulk Insert Multiple Files To Multiple Tables - How?

Feb 15, 2008

I need to be able to bulk insert a bunch of tables from their corresponding flat file. I have created an XML file (see below) which has the file name/table name pair at each node. I then created a ForEachLoop task and used the Node enumeration type and the following OuterXpathString: ReferenceFiles/File. At this point I get lost. How do I pass the 2 inside node values (file name and table name) to variables which I can then use as expressions for the bulk insert task inside the Foreach?

Here is XML file:




Code Snippet
<ReferenceFiles>

<File>


<FileName>Ref_Categories.txt</FileName>
<TableName>Ref_Categories</TableName>
</File>
<File>

<FileName>Ref_Configs.txt</FileName>
<TableName>Ref_Configs</TableName>
</File>
</ReferenceFiles>






Thanks.

View 1 Replies View Related

Export Multiple Tables To Multiple Flat Files

Nov 29, 2007

I used the data export wizard to export a single table to a single flat file (multiple wasn't allowed). I saved the package as a *.dtsx file which I'm attempting to edit to add the additional tables.

Creating additional sources is fairly easy copy of the first source and change to the table name.

I've tried copying the destination connection and changing to a new text file, but can't get past having to add each column manually to the new destination.

How can I duplicate the mapping that must be taking place in the wizard in the *.dtsx editing environment?


This seems like a simple / common task, but I've been unable to find a solution.

Thanks, Richard

View 1 Replies View Related

Saving And Retreivig The Files On Sqlserver

Sep 12, 2007

Hi!
I want to save and retreive some files on sqlserver. I want to save the files in binary format on sqlserver and I want to get back them in their format.Is it possible in c#? If possible please help me to do this. I already succeeded to save a file in binary format, but i am getting problem to retreive that in its format.
Thanks in adance

View 1 Replies View Related

How To Store GIF,BMP,JPEG Files In SQLServer.

Jan 19, 2000

Hello friends,

Can anybody pls explain me how I can store GIF,BMP,JPEG files in SQLServer
using Image data type or anything else .Thanks in advance.

Rajesh George.

View 1 Replies View Related

Where To Install SQLServer's Program Files?

Sep 22, 2006

Hi, I'm after some advice.

I have a server containing two mirrored HD's connected to a SAN.

I have to install SQL Server 2005 onto this server, I intend to put all data/log files on the disks that are in the SAN but my question is: where is the best place to install SQLServer itself, the local disk (ie. C:) or disks within the SAN?

Thanks

View 4 Replies View Related

Multiple Flat Files To Multiple Tables

Jun 1, 2007

Hi,



I have searched but not found quite the best way to look at this so far..



I have an application that outputs data to several text files (up to 30). These have commonality by an object name, but then contain completely different column data.



In DTS I had each of the source text file connections going to one OLE DB connection and then individual transform data tasks pointing to the one OLE DB connection.



Looking at SSIS, it would appear that I would need to have one source and one destination for each of these and therefore 30 parallel data flows?



Just wondering if there is a neater way of doing this??



It is a regular data import that happens a few times a day - the text files are named the same as the SQL tables - ie app_userdata.txt goes to app_userdata table.



Hope that explains ok and thanks in advance.



Mike

View 3 Replies View Related

Storing Files In SQLServer 2005 Express

Feb 16, 2008

Hello,I'm looking for a tutorial or some sample code to save a file in sql server with c#. So far I have not been able to find a anything I could use as most tutorials are in VB. I'm using the varbinary max type to store the file. The part I need help with is selecting the file and converting it using the Stream object, not the SQL insert statements.  Thanks,Arnold 

View 3 Replies View Related

How Can I Store Files Like (abc.txt , Abc.doc) In SqlServer Database From ASP.NET Application

Jan 29, 2006

How can i Store files like (abc.txt , abc.doc) in SqlServer Database from ASP.NET application ?? my files are about (2 Mb ) size
aslo  want to know about text as well as .jpg , . gif files also
pls send me code ... help me
 

View 4 Replies View Related

Deployment Files Needed By Sqlserver 2005 Driver

May 26, 2007

Hello all

I built an application that connect to MS SqlServer2005 using Native driver (sqlncli.msi) I install that file from MS site, I need to deply my application to the end-user, and I would like to know what files do I need to deploy to make sure the application is gona run okay on the client PC's.



I search in the registry for the driver, and I found this "sqlncli.dll", is it enough or I need to include more files !!



Thanks and best regrdas

Waleed

View 1 Replies View Related

DTS - Multiple Files To Multiple Tables

Aug 4, 2004

I am trying to write (my first, unfortunatly) DTS, and am having some problems.

I need to be able to import multiple flatfiles (all in the same format, just with different schema), each one going into a different table. I have written an application to call my DTS, sending it variables for the tablename and the filename. This works fine when I test it on a single flatfile.

My problem is, the Tranformation object does not reset after each DTS call, so I get "Column does not exist" errors after the first successful import. I can go into the DTS Manager and reset the Transformation options, but that would defeat the purpose of automation. Is there anyway to reset, or another technique, the Transformation object so that it will continuosly work on files that use different schema?

I am very new at DTS, so please consider me "ignorant" when replying.

Thanks in advance.

- Jordan

View 4 Replies View Related

Connecting To Multiple SQLserver

Nov 20, 2006

Hello,

I am working on to design SSIS package which need to run scripts against multiple sqlserver and need help.

Basically I need to connect several SQLserver machine to get a data and insert to our central respository.

Any help or tip appreciated.

Thanks

--

Farhan

View 5 Replies View Related

Multiple SQLServer Agents For Replication

Feb 24, 2003

Can I have multiple SQL Server Agents running concurrently?

I would like to have 10 instances of database running on my local SQL Server - each of these are Merge Replication to a unique database located offsite.

Do they all run through one SQL Server Agent?

If they do would this be a slow process as, I think, the SQL Server Agent queues the replications pending.

Thanks,

Bianca

View 1 Replies View Related

Access Multiple Sqlserver Database Using VB

Aug 31, 2004

How can i access multiple sqlserver database using VB
eg. insert 1 record in a database from other databse.

View 1 Replies View Related

How To Open Multiple SqlConnection Objects In A SqlServer Project

Jun 5, 2006

I have a sql server project where I have added 1 stored procedure (named StoredProcedure1) and 1 class (named MyClass). MyClass has two functions Func1() and Func2(). The stored procedure simply instantiates MyClass and calls Func1().

Func1() creates a SqlConnection object using "context connection=true" - opens the connection and then calls Func2(). Func2() also creates a SqlConnection object using "context connection=true" - and attempts to open the connection. However when attempting to the Open() call inside Func2(), the code just exits. What gives? The code is pasted below, thanks!

*******THE STORED PROCEDURE**************
using System;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using Microsoft.SqlServer.Server;
using SqlServerProject1;

public partial class StoredProcedures
{
[Microsoft.SqlServer.Server.SqlProcedure]
public static void StoredProcedure1()
{
// Put your code here
MyClass obj = new MyClass();
obj.Func1();
obj = null;
}
};

*******THE CLASS "MYCLASS"**************
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using Microsoft.SqlServer.Server;

public class MyClass
{
public MyClass()
{

}

public void Func1()
{
using ( SqlConnection conn = new SqlConnection("context connection=true") )
{
conn.Open();

Func2();
conn.Close();
}
}

public void Func2()
{
using ( SqlConnection conn = new SqlConnection("context connection=true") )
{
if ( conn.State != ConnectionState.Open )
conn.Open();

if ( conn.State == ConnectionState.Open )
conn.Close();
}
}
}

View 1 Replies View Related

Transfer Multiple Tables From SqlServer To Oracle Using SSIS

Jan 14, 2008



Hi,

I am new to SQL Server 2005 SSIS Packages. I want to transfer data from multiple tables from sql server to oracle database. I cannot use export wizard as it creates new tables in the destination (oracle) DB. I already have tables created in the destination DB. When I created an SSIS package, it allowed me create package to tranfer data for only for one table from source to destination. I have created DTS packages in 2000, where you have source db and destination db and just add links for multiple tables. Is there a way I can do it in SSIS. Please let me know.

View 3 Replies View Related

How Do You Run Multiple .sql Files?

Dec 17, 2003

I have multiple .sql files, exe each one manually is a pain, so how do you run multiple .sql files all at once? Beside creating a batch file, are there t-sql commands that could execute .sql files?

Thanks!

View 4 Replies View Related

Multiple Files -- DTS

May 18, 2004

I have a rather large sale transaction DB. Basic header, and detail tables. I am providing a third party company with daily sales information, and I need to give them back data from about 8 or 9 months ago. I currently have a DTS package that gets sales for the current day, but since I have to go back, I have to manually edit the query in the DTS package, and change the date range...UNLESS ...

Blah, blah, blah. The problem is that they can only take the data in Daily files. So, there would be ONE file for each day. I really don't need to be manually running these jobs, so I'm wondering if someone could point me to a way of writing a package (maybe ActiveX, not sure) that would run through a loop, basically, of dates, and create a seperate file for each day. Versus having to edit a generic DTS package, and changing the date range 350 times...

View 6 Replies View Related

Multiple Log Files SMO

Jan 24, 2007

I need to restore a database that has a bak file and many log files. Is there a way I can do this with one recovery step?

Or do I need to use a different restore object for each file?

MTmace

View 1 Replies View Related

Multiple Log Files

Jun 7, 2006

Using an expression to set the log filename to include the date and time results in 3 log files being created.

Ummm. Why? I only ran the package once. Is SSIS not sharing my log file connection among the different components?

On first thought my workaround would involve using a script task to "set" the log file name to a variable and use an expression to set the log connection to the variable. But the problem with that is that logging starts BEFORE the script task is run...

View 8 Replies View Related

Multiple Files

Apr 20, 2007

I have a job with a single step that executes a stored procedure that performs the following steps:

1. Checks for the existance of a file A in a folder A

2. If it exists,

a. executes the cmdshell to run a DTS package to drop a table, recreate it and load the data in the file A to table X

b. runs other stored procedures that use the data in table X to create other tables Y and Z

c. executes the cndshell to remove and rename the file A from Folder A into Folder B



What I'd like to do is use this same stored procedure if possible, but create a job or another store procedure that would loop thru and process multiple files in Folder A instead of just one.



Any suggestions would be greatly appreciated

View 1 Replies View Related

Import Multiple XML Files At Once

Jul 17, 2007

Hi,
I have about 300-400 XML files I want to load in my SQL database (2005). The following code will load one (1) file. How do i do a mulitple collections?
INSERT INTO MEL (DATA) SELECT * FROM OPENROWSET (BULK'C:TempCHAPTER1.xml', SINGLE_BLOB) AS TEMP Thanks,

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved