User Specific Reporting with SQL Azure Reporting Services - sql

Is there any solution to user-specific reporting with Azure SSRS? I have an Azure database with a user table and only want my reports to query data pertaining to the user.
Any tips/alternatives would be greatly appreciated.

Windows Azure SSRS supports the User!UserID property so you can use it for user-specific reporting and that would be the easiest way to get it done.
Also about filtering SQL query using the user_name() may work or not. If you use ‘Stored Credential’ option for the RS data source, the same credential will be shared by multiple users. In that case, you can’t rely on user_name(). If you use ‘Prompt’, and if each user needs to supply a unique credential for himself or herself, then you can use user_name().

Does Azure SSRS support the User!UserID property? If not, you should be able to filter in the SQL query using the user_name() function.

these guys actually implemented user specific SQL queries in their report. check it out:
http://www.upsizing.co.uk/Art68_ReportViewerControlAndSQLAzure.aspx

Related

SQL Conditional Alerts

I am new to SQL and use Azure Data Studio for data analysis. I am trying to setup a conditional email/text alert when a column value is greater than a given value in my SQL database. I am confused how to go about this... would I use SMTP, Azure monitor, etc.?
I have looked into Azure monitor, but it seems that it is more commonly used for alerts regarding the performance of a database and not the values contained within the database.
It is possible to send an email message from SQL Server using the sp_send_dbmail system proc.
This is documented at Microsoft

How do we check how often someone is running queries in Azure SQL?

We have to collect some information. How do we check how often someone is running queries in Azure SQL?
Use extended events to trace all the queries running on your Azure SQL database. Also, you can save the output in a file and can query from clients tools like SSMS.
You can also use auditing provided by Azure SQL. Please check below link for details:
https://learn.microsoft.com/en-us/azure/azure-sql/database/auditing-overview#:~:text=Go%20to%20the%20Azure%20portal,modify%20the%20server%20auditing%20settings.

How to query AAD Security Group Membership from Azure SQL

I'm trying to find a way from within Azure SQL to either 1) enumerate members of an Azure Active Directory security group or 2) check if a user login is a member of an SG. I've found various articles about doing it from a domain joined standalone SQL installation but not from Azure SQL. Most of the samples for the standalone installation use system sprocs like xp_cmdshell which don't exist in Azure SQL. I know I can create an Azure Function or Logic App to sync users to a table but I'd like to avoid using an external process to do this if possible.
#Kalyan Chanumolu-MSFT's comment should be very helpful to you. This scenario is not supported today.
You can try to use his suggestion.
You will have to talk to Microsoft Graph API from an intermediate like an Azure function to relay the data to Azure SQL Database.
You also can raise a support ticket to confirm it and also can put forward your suggestions in the feedback.

SQL Server 2008 RS Roles multiple databases

I have a front end application needs access to 3 different SQL Server databases:
1st. database read/only
2nd. database read/write
3rd. database read/write
The user’s logins that will be using the database/application are using Windows authentication.
This application also calls a few SQL jobs that need to run.
What I would like to do is set up role to accomplish this and then easily map users to the role as needed.
Is there a way to do this in SQL Server 2008 R2?
Is there a better or easier approach?
I'm trying to avoid need to explicitly set up each user.
Thanks
Create an AD Group for your application. Get the DBA to hand out the appropriate permissions to the AD Group. Then have the Service-Desk add users to the AD Group as the business requires it.

SQL Server 2005 query results differ for different AD accounts using same SQL login

There are two AD accounts, admin1 and admin2. Both are logged in to identical machines, both open SQL Server Management Studio and log in as the same SQL user to the same SQL server (using SQL Server Authentication, NOT using Integrated Security), and both run an identical query: "SELECT * FROM View1". However, admin1 receives many results (the correct result set), whereas admin2 receives an empty result set. This happens on every computer in the domain, regardless of windows version, wired/wireless connection, etc.
Why is this happening? Shouldn't SSMS be Windows account agnostic when using SQL Server Authentication? Any help would be appreciated.
The issue I had was a result of Microsoft Dynamics CRM, not SQL Server itself. I was using Filtered views, which return zero results to any user not using Windows authentication. I am not sure how I got the results I mentioned above, but trying again another day, I was never able to get results with SQL authentication, no matter what Windows account I was using. Likewise, I was always able to get results when logged in with Windows authentication.
You can either use the raw tables or hack the underlying view framework by inserting records manually that show the domainname as your SQL Server Authentication login id and granting not the CRMReaderRole but the standard DQL Role. Take a peek at the wonderful fn_FindUserGuid function which looks up the SystemGuid which the views all inner join to. Just fabricate this record and a few others and your good. If you reverse engineer their system you will see there is a way to trick the system.
Its essentially just the SystemUserBase, SystemUserPrincipals, UserSettingsBase.
Obviously this is not Microsoft recommended. ¯(°_°)/¯ But when you need an ODBC connection on a shared server which provides generic reports to many users outside of the wonderful CRM world you need to do this. You will NOT find another way outside of replicating data to another database but of course keep in mind dynamics is wonderfully dynamic and changes often. Good luck syncronizing environments.
In my opinion this system was obviously designed this way to sway users towards Microsoft products. Not saying I wouldn't do the same if I owned Microsoft. When you're forced to hack your forced to hack.