SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 How to get value from more than one table
 New Topic  Reply to Topic
 Printer Friendly
Previous Page
Author Previous Topic Topic Next Topic
Page: of 2

Arunavally
Yak Posting Veteran

India
58 Posts

Posted - 10/24/2013 :  00:47:04  Show Profile  Reply with Quote
i displayed all the records,

EnqId Name Contactcnumber status Date

My query is Select * from Enquiry where Date between @dd and @tt

When i run the form, first display this error. after may i continue means i wl get result. bt ths error is coming all times

Kindly help me.
Go to Top of Page

Arunavally
Yak Posting Veteran

India
58 Posts

Posted - 10/24/2013 :  01:21:24  Show Profile  Reply with Quote
I displayed all the records in Enquiry DB

EnquiryId (PK) Name ContactNumber Status date

I used this query
select * from Enquiry where date between @dd and @tt

When i run this form, I get the above error. Bt i can view my result if i continue to run.

How can i resolve this error?
Kindly help me?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 10/24/2013 :  01:26:06  Show Profile  Reply with Quote
Hmm..This has no relation to creation of constraints which was what error suggested. The error you posted will come only when you're trying to create a constraint o table.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

Arunavally
Yak Posting Veteran

India
58 Posts

Posted - 10/24/2013 :  04:50:29  Show Profile  Reply with Quote
Thank you. I assign null value to field. So i correct that field. It worked well
Go to Top of Page

Arunavally
Yak Posting Veteran

India
58 Posts

Posted - 10/24/2013 :  04:51:33  Show Profile  Reply with Quote
Hai, How to use arithmetic calculations in sql trigger?

Kindly help me.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 10/24/2013 :  08:49:52  Show Profile  Reply with Quote
quote:
Originally posted by Arunavally

Hai, How to use arithmetic calculations in sql trigger?

Kindly help me.


Just like you do it in any sql code
which calculation you're trying to do?


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

Arunavally
Yak Posting Veteran

India
58 Posts

Posted - 10/25/2013 :  10:50:14  Show Profile  Reply with Quote
Hai,

I used this trigger. When i insert Fees table after that this trigger will executed.

But first time only execute this trigger. I dnt knw what mistake i did?

This is my trigger.

ALTER trigger [dbo].[Fees_FeeBalance_insertion]
on [dbo].[Fees] for insert
as
begin
declare @id varchar(20),@total money,@Amt money,@SFee money, @Duedate varchar(20), @fee money,@bal money,@Paydate varchar(20)
select @id=Stid,@Amt=AmtPaid,@Paydate=PaidDate,@Duedate=DueDate from inserted
select @SFee=Fees from Batch
if not exists (select SId from FeeBalance )
begin
set @bal = @SFee-@Amt
insert into FeeBalance values(@id,@Amt,@bal,@Duedate)
end
else
begin
select @fee=Total from FeeBalance
set @bal = @SFee - (@fee +@Amt)
update FeeBalance set Total=@Amt+@fee,Balance=@bal,DueDate=@Duedate where Sid=@id
end
update StudReg set UpdationDate=@PayDate where StudReg.StuId = @id
end

If any reference field is need this case?

Kindly help me.


Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 10/25/2013 :  22:57:20  Show Profile  Reply with Quote
Answered in the separate thread opened

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Previous Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.11 seconds. Powered By: Snitz Forums 2000