Posts

Showing posts from 2017

Create SSRS Drill Down Report

In this blog, we are going to learn about how we can create SSRS drill down report, please refer steps as following: To create a report server project Open SQL Server Data Tools. On the File menu, point to New, and then click Project. In the Installed Templates list, click Business Intelligence. Click Reporting Services. Click Report Server Project. If you do not see the "Business Intelligence" or "Report Server Project" options, you need to update SSDT with the Business Intelligence templates. In Name, type "ProductReports". Click OK to create the project. The ProductReports project is displayed in Solution Explorer. To create a new report definition file In the Solution Explorer pane, right-click the Reports folder, point to Add, and click New Item. If the Solution Explorer window is not visible, from the View menu, click Solution Explorer: In the Add New Item window, click Report. In Name, type “OrderReport.rdl” and then click

Pass data to ASP.NET Web Service (ASMX) from Cross-Origin

Image
In this blog, we are going to create “Hello World” ASP.Net Web Service (ASMX) with parameter and allow request from cross-origin. Now here we implement ASP.Net Web Service from Visual Studio 2017.   We have created empty ASP.Net Web Application solution and added “demo.asmx” in solution. Then, added code for “HelloWorld” method with “name” parameter as mention below snippet: [WebMethod]      [ScriptMethod(ResponseFormat = ResponseFormat.Json)]      public   string  HelloWorld( string  text)      {      return   "Hello World "  + text;      }   We will invoke this web service using HTTP verb. So, we defined “ScriptMethodAttribute” for set response format JSON. We need to enable script service to invoke & pass parameter in Web Service from script as shown in below screenshot: Then set demo.asmx as startup page and run/test this web service on IIS: Below is example of “Helloworld” webservice: Now we will create a

SQL Server Database Permission Scripts

#1 - Script to get list of all database name and its user in SQL Server USE MASTER   GO      SELECT  SL.dbname  AS   'Database Name' ,SL. name   AS   'User Name' ,SP.type_desc  AS   'Login Type' ,  SL.denylogin, SL.hasaccess, SL.isntname, SL.isntname, SL.isntgroup, SL.isntuser, SL.sysadmin,   SL.securityadmin, SL.serveradmin, SL.setupadmin, SL.processadmin, SL.diskadmin, SL.diskadmin,   SL.dbcreator, SL.bulkadmin  FROM  sys.server_principals  AS  SP   INNER   JOIN  sys.syslogins  AS  SL  ON  SP.SID = SL.SID   #2 - Script to get list of all database users and their roles in SQL Server Use Master   GO      exec  sp_msForEachDb ' use [?]   select  db_name()  as  [Databast  Name ], r.[ name ]  as  [Role], p.[ name ]  as  [Member  Name ],   p.[default_schema_name]  as  [ Schema ],p.[principal_id]  as  [Principal Id]   from    sys.database_role_members m   join    sys.database_principals r  on  m.role_principal_id = r.principal_id   joi