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
 Moving Access to SQL

Author  Topic 

sulrich
Starting Member

3 Posts

Posted - 2010-01-12 : 13:11:29
I am fairly new to SQL and having a few problems moving my Access 07 DB to our SQL 2005 server. To begin, the Access DB is in shambles, it is one massive table that will no longer sync with all the replicas. The users that managed it have ended up loosing the master copy and have all been working with their own copy of the DB that hasn't been sync'd since June 09. I am working on getting what they have onto a SQL server to eliminate the need for replicas. I have been able to upsize it to SQL with fairly minor problems that I have been able to resolve, but my main question is that I am trying to split the one massive table into smaller more manageable relational tables. I have seen a few posts elsewere that have queries but I tried a few to no avail. I don't know if it is cause I am just writing them wrong or what. Can anyone please give some guidance?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-01-12 : 13:13:54
quote:

but my main question is that I am trying to split the one massive table into smaller more manageable relational tables. I have seen a few posts elsewere that have queries but I tried a few to no avail. I don't know if it is cause I am just writing them wrong or what.



Please show us what you mean.

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

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

sulrich
Starting Member

3 Posts

Posted - 2010-01-12 : 13:24:43
This was posted on another site and no matter what I did, I kept getting a syntax error, and I believe since this is my first experience with writing a SQL query, I am obviously not doing something properly
INSERT INTO <NEW_TABLE_NAME>
( column_1_name
, column_2_name
, ....
, column_n_name
)
select
, b.column_1_name
, b.column_2_name
,....
, b.column_n_name
FROM <BIG_TABLE_ NAME> AS b
;

I am trying to move the Address, city, state and zip from the access table Prospects to the table I created in SQL, tblAddress.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-01-12 : 13:26:31
That looks correct for pseudocode, so please show us what you tried and we'll correct the syntax error.

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

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

sulrich
Starting Member

3 Posts

Posted - 2010-01-12 : 14:02:37
INSERT INTO <TBLADDRESS> (Address, City, Street, Zip_Code) select, b.Address, b.City, b.Zip, b.Zip_Code FROM <PROSPECTS> AS b;
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-01-12 : 14:08:46
INSERT INTO TBLADDRESS (Address, City, Street, Zip_Code)
select b.Address, b.City, b.Zip, b.Zip_Code
FROM PROSPECTS AS b;

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

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page
   

- Advertisement -