Skip to content

Instantly share code, notes, and snippets.

@alexpghayes
Created September 21, 2017 05:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexpghayes/876e7446ac34779cc898473123614dfd to your computer and use it in GitHub Desktop.
Save alexpghayes/876e7446ac34779cc898473123614dfd to your computer and use it in GitHub Desktop.
# open a SQL terminal. note that my netid is aph3
runas /user:adrice\aph3 /netonly "sqlcmd -S classdb.ad.rice.edu"
# in the SQL terminal, make sure things work
CREATE DATABASE apgha1db
USE apgha1db;
GO
# populate the database we just created. note that C:\Users\alex\Desktop\comp330\a1\ is the path to where I kept my A1 files
runas /user:adrice\aph3 /netonly "sqlcmd -S classdb.ad.rice.edu,1433 -d "apgha1db" -i "C:\Users\alex\Desktop\comp330\a1\createtables.sql""
runas /user:adrice\aph3 /netonly "sqlcmd -S classdb.ad.rice.edu,1433 -d "apgha1db" -i "C:\Users\alex\Desktop\comp330\a1\flowers.sql""
runas /user:adrice\aph3 /netonly "sqlcmd -S classdb.ad.rice.edu,1433 -d "apgha1db" -i "C:\Users\alex\Desktop\comp330\a1\features.sql""
runas /user:adrice\aph3 /netonly "sqlcmd -S classdb.ad.rice.edu,1433 -d "apgha1db" -i "C:\Users\alex\Desktop\comp330\a1\people.sql""
runas /user:adrice\aph3 /netonly "sqlcmd -S classdb.ad.rice.edu,1433 -d "apgha1db" -i "C:\Users\alex\Desktop\comp330\a1\sightings.sql""
# again in SQL terminal, check that the tables are there now
SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment