Skip to content

Tag: sql-server-2012

How to select data where more than one column is populated

I have a sample table, called [SAMPLES] which I’ve added multiple columns to the end for different types of lab analysis results, however for the majority of samples only one analysis has been completed. I want to be able select only the samples where more than one analysis has been completed on the sam…

IF when zero result from another Stored Procedure

I have a Stored Procedure which contains an Insert statement on it. From the above Stored Procedure, I want to have a condition from result of another Stored Procedure. With the following action: So, if cBranch is zero. Then execute Sp1 else do nothing. Need advice please. Really appreciated. Answer Try This: