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

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -