Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Alternatively, if you would prefer to use the graphical ODBC manager, click Add ODBC Data Source from within the SPSS database wizard. Click Add and select “SQL Server”, then click Finish.

Image RemovedImage Added

A new wizard will popup specific to SQL server. Enter a name for your data source (usually something like ProjectXXXX) and provide the server address, e.g. sql.hic-tre.dundee.ac.uk, then click Next.

Image RemovedImage Added

This will then prompt you for some authentication details - select SQL Server authentication and put “user” in the username field, then click Next. Check the box “Change the default database to” and select your database from the dropdown list, then click Next. You can then click Finish and test the datasource. This should then appear as a datasource within SPSS.

💁 SAS Viya

The sample below is enough to get a connection open and visible within the Libraries section in SAS. Remember to update the username, password (blank) and database name within the connection string.

Code Block
libname mydb odbc 
	complete="Driver=ODBC Driver 18 for SQL Server;Server=sql.hic-tre.dundee.ac.uk;Uid=username;Pwd=password;TrustServerCertificate=Yes;Database=dbname;"
	schema=dbo;
	
proc sql  ;
	connect using mydb ;
	
	select * from connection to mydb (
		select * from mydb.department ;
	);
	
	disconnect from mydb;
run;  

...