Skip to content

Instantly share code, notes, and snippets.

@hanleybrand
Last active August 29, 2015 14:13
Show Gist options
  • Save hanleybrand/302aa1f5ddff5cd45120 to your computer and use it in GitHub Desktop.
Save hanleybrand/302aa1f5ddff5cd45120 to your computer and use it in GitHub Desktop.
Blackboard Learn - fix weird portal problems for single user (t-sql)
Declare @Users_PK1 INT
Declare @User_ID varchar(50)
Set @User_ID = 'username' -- User name here, e.g. bobsmith
Select @Users_PK1 = PK1 from users where user_id = @User_ID
--Delete Module Preferences from Users
DELETE from PORTAL_EXTRA_INFO where portal_viewer_pk1 in (
Select pk1 from PORTAL_VIEWER where USERS_PK1 = @Users_PK1
)
--Delete Modules from user
Delete from PORTAL_VIEWER where USERS_PK1 = @Users_PK1
--Reset to default (copies structure from semnr10
insert into PORTAL_VIEWER(CRSMAIN_PK1, PORTAL_VIEWER_TYPE, USERS_PK1)
Values (NULL, 'U', @Users_PK1)
SELECT TOP 1000 [CRSMAIN_PK1]
,[PK1]
,[PORTAL_VIEWER_TYPE]
,[USERS_PK1]
FROM [bb_bb60].[dbo].[PORTAL_VIEWER] where USERS_PK1 = 76682
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment