Date: Tue, 25 Apr 2006 10:42:21 -0700
Reply-To: Victor Kogler <vkogler@silcom.com>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Victor Kogler <vkogler@silcom.com>
Subject: Re: save to SQL
In-Reply-To: <5E6AD3B8958CD24B85934C16177A2BE8016F38B5@exhwhwmb06.eu.dnb.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Anne,
The Save Translate command is what you need. The necessary ODBC data
source will need to have been created up prior to this.
A sample command saving an SPSS file to a SQL 2000 database is shown
below.
Save Translate /Connect = 'DSN=HSD;UID=;APP=SPSS For
Windows;WSID=SPQR;DATABASE=HSD_3;Trusted_Connection=Yes'
/type=ODBC /Table=test_SPSS .
Where:
HSD = the name of the ODBC driver
SPQR = the name of your computer workstation
HSD_3 = the name of your SQL database
test_SPSS = the name of the data table to be created
One way to create the connect string if you are not familiar with ODBC
is to use the SPSS Database Wizard. Import an SQL table from the
database where you want to export your SPSS data and paste the syntax.
If necessary, you can create the ODBC data source at the same time with
the Wizard. Copy the Connect statement from the Wizard-created syntax
into the Save Translate syntax above, enter the name of the table you
want to create and there you are. You don't need the Wizard syntax
after you've copied the Connect string so you can delete it. The
connect string for importing a data table into SPSS is the same as for
export.
Hopefully this points you in the right direction.
Victor Kogler
Smith, Anne wrote:
> Hi all
> I am not good with ODBC type things - so sorry for a basic question.
> Is it possible to save an SPSS dataset into SQL format. If so can someone
> run through how I would do this, (to included it in a standard process
> where the directory / filename will change each month. )
> Thanks.
>
> Anne Smith
>
>
>
>