Usually I run a script like this:
ALTER TABLE [TABLE]
ALTER COLUMN [Column] NVARCHAR(40);
The result is that the field in the table gets converted to nvarchar. But what is the syntax for doing the same thing for a view? Or is that even possible?
Change data types in Design viewLocate the field that you want to change, and select a new data type from the list in the Data Type column. Save your changes.
To modify table data through a view. In Object Explorer, expand the database that contains the view and then expand Views. Right-click the view and select Edit Top 200 Rows. You may need to modify the SELECT statement in the SQL pane to return the rows to be modified.
The altered view replaces the existing view, so you cannot modify specific columns in a view.
We cannot insert or update data using view. The view is a virtual table. We can do those action, but it's effect on real table data too. View is like a virtual table which enable us to get information of multiple tables.
Sure
CREATE VIEW AView
AS
SELECT CAST(title AS char(50))
FROM titles
So check out CAST and also CONVERT on the msdn pages for full info
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With