本文介绍了如何检查sql server 2008中的空表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞!CREATE procedure [dbo].[ReportByDate]( @StartDate DATE, @EndDate DATE, @Email nvarchar(40) )asbeginIf exists(select 1 from tblWorkExpDetails)beginselectpd.FirstName,pd.LastName,pd.Mobile,pd.Email,pd.Sources,ed.XthPercentage,ed.XIIthPercentage,wed.CurrentSalary,wed.TotalExperiencefromtblPersonalDetails pdInner Join tblEducationalDetails ed on pd.Email=ed.EmailInner Join tblWorkExpDetails wed on pd.Email=wed.Emailwhere pd.JoinDate Between @StartDate and @EndDateendelse if exists(select 1 from tblFresherDetails)selectpd.FirstName,pd.LastName,pd.Mobile,pd.Email,pd.Sources,ed.XthPercentage,ed.XIIthPercentage,fd.TypingfromtblPersonalDetails pdInner Join tblEducationalDetails ed on pd.Email=ed.EmailInner Join tblFresherDetails fd on pd.Email=fd.Emailwhere pd.JoinDate Between @StartDate and @EndDateend; - 此查询仅返回tblWorkExpDetails表中存在的那些记录。帮助我!--This query only returns those records which are present in tblWorkExpDetails table. Help me !推荐答案SELECT sc.name +'.'+ ta.name TableName,SUM(pa.rows) RowCntFROM sys.tables taINNER JOIN sys.partitions paON pa.OBJECT_ID = ta.OBJECT_IDINNER JOIN sys.schemas scON ta.schema_id = sc.schema_idWHERE ta.is_ms_shipped = 0 AND pa.index_id IN (1,0)GROUP BY sc.name,ta.namehaving SUM(pa.rows)=0ORDER BY SUM(pa.rows) DESC 这篇关于如何检查sql server 2008中的空表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-15 17:26