Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Excel data into SQL

Author  Topic 

patelakush
Starting Member

6 Posts

Posted - 2011-09-09 : 17:26:48
I have a Excel file which I am importing to SQL Server but the Excel file is missing the Report date (which is in the format 082011(MMYYY)
I want to add the date which is 082011 for the entire 30,000 records. I do not want to do manualy but something that can be done in the SQL server

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-09-09 : 17:28:25
What tool are you going to use for the import?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

patelakush
Starting Member

6 Posts

Posted - 2011-09-12 : 08:53:24
Importing the the excel (flat file) into Microoft SQL server
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-09-12 : 09:16:21
Tara is asking the tool used for importing. is it ssis export import or OPENROWSET,OPENQUERY etc?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

Villanuev
Constraint Violating Yak Guru

478 Posts

Posted - 2011-09-13 : 01:39:35
Hi visakh16 and Tkizer.

Any inputs regarding this process.
Right now im using SSIS, and bulk Insert function to copy data from excel.
SSIS and Bulk Insert utilities, i have to store the data to temporary table
and obtain them using this tool.
My objective is only to read the records and then maybe i can insert it to temporary table
or any process i would like to do.

I just want to use OpenRoset but i dont have access "Admin" that why i encounter an error.
but for this OpenQuery how does it works? can you give me sample sql statement using openquery.
do i need any access password to use this utilities?

Regards,

jov
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-09-13 : 02:18:34
ok. where do you get date value from which needs to be populated in table?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

Villanuev
Constraint Violating Yak Guru

478 Posts

Posted - 2011-09-13 : 02:22:50
Its possible to open Excel file in OpenQuery?
Go to Top of Page

Villanuev
Constraint Violating Yak Guru

478 Posts

Posted - 2011-09-13 : 02:25:47
Here is my proceduer.

1. create temporary table
2. perform the bulk insert

Instead of:

1. Open excel in using ?? then manilpulate the records
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-09-13 : 02:32:15
quote:
Originally posted by Villanuev

Its possible to open Excel file in OpenQuery?


its possible
see
http://support.microsoft.com/kb/321686

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

Villanuev
Constraint Violating Yak Guru

478 Posts

Posted - 2011-09-13 : 02:38:56
Okay. Thanks.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-09-13 : 02:53:26
welcome

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -