Question

Bouje on Tue, 15 Dec 2015 21:28:19


This is easy to do in access. For example, in SQL view, I simply type "Dog" as [Type], and the query will automatically add a field called Type that has Dog in every record it returns. How do I do this in SQL Server? 

Sponsored



Replies

bhanu_nz on Tue, 15 Dec 2015 22:29:00


Hi,

You can do the same in SQL Server as well

CREATE VIEW test_vw AS SELECT *,'testText' AS test FROM [dbo].[table]

select * from test_vw

Hope this helps

Thanks

Bhanu