Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Alias Problem

Author  Topic 

shubhada
Posting Yak Master

117 Posts

Posted - 2006-06-13 : 01:49:54
How I can alias the view at the time of creation?

shubhada

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-06-13 : 02:02:15
What do you mean by alias View at creation? You can use Alias name for View if you use it in query

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

shubhada
Posting Yak Master

117 Posts

Posted - 2006-06-13 : 02:13:58
I have select query that have more than 2000 character. When this query exceeds more than 2000 character then it returns no records. So I want to reduce this size of query.

shubhada
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-06-13 : 04:13:39
quote:
Originally posted by shubhada

I have select query that have more than 2000 character. When this query exceeds more than 2000 character then it returns no records. So I want to reduce this size of query.

shubhada



Are you using DYNAMIC SQL?

Post query here.

Peter Larsson
Helsingborg, Sweden
Go to Top of Page

shubhada
Posting Yak Master

117 Posts

Posted - 2006-06-13 : 04:30:36
SELECT DISTINCT vcmPayVarRpt.PayerID, vcmPayVarRpt.ContractID, vcmPayVarRpt.ClaimID, vcmPayVarRpt.PatientName, vcmPayVarRpt.Facility, vcmPayVarRpt.Entity, vcmPayVarRpt.CoverChrgAmt, vcmPayVarRpt.TotalAdjReimAmt, vcmPayVarRpt.PatientType, vcmPayVarRpt.FinClass, vcmPayVarRpt.InsuranceCo, vcmPayVarRpt.BillDate, vcmPayVarRpt.PaymntMailDt, vcmPayVarRpt.ASCDRG, vcmPayVarRpt.Outlier, vcmPayVarRpt.Coinsurance, vcmPayVarRpt.Deductible, vcmPayVarRpt.CalcTotalReimAmt, vcmPayVarRpt.DedCoinsInd, vcmPayVarRpt.PaymntDRG, vcmPayVarRpt.PaymntOutlier, vcmPayVarRpt.CoinsurancePd, vcmPayVarRpt.DeductPd, vcmPayVarRpt.PaymntAmt, vcmPayVarRpt.AddtlPayment, vcmPayVarRpt.DiscPenaltyAmt, vcmPayVarRpt.EventID, vcmPayVarRpt.StmtFromDate, vcmPayVarRpt.BillFreq, vcmPayVarRpt.ActivityInd, vcmPayVarRpt.ReimProcessDate, vcmPayVarRpt.PaymntVarInd, vcmPayVarRpt.PaymntVarIndDate, vcmPayVarRpt.ClaimMatchDate, CycleClaim.VarianceAmt, CycleClaim.PaymntAmt, CycleClaim.CalcTotalReimAmt, vcmPayVarRpt.CycleID, vcmPayVarRpt.PatientProcessType, vcmPayVarRpt.PayFollowUp, vcmPayVarRpt.LastProcessDate, vcmPayVarRpt.LastPaymentDate, ClaimAppeals.AppealDispInd, vcmPayVarRpt.FinalPaymentFlag FROM ((huntingtonBeta1.dbo.vcmPayVarRpt vcmPayVarRpt LEFT OUTER JOIN huntingtonBeta1.dbo.CycleClaim CycleClaim ON vcmPayVarRpt.CycleID=CycleClaim.CycleID) LEFT OUTER JOIN huntingtonBeta1.dbo.vcmPayVarClmAppl vcmPayVarClmAppl ON (vcmPayVarRpt.ClaimID=vcmPayVarClmAppl.ClaimID) AND (vcmPayVarRpt.EventID=vcmPayVarClmAppl.EventID)) LEFT OUTER JOIN huntingtonBeta1.dbo.ClaimAppeals ClaimAppeals ON ((vcmPayVarClmAppl.ClaimID=ClaimAppeals.ClaimID) AND (vcmPayVarClmAppl.EventID=ClaimAppeals.EventID)) AND (vcmPayVarClmAppl.InstanceNo=ClaimAppeals.InstanceNo) WHERE vcmPayVarRpt.CycleID IS NULL AND vcmPayVarRpt.ContractID='AETNA 04' AND (vcmPayVarRpt.StmtFromDate>={ts '2005-01-19 00:00:00'} AND vcmPayVarRpt.StmtFromDate<{ts '2006-01-20 00:00:00'}) AND (vcmPayVarRpt.PaymntVarInd='O'

shubhada
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-06-13 : 05:33:39
Not sure if you have issues with that. You can define alias name for vcmPayVarRpt as V and CycleClaim as C use them



SELECT DISTINCT V.PayerID, V.ContractID, V.ClaimID, V.PatientName,
V.Facility, V.Entity, V.CoverChrgAmt, V.TotalAdjReimAmt,
V.PatientType, V.FinClass, V.InsuranceCo, V.BillDate,
V.PaymntMailDt, V.ASCDRG, V.Outlier, V.Coinsurance,
V.Deductible, V.CalcTotalReimAmt, V.DedCoinsInd, V.PaymntDRG,
V.PaymntOutlier, V.CoinsurancePd, V.DeductPd, V.PaymntAmt,
V.AddtlPayment, V.DiscPenaltyAmt, V.EventID, V.StmtFromDate,
V.BillFreq, V.ActivityInd, V.ReimProcessDate, V.PaymntVarInd,
V.PaymntVarIndDate, V.ClaimMatchDate, C.VarianceAmt, C.PaymntAmt,
C.CalcTotalReimAmt, V.CycleID, V.PatientProcessType, V.PayFollowUp,
V.LastProcessDate, V.LastPaymentDate, ClaimAppeals.AppealDispInd, V.FinalPaymentFlag
FROM ((huntingtonBeta1.dbo.vcmPayVarRpt V LEFT OUTER JOIN huntingtonBeta1.dbo.CycleClaim C ON
V.CycleID=C.CycleID) LEFT OUTER JOIN huntingtonBeta1.dbo.vcmPayVarClmAppl vcmPayVarClmAppl
ON (V.ClaimID=vcmPayVarClmAppl.ClaimID) AND (V.EventID=vcmPayVarClmAppl.EventID))
LEFT OUTER JOIN huntingtonBeta1.dbo.ClaimAppeals ClaimAppeals ON ((vcmPayVarClmAppl.ClaimID=ClaimAppeals.ClaimID)
AND (vcmPayVarClmAppl.EventID=ClaimAppeals.EventID)) AND (vcmPayVarClmAppl.InstanceNo=ClaimAppeals.InstanceNo)
WHERE V.CycleID IS NULL AND V.ContractID=AETNA 04 AND (V.StmtFromDate>={ts 2005-01-19 00:00:00} AND V.StmtFromDate<{ts 2006-01-20 00:00:00})
AND (V.PaymntVarInd)=O



Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

shubhada
Posting Yak Master

117 Posts

Posted - 2006-06-13 : 06:55:22
actually my select query is created at report side and where is passing from VC++ code .when I used alias in where clause in vc++ code like where V.CycleID IS NULL AND V.ContractID=AETNA 04 AND (V.StmtFromDate>={ts 2005-01-19 00:00:00} AND V.StmtFromDate<{ts 2006-01-20 00:00:00})
AND (V.PaymntVarInd)=O
then I got the error invalid object name V & C

shubhada
Go to Top of Page
   

- Advertisement -