Sunday, 21 October 2007

Migrating data from SPSS to SQL Server 2005

SQL Server 2005 has among Native SQL Server also OLEDB connection which enables you to import data to you favorite SPSS version.

Using SPSS Syntax you can with almost no haste import data - using T-Sql Query to SPSS.



get data


/sql ='select id, name, cast(round(cast(datediff(day, BirthDate, getdate()) as float) / 365.25, 0, -1) as integer),(select max(date_time) from table1 where = date2) as Another_Date from table2 as t2 join table3 as t3 on = join table4 as t4 on = where t4.my_number = 1'


Where parameters My_server_name, My_username, My_password and My_database should be replaced.

SQL query should be enclosed in single aphostrophe ' and your SQL query should not contain any single quotes for enabling strings (eg.: where name = 'John').