Versions Compared

Key

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

Creating for blank databaseUpdating from previous versions
VersionTable structureDataSQL login creationUpgrade table structure from previous versionUpdate data from previous version
2.2.x

View file
nameepiCentre2.2 - Create datatables.sql
height150

View file
nameepiCentre2.2 - Insert records.sql
height150

View file
nameepiCentre_login_creation.sql
height150

View file
namedatatablesAlter_v2.2.sql
height150

View file
namedatarecordAlter_v2.2.sql
height150

2.1.xN/AN/A

View file
namedatatablesAlter_v2.1.sql
height150

View file
namedatarecordAlter_v2.1.sql
height150

2.0.xN/AN/AN/AN/A



Useful troubleshooting scripts

Check Role Membership

Code Block
languagesql
SELECT    roles.principal_id AS RolePrincipalID
,roles.name AS RolePrincipalName
,database_role_members.member_principal_id AS MemberPrincipalID
,members.name                                AS MemberPrincipalName
FROM sys.database_role_members AS database_role_members  
JOIN sys.database_principals AS roles  
  ON database_role_members.role_principal_id = roles.principal_id  
JOIN sys.database_principals AS members  
  ON database_role_members.member_principal_id = members.principal_id;  
GO



Check Logins in azure

Code Block
languagesql
SELECT *  FROM sys.sql_logins -- you need to execute this on master azure db
SELECT * FROM sys.database_principals -- you need to execute this on the database of interest


Code Block
languagesql
SELECT DP1.name AS DatabaseRoleName,   
   isnull (DP2.name, 'No members') AS DatabaseUserName   
FROM sys.database_role_members AS DRM  
RIGHT OUTER JOIN sys.database_principals AS DP1  
   ON DRM.role_principal_id = DP1.principal_id  
LEFT OUTER JOIN sys.database_principals AS DP2  
   ON DRM.member_principal_id = DP2.principal_id  
WHERE DP1.type = 'R'
ORDER BY DP1.name;