Posts

Showing posts from August, 2024

Donate

Recursive CTE Not Getting Top Level Superseded Parts In T-SQL

Image
Hello, I've been given a task to get the superseded partnumber of a certain part. The scenario is, the chain of the superseded is undetermined and could go as has high as four or more levels. See screenshot below of an example of product supersession. It illustrates that the part supersession of part M03971 is M32887 instead of its direct parent M04880. Trying out the concept of recursive CTE gets only the lowest level instead without it's parent part supersessions. WITH SupersededBy_Cte AS ( SELECT [StdDescID], [PartNumber], [SupersededBY], 0 AS [ level ] FROM [tblStdDesc] std1 WHERE std1.SupersededBY IS NULL UNION All SELECT std2.[StdDescID], std2.[PartNumber], std2.[SupersededBY], cte.[ level ] + 1 FROM SupersededBy_Cte cte INNER JOIN [tblStdDesc] std2 ON std2.SupersededBY = cte.StdDescID ) SELECT cte.[StdDescID], cte.[PartNumber], cte.[SupersededBY], cte.[ level ] FROM SupersededBy_Cte cte WH

The EXECUTE Permission Was Denied On The Object - SQL Server Function

Image
Good day! I just recently restored a new database from the server and ran a script to create a T-SQL function. But when I called that function in C#.NET, it won't allow me to but instead returns a "The EXECUTE Permission Was Denied On The Object" error. To fix this issue, expand the database as to where the function was setup. Then click on the Security node -> Schemas -> dbo. When the Schema dialog opens, add the user name and set it's check the Grant checkbox of the Execute permission. After that, I can now successfully call the function from my .NET application. Cheers!

Font-Awesome Files Not Loading In Blazor Web Application In .NET 8

Image
Hello, As I was integrating the font-awesome library into Blazor Web Application, I noticed that the buttons were not showing the font-awesome icons. Upon checking through the browser console, the files such as fontawesome.css, regular.min.css and solid.min.css were not loaded even though they were referenced in App.razor component such as the code below. <head> <meta charset= "utf-8" /> <meta name= "viewport" content= "width=device-width, initial-scale=1.0" /> <base href= "/" /> <link rel= "stylesheet" href= "bootstrap/bootstrap.min.css" /> <link rel= "stylesheet" href= "app.css" /> <link rel= "icon" type= "image/png" href= "favicon.png" /> <link rel= "stylesheet" href= "~/lib/font-awesome/css/fontawesome.css" /> <link rel= "stylesheet" href= &

Bootstrap 5 Intellisense Not Working In Blazor Web Application Using Visual Studio 2022

Image
Hello, For some reason, the intellisense feature of Visual Studio 2022 does not work when typing bootstrap classes into the class tag of an element. The solution that I basically worked is the same approach for ASP.NET Core MVC projects which is to enable the "Use legacy Razor Editor for ASP.NET Core. and then restart the Visual Studio IDE as shown on the pic below. Cheers!

Donate