Showing posts with label mssql. Show all posts
Showing posts with label mssql. Show all posts

Tuesday, March 20, 2012

Query to return certain result if meet requirement

Hi,
Is there anyway to query 7 table from MSSQL , If any of the table consist of 0 then the value 0 is return. If all 7 table dont consist 0 value in the table, value 1 is return

Regards
Mandrakeooi

Quote:

Originally Posted by Mandrakeooi

Hi,
Is there anyway to query 7 table from MSSQL , If any of the table consist of 0 then the value 0 is return. If all 7 table dont consist 0 value in the table, value 1 is return

Regards
Mandrakeooi


Try

select case count(*) when 0 then 1 else 0 end
from (
select myColumn from table1 where myColumn=0
union all
select myColumn from table2 where myColumn=0
union all
...
select myColumn from table7 where myColumn=0)

Saturday, February 25, 2012

Query Time Out Expired

I am using a School Management software with MSSql Server 2005 software is working well on the server but it is not accessible on network. we using wareless network....Open [Start> All Programs> Microsoft SQL Server 2005> Configuration Tools> SQL Server Surface Area Configuration], select [MSSQLSERVER> Database Engine> Remote Connections], make sure that "Local and remote connections" option is selected.