1 / 30

Presentation to NWEUG 2014 Presented by: Lewis-Clark State College

How to develop reporting views using SSMS (SQL Server Management Server) and create and deploy the reporting view using the Colleague Application. Presentation to NWEUG 2014 Presented by: Lewis-Clark State College Celeste McCormick, Sandra Boyd – IT. Lewis-Clark State College Overview.

garin
Download Presentation

Presentation to NWEUG 2014 Presented by: Lewis-Clark State College

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. How to develop reporting views using SSMS (SQL Server Management Server) and create and deploy the reporting view using the Colleague Application Presentation to NWEUG 2014Presented by: Lewis-Clark State College Celeste McCormick, Sandra Boyd – IT

  2. Lewis-Clark State CollegeOverview Founded 1893, public undergraduate college located in Lewiston, Idaho. Approx. 4500 enrolled students, 3000 FTE Colleague users Administrators: 4Power Users: 3Report Writers/Runners: 40Other users: ~150

  3. What is a reporting view? What was once a QueryBuilder query using one table and many computed columns…

  4. What is a reporting view? …now requires joining data from all of these tables.

  5. What is a reporting view? IT can write a complex SQL query to perform the joins and incorporate all of the desired elements…

  6. What is a reporting view? into a “reporting view” that looks like a single table that report writers can query against:

  7. Identify users’ needs for reporting views • Identify the key report writers • Examine and assess their current slate of reports • Brainstorm future needs • List the Reporting Views that will be needed • Determine the columns to include in each view This is not an exact science. Each report writer will conceptualize this approach in a different way.

  8. Develop and test reporting views in SSMS(One record per address type for a person)

  9. Develop and test reporting views in SSMS(One record per address type for a person)

  10. Get help/ideas from delivered Ellucian views when developing your SQL code:Note : searching the internet on T-SQL is also a great resource Example: In SSMS, Right Click on dbo.PERSON_ADDRESSS_VIEW->Script View as->Create to->New Query Editor window:

  11. Separating out multi-part key fields:Example: dbo.STUDENT_TERMS_VIEW SELECT LEFT(STUDENT_TERMS_ID,CHARINDEX('*',STUDENT_TERMS_ID+'*')-1) as STTR_STUDENT, LEFT(SUBSTRING(STUDENT_TERMS_ID,(CHARINDEX('*',STUDENT_TERMS_ID+'*')+1),999), CHARINDEX('*',SUBSTRING(STUDENT_TERMS_ID, (CHARINDEX('*',STUDENT_TERMS_ID+'*')+1),999)+'*')-1) as STTR_TERM, LEFT(SUBSTRING(SUBSTRING(STUDENT_TERMS_ID, (CHARINDEX('*',STUDENT_TERMS_ID+'*')+1),999), (CHARINDEX('*',SUBSTRING(STUDENT_TERMS_ID,(CHARINDEX('*',STUDENT_TERMS_ID+'*')+1),999)+'*')+1),999), CHARINDEX('*',SUBSTRING(SUBSTRING(STUDENT_TERMS_ID,(CHARINDEX('*',STUDENT_TERMS_ID+'*')+1),999), (CHARINDEX('*',SUBSTRING(STUDENT_TERMS_ID, (CHARINDEX('*',STUDENT_TERMS_ID+'*')+1),999)+'*')+1),999)+'*')-1) as STTR_ACAD_LEVEL FROM dbo.STUDENT_TERMS WITH (NOLOCK)

  12. Sub-Select:Example: dbo.ADMISSIONS_VIEW SELECT APPL_APPLICANT, APPLICATIONS_ID, (Select LAST_NAME from PERSON WITH (NOLOCK) where ID = APPL_APPLICANT) AS LAST_NAME, (Select FIRST_NAME from PERSON WITH (NOLOCK) where ID = APPL_APPLICANT) AS FIRST_NAME, (Select MIDDLE_NAME from PERSON WITH (NOLOCK) where ID = APPL_APPLICANT) AS MIDDLE_NAME, (Select NICKNAME from PERSON WITH (NOLOCK) where ID = APPL_APPLICANT) AS NICKNAME, …. FROM APPLICATIONS as ap1 WITH (NOLOCK) WHERE APPL_APPLICANT IS NOT NULL ORDER by APPL_APPLICANT

  13. Case Statement:Example: dbo.STUDENT_ACAD_PROGRAMS_VIEW SELECT … CASE WHEN IS_FPER_ALIEN = 'Y' OR IS_ETHNIC_ALIEN = 'Y' OR IS_RACES_ALIEN = 'Y' THEN 'Non-Resident Alien' WHEN IS_HISPANIC = 'Y' THEN 'Hispanic/Latino' WHEN RACE_COUNT >= '2' THEN 'Two or More Races' WHEN RACE_MAX = '1' THEN 'American Indian' WHEN RACE_MAX = '2' THEN 'Asian' WHEN RACE_MAX = '3' THEN 'Black or African American' WHEN RACE_MAX = '4' THEN 'Hawaiian/Pacific Islander' WHEN RACE_MAX = '5' THEN 'White' ELSE 'Unknown' END AS IPEDS_RACE_ETHNIC_DESC, ...

  14. Concatenated _LS records:Example: dbo.L20_ADDR_PERSON_VIEW SELECT ... , STUFF((SELECT '; ' + PLS.PER_ETHNICS FROM PERSON_LS PLS WITH (NOLOCK) WHERE PLS.ID = p.ID FOR XML PATH ('')),1,2,'') AS 'PER_ETHNICS' ,STUFF((SELECT '; ' + PLS.PER_RACES FROM PERSON_LS PLS WITH (NOLOCK) WHERE PLS.ID = p.ID FOR XML PATH ('')),1,2,'') AS 'PER_RACES‘ … FROM ADDRESS_LS as al WITH (NOLOCK) inner join ADDRESS as a WITH (NOLOCK) On al.ADDRESS_ID = a.ADDRESS_ID inner join PERSON as p WITH (NOLOCK) On RESIDENTS = p.ID WHERE RESIDENTS IS NOT NULL

  15. Computed Columns -vs- T-SQL code Using Computed Columns will s..l..o..wdown your reporting view. Use Computed Columns only if you are unable to use T-SQL code in place of the Computed Column, usually when a Computed Column calls a subroutine that cannot be rewritten in T-SQL due to the complexity. Examples: ,dbo.VW_S_CALC_AGE((select BIRTH_DATE from PERSON WITH (NOLOCK) where ID = STC.STC_PERSON_ID), GETDATE()) as 'AGE‘ ,dbo.STTR_ACTIVE_CRED(STUDENT_TERMS_ID) as 'STTR_ACTIVE_CRED‘ ,dbo.STTR_CUM_GPA(STUDENT_TERMS_ID) as 'STTR_CUM_GPA'

  16. Remember to use WITH (NOLOCK) on all FROM and JOIN statements: SELECT …. (SELECT CTRY_DESC FROM COUNTRIES WITH (NOLOCK) WHERE COUNTRIES_ID = CITIZENSHIP) AS 'CITIZENSHIP_DESC', (SELECT CTRY_DESC FROM COUNTRIES WITH (NOLOCK) WHERE COUNTRY = COUNTRIES_ID) AS 'COUNTRY_DESC‘ ….. FROM ADDRESS_LS as al WITH (NOLOCK) inner join ADDRESS as a WITH (NOLOCK) On al.ADDRESS_ID = a.ADDRESS_ID inner join PERSON as p WITH (NOLOCK) On RESIDENTS = p.ID WHERE RESIDENTS IS NOT NULL

  17. Create reporting views from UI (ESVS) See next slide for SQL Server script details

  18. if not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[L20_ADDR_PERSON_VIEW]') and OBJECTPROPERTY(id, N'IsView') = 1) exec ('create view [dbo].[L20_ADDR_PERSON_VIEW] as select ''Error'' c1, ''encountered'' c2, ''when'' c3, ''creating'' c4, ''L20_ADDR_PERSON_VIEW'' c5'); &execute& ALTER view dbo.L20_ADDR_PERSON_VIEW as Select RESIDENTS as ID ,(SELECT ADDR_EFFECTIVE_END from PSEASON WITH (NOLOCK) where PERSON_ADDRESSES = al.ADDRESS_ID and PSEASON.ID = p.ID) AS 'ADDR_EFFECTIVE_END‘ … &execute& Select statement from SSMS

  19. Deploying reporting views from UI (DSVS)

  20. Confirm reporting view was successfully created via SSMS (remember to refresh Views first)

  21. Test reporting view in SSMS and MS Query SSMS: Right Click on dbo.L20_ADDR_PERSON_VIEW -> Select Top 1000 Rows

  22. Test reporting view in SSMS and MS Query MS Query: Add table L20_ADDR_PERSON_VIEW and run queries against it:

  23. Move reporting view to Colleague Test If your view uses any computed columns, install those first! Otherwise the installation of your view will fail. In Dev, create a savedlist that includes the name of the view:

  24. Move reporting view to Colleague Test CDEC in Dev: Create a custom declaration to include the savedlist

  25. Move reporting view to Colleague Test CPKG in Dev: Create a custom package to include the custom declaration Then in MSUG in Test, install the package in a group

  26. Create data dictionary of reporting view The dictionary will aid the report writer in understanding what data the view can report • The dictionary also serves as a reference for IT in case future changes need to be made We are also documenting if a computed column is being used in the view.

  27. Have users test reporting view Testimonials: “A report that used to take me three hours to build now takes three minutes.” “I was able to send an email to 2700 students. I couldn’t have done without the reporting view.” You might need to make changes based on their feedback.

  28. Advantages of reporting views Create and manage reporting views using the Colleague software Can combine data from several tables Users do not need to know SQL language to join tables, the view does it for the users …and we in IT learned a lot and have become savvy in T-SQL!

  29. Disadvantages of reporting views • Do I need to show the testimonials again? • Our disadvantages are mainly limited to the free reporting tools that we use (MS Query, MS Access) • MS Query: the window is not expandable nor user-friendly • MS Access: the reports are not easily publishable

  30. THE END … • Questions? • Contacts: • Celeste McCormick - cmmccormick@lcsc.edu • Sandra Boyd – saboyd@lcsc.edu

More Related