Showing posts with label sql. Show all posts
Showing posts with label sql. Show all posts

Tuesday, February 9, 2016

How to find references to a field in SQL backend

This query will give you a good list of reference on a particular field. You can find all references to it from processes and screens. This requires you to have a SQL backend and a studio to query the database. Replace 'APPLICATIONS.ID' with name of the field you want to find reference.

declare @fieldName as varchar(20) = 'APPLICATIONS.ID'
SELECT PROCESS_NAME as 'Process ID', PROCESS_TYPE as 'Process Type', PROCESS_DIRECT_ACCESS_NAME as 'UI Mnemonic' from PRCS_DEF A left JOIN PRCS_CTL B
ON A.PROCESS_NAME = B.PROCESS_MNEMONIC
where PROCESS_DATA_ELEMENTS like '%'+@fieldName+'%' or
PROCESS_DEMAND_ELEMENTS like '%'+@fieldName+'%' or PROCESS_DEMAND_POINTERS like '%'+@fieldName+'%'
ORDER BY PROCESS_DIRECT_ACCESS_NAME DESC, PROCESS_TYPE 

The result would look something like this:


Thursday, May 16, 2013

How to test computed column in MS SQL Server Management Studio


To test computed column, I would fire up SQL server management studio, in Object Exploere, drill down to your dev/test/prod database, then to Programmability, then Functions, then Scalar-valued Functions. Mine is:

Colleague18_test_db/Programmability/Functions/Scalar-valued Functions/

For example, to test out computed column C70_PER_TODAYS_DATE, which takes a PERSON.ID as an argument, here is the query I would use:

SELECT [colleague18_test_db].[dbo].[C70_PER_TODAYS_DATE] ('myIDNumber')

If you don't see your computed column in Scalar-valued Functions, I recommend recompiling/reinstalling the computed column again.