Problem:
Create a column in a table and that should give an error
if we give SELECT * or SELECT of that column
Solution:
Friends, don’t think toooooo much like how to solve this
problem. Here is the simple solution that I got.
Just use any computed column and that should not have
any syntactical errors but it should have logical error (E..g 1/0, 1+’srinivas’)
Sample Script:
create table #test
(id1 int,id2 int,Col1 as id1+'srinu')
select * from #test
Here We
will get
Conversion
failed when converting the varchar value 'srinu' to data type int.
That’s all friends……!
Thanks for reading this article and
please post a comment if you have any questions/thoughts