Showing posts with label excel. Show all posts
Showing posts with label excel. Show all posts

Friday, March 23, 2012

Read information from excel file into ms sql table ?

Hi,

I want to insert a long list of articles and prices from a excel ark to two different database tables. These tables are linked together with a unique id, called obj_num.

Is there any possible way to do this ? Right now I do i manually and it takes for ever!

My Excel ark,
Column A1 (Article)
----
Coke
Fanta
Sprite
etc ..

Column A2 (Price)
----
2
2.2
3
etc ..

My database
table_article
------
obj_num
name

table_price
------
obj_num
price

Best Regards
Magnus

Quote:

Originally Posted by mberggren

Hi,

I want to insert a long list of articles and prices from a excel ark to two different database tables. These tables are linked together with a unique id, called obj_num.

Is there any possible way to do this ? Right now I do i manually and it takes for ever!

My Excel ark,
Column A1 (Article)
----
Coke
Fanta
Sprite
etc ..

Column A2 (Price)
----
2
2.2
3
etc ..

My database
table_article
------
obj_num
name

table_price
------
obj_num
price

Best Regards
Magnus


if this is one time, i'd rather use a DTS (Enterprise Manager - Import Data). then do everything using query

READ EXCEL DATA CELL BY CELL FROM SP

HI,

I HAVE AN EXCEL SHEET WITH SOME DATA, I WANT TO IMPORT THAT DATA (CELL
BY CELL WITH MANIPULATION) INTO THE SQL SERVER TABLES BY USING STORED
PROCEDURE(IF POSSIBLE).

IF ANYBODY HAVE DONE SIMILER TYPE OF JOB OR KNOWING ABOUT IT, PLS. LET
ME KNOW.

THANKS IN ADV.

T.S.NEGIWrap sql server with an object tag and create an instance for every
spreadsheet you have. Seriously, save your spreadsheet as a CSV and
use Bulk Insert. It's straight forward and can be found on the sql
Books On Line Help. -- Louis|||louisducnguyen@.hotmail.com (louis nguyen) wrote in message news:<b0e9d53.0311140737.280f0fda@.posting.google.com>...
> Wrap sql server with an object tag and create an instance for every
> spreadsheet you have. Seriously, save your spreadsheet as a CSV and
> use Bulk Insert. It's straight forward and can be found on the sql
> Books On Line Help. -- Louis

Louis thanks for your reply.

But this does not seems to solve my problem.

Bulk insert will not be right in this situation, coz. I have to
manipulate data also.

for example. if some record (id) already exist in data, in that case
only updation may require.

If I could read cell by cell data from excel sheet, then only this
level of manipulation is possible.

T.S.Negi|||tilak.negi@.mind-infotech.com (T.S.Negi) wrote in message news:<a1930058.0311240332.35ae29ef@.posting.google.com>...
> louisducnguyen@.hotmail.com (louis nguyen) wrote in message news:<b0e9d53.0311140737.280f0fda@.posting.google.com>...
> > Wrap sql server with an object tag and create an instance for every
> > spreadsheet you have. Seriously, save your spreadsheet as a CSV and
> > use Bulk Insert. It's straight forward and can be found on the sql
> > Books On Line Help. -- Louis
>
> Louis thanks for your reply.
> But this does not seems to solve my problem.
> Bulk insert will not be right in this situation, coz. I have to
> manipulate data also.
> for example. if some record (id) already exist in data, in that case
> only updation may require.
>
> If I could read cell by cell data from excel sheet, then only this
> level of manipulation is possible.
>
>
> T.S.Negi

Probably the easiest approach is to BULK INSERT or DTS the spreadsheet
into a staging table, then do an INSERT into the target table. That
way you can check and clean up the data while it's in the staging
table, and before it goes to the 'real' table.

Simon|||> If I could read cell by cell data from excel sheet, then only this
> level of manipulation is possible.

If you're more comfortable doing arrays/loops, I don't think T-SQL has
it. I would suggest bulk inserting into a temp table. Update
(manipulate it). Identify new records and insert. Identify existing
records and update.

Friday, March 9, 2012

RDLC and Excel - No Grid Lines

Using ASP.NET 2, C#, Web application, we have an rdlc report which will be primarily used to export to an Excel spreadsheet. When we run thw report, then export it, we wind up with a spreadsheet with no gridlines, eg a spreadsheet with invisible cell borders.

Is the a setting or property somewhere which can be changed so that the spreadsheet which opens after the export looks like a standard spreadsheet, that is, with visible cell borders?

Many thanks
Mike Thomas

In the test I just did, setting the BorderStyle to Single on the text boxes I wanted to have borders worked. You should also take a look at http://msdn2.microsoft.com/en-us/library/aa178951(SQL.80).aspx to see how cells are converted. Short and sweet: best, use a table; next best, make sure to align everything.

Larry

|||

Sorry, it's late. I should have also mentioned that every cell in a table and a matrix are textboxes. The BorderStyle is 'none' by default and the BorderColor is 'Black' by default. The properties I mean are those in Visual Studio, not those found through the context menu.

Larry

RDL and XML

Reporting Services report definition language or rdl looks like XML.

What are the differecnes?

Can RDL be used with Office 2003 i.e Word or Excel?

Regards

J

RDL is XML.

XML is a standard and RDL files are specific XML files for Reporting Services.

Word 2003 can read XML file in this own format so Word 2003 does not recongnize .RDL files.

Please open the RDL file with NOTEPAD.EXE and open one Word 2003 XML File with NOTEPAD.EXE.