E
E
Eugene2016-07-29 10:53:25
SQL
Eugene, 2016-07-29 10:53:25

How to set field size in ms sql view?

When a view is created, fields are automatically assigned a type and length. For example, the field is varchar(20), but I need it to be varchar(50).
Is it possible to manually specify the types and length of the fields?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Konstantin Tsvetkov, 2016-07-29
@tsklab

CAST( [FIELDvarchar(20)] AS varchar(50))

D
Dmitry Kovalsky, 2016-07-29
@dmitryKovalskiy

Please clarify the logic. You are asking for a field in the View that is set as a string of 20 characters (no more) and you want it to become a string of 50 characters. Did I understand you correctly? if so, do you understand that this is just filling the memory with garbage? Explain your problem - I can't immediately imagine your scenario requiring such an implementation.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question