find out how users are getting their permission for a specific database

This morning, I was working with a dev.  He was trying to use SQL Compare and it said he didn’t have view definition permission.  I was looking thru the security group for the specific database and could identify which group he was in.  I ran the following script and was able to find him:

EXECUTE AS LOGIN = ‘domainA\UserA’
SELECT * FROM fn_my_permissions (NULL, ‘DATABASE’);
SELECT * FROM sys.user_token

The user_token view will tell you what group or role the user is part off.  The fn_my_permissions(null,’database’) will tell you what permissions you have for that specific database.

AlwaysOn Availability Group: cannot connect to secondary node

A few days ago, a coworker brought online a new AlwaysOn Availability Group (aoag) on sql 2012.  She added both nodes (node1 and node2) via the gui.  Everything completed okay.  Then we looked at the Available Replica hive and found that the second node had a little red ‘x’ next to it.  It said something along the line of node1 not able to connect to node2.  After some looking around, I found that the endpoint wasn’t present.

I had her create the endpoint on both SQL servers and that fixed the problem

Continue reading

Lightroom 5 or 6 – import photos on a usb drive to a catalog stored on a usb drive

I used to store all my photo a huge buffalo drive.  A friend of mine recently lost all of his family photos when his usb drive crash.  He didn’t have any backup.  I have my files backup to amazon cloud.  Now I want to be able to download my raw files from amazon cloud to my surface pro’s microSD card and edit the photos using Lightroom.

I went into Lightroom and created a new catalog on the microSD and tried to import the photos on the microSD into the catalog on the microSD card.  Lightroom apparently doesn’t like that.  After dicking around with it for 30 something minutes and looking online, no one had an answer or i wasn’t using the correct term.

In the end, I found my own solution.  And the solution is very simple.  Close Lightroom.  used disk management to mount a folder under Pictures to the microSD.  Open Lightroom, Import photo from the mount folder, which tricks Windows and allow you to import into a catalog on the MicroSD.