Create View based on condition in SQL Server -



Create View based on condition in SQL Server -

this question asked several times, cann't figure out things.

first, have situation need create view (must view), according result of 1 query.

create view if (select count(oid)...)>1 select1 else select2

i know form not allowed. how can accomplish this? have tens of views need create. because these select statements contain spatial conditions, , database big , has many many tables, need 'most optimal' solution, or query forever.

i read using stored procedures , ud functions, how create view them , max performances? don't need parameters in it, way create views defined condition.

you can have view phone call stored procedure.

create view conditionalview execute sp_conditionalview

then set conditional code in stored procedure.

sql sql-server stored-procedures view user-defined-functions

Comments

Popular posts from this blog

maven fortify plugin : Unable to load build session with ID XXXXX .. See log file for more details -

c# - Primavera WebServices does not return any data -

android - Display emoji panel with genymotion - keyboard/touch input? -