Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Data Insertion into Access DB using T-SQL Expand / Collapse
Author
Message
Posted Monday, March 11, 2013 2:53 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, July 30, 2014 4:08 PM
Points: 12, Visits: 109
Hi Guys,

I am trying to insert data from SQLServer into an access database,using T-SQL

I used OPENROWSET to Select the data from access into SQLServer, it worked fine

QUERY:
SELECT * FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0','"ServerName"';'admin';'',TableName);

My table has columns with the changing month names

is there any way, i could do some sort of SELECT INTO an access DB using T-SQL ..?


Note : This is an automated report, i cannot use Import Export Wizard, there is no SSIS installed on the machine
Post #1429485
Posted Monday, March 11, 2013 4:31 PM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Thursday, August 28, 2014 2:20 PM
Points: 541, Visits: 1,047
What about using ODBC and creating a linked table in Access so you have constant and immediate access to the data for the report?
Post #1429528
Posted Monday, March 11, 2013 4:51 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, July 30, 2014 4:08 PM
Points: 12, Visits: 109
Hi Erin, Client requirement is to have a report in push off a button.. using ODBC Linked Tables is more of a manual process.. let me know your thoughts on this.....
Post #1429533
Posted Tuesday, March 12, 2013 3:44 AM


SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Yesterday @ 11:38 PM
Points: 408, Visits: 527
Hallo Iraju10,

this is not possible. To push data into ACCESS with OPENROWSET.
Basically the only possible solution is an access db and start of it by a SQL Server JOB.
In the access db you have an autoexec macro which may pull the data into local tables.

Another option maybe BCP but I'm not sure whether it supports mdb as OUTPUT-Format.
Last but not least think about an SSIS package - that's exactly for solutions you are looking for.


Microsoft Certified Master: SQL Server 2008
my blog: http://db-berater.blogspot.de (german only!)
Post #1429644
Posted Tuesday, March 12, 2013 8:35 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Thursday, August 28, 2014 2:20 PM
Points: 541, Visits: 1,047
Another solution could be, depending on the design of the report, to put it in Excel and have a linked datasource that updates on open so that every time someone opens the report the current numbers are available. I've done book-keeping reports for clients that way.
Post #1429853
Posted Tuesday, March 12, 2013 9:21 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, July 30, 2014 4:08 PM
Points: 12, Visits: 109
we thought about implementing this report in SSIS, but we are dealing with 24 months worth of sales data, as well quarterly and yearly data, i have dynamically changing columns

For Example : for the Month for August 2012, my table columns names will be

tblSalesData : SalesId, Name, Address, Zip,[Aug'12],[Jul'12],[Jun'12],[May'12]...... [Sep'10],[12 Months Ended Aug'12], [Q2'12],[Q1'12],[Q4'11].....[Q4'10]

for the Month of September 2012, my table columns names will be
tblSalesData : SalesId, Name, Address, Zip,[Aug'12],[Jul'12],[Jun'12],[May'12]...... [Sep'10],[12 Months Ended Sep'12],[ Q3'12] [Q2'12],[Q1'12],[Q4'11].....[Q4'10] , i have built this column names using dynamic sql


In SSIS, is there a way to map this changing column names in Data Flow Task ...?

may i know your thoughts on this....? appreciate your help..

Note: No Partial Quarters are allowed, so for August we start from [Q2'12], where as September we start from [Q3'12]
Post #1429896
Posted Tuesday, March 12, 2013 9:26 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, July 30, 2014 4:08 PM
Points: 12, Visits: 109
Hey Erin,

this is an access report, where the client has the front GUI, i am populating the back end data tables

is there way, i could populate my data into excel and feed the access tables ....?

Thanks for your help...?
Post #1429900
Posted Tuesday, March 12, 2013 11:29 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Thursday, August 28, 2014 2:20 PM
Points: 541, Visits: 1,047
Sure you could do it that way. Open your excel and have it pull down the table into a worksheet and then have that worksheep mapped to a file table in access. Not sure how that's going to work with dynamic column names but it's certainly doable.
Post #1429998
Posted Wednesday, March 13, 2013 11:20 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, August 29, 2014 9:02 AM
Points: 117, Visits: 1,694
Do you really need the data in Access?

If not, you could setup a linked table(s) to the source data in SQL and design the report on those tables.




If you don't stand for something, you'll fall for anything!,

Don Urquhart
Post #1430540
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse