When creating a view in SQL Server, the view’s metadata is not being maintained automatically. This means if a source table’s columns are updated,
SELECT * in a view would not return the updated columns.
See this post for example.
Possible solutions are:
- Create the view with a SCHEMABINDING option. See here. View with this option enabled won’t allow `SELECT *`, forcing developer to enter explicit columns.
- Related to previous solution, just don’t use `SELECT *`, explicitly define columns to return.
- Refresh the view’s metadata information with `EXEC sp_refreshview N’dbo.viewName’`
SQL Server 2016 SP2
SQL Server Management Studio 14.0
To refresh SQL Server view, run following script:
EXEC sp_refreshview N'dbo.vwClass'
Example of issue with SQL Server view.
I have following table.
And a view called
For the reasons unknown to me, when I right click on the view and choose ‘Select Top 1000 Rows’, the query does not return entire column of
Class table. Instead, it return following:
After I run refresh view command above, the view return correct result.
Other possible solution maybe to avoid using
SELECT * in a SQL Server view.
Have heard about Blazor? If not, definitely check this post out. For those who already use Blazor, you can skip. Unless you also want to understand the inner working of Blazor.
Azure has feature to tag your resources for some times now. But, how do you use it the right way? This post will explain.
Interesting question and could be one of those questions as well. The answer is: it depends. Do read more to understand the details.
I came across Mediator pattern and has since been intrigue by it. This post will explain what’s it and why do you need it.
The essence of writing codes is not _just_ for computer to interpret and run it. Equally, if not more, importantly is for human to understand and maintain it. C# 8 features will help to do just this by increasing the quality.
A rather long and detailed post about Angular and PWA (Progressive Web App), but worth the read, especially if you haven’t heard about PWA. It covers the 101 stuff and goes on to creating PWA using Angular.
Great new offering from Azure. If you always RDP to your VM in Azure, or use a _’jump box’_, you will have a new, better, more secure way to RDP now. I really like the name too!
They are great lessons software engineers can adopt to become better. Not a technical post, but related to technical. It’s more of philosophical-type post, which is always good to know.
There’s a new kid in town, it’s called `System.Text.Json`. Michael goes over how the comparison between this new .NET Core 3 feature and other JSON libraries, including the infamous Json.NET. And yes, it cover performance test as well.
Have you ever got one of those annoying, `Could not load file or assembly or one of its dependencies` error when running .NET locally? Not only Michael explains why, but he also tell you how to resolve it. Mystery solved.
An Azure post about big data architecture. If you are about to start one, this is a good introduction. It mainly focuses on Lambda architect (batch and speed layers) using Azure resources.
And if you are now serious about PWA, check this article out on what’s the ‘right’ frontend database for your app. Very useful especially when you are starting a new project.
Now you know what’s PWA, you can turn your existing Angular app into a PWA. Looks pretty straigh-forward honestly. But the devil is always in the details, right?
You can’t talk about PWA without Electron app. But, what’s the difference? Well, check this post out to find the answer. In short, they are like siblings, similar but different.
The two are often used interchangeably, but this post will explains in details what’s the difference, the techniques one use and the use cases.
This is a pretty ‘basic’ read about machine learning vs data science. But even when it’s ‘basic’, it still offers pretty deep knowledge. If you just get started on machine learning, do read this. My key takeaway is: focus more on the intuition and geometric interpretation.
Linear algebra is a bigger subject in mathematics and in this post, Khyati explains what parts of linear algebra are used in machine learning and, more importantly, how’s it being used.
With ever raising complexity of microservices and APIs, it’s important to ensure your services are up. This post explains what you need to test to do just that.
We C# devs are so used to the language that sometime we forget what NOT to do, these are the gotchas we need to pay attention to. It’s one of those ‘going-back-to-basic’ type of post, which is always useful.