|
how did i add calender to my site
|
|
|
|
|
Wrong forum. You could find many HTML/javascript calendars in web. Please use Google.
thatrajaNobody remains a virgin, Life screws everyone
|
|
|
|
|
Dude's,
want to insert the values in one table(say bookingtable),
the remaining seats column in another table must be suitably updated.
Trying to concept using of Triggers. Can I go with the following way? but my table is not updated. Pls help on this.
CREATE TRIGGER Trgupdtsts ON Table_FB2
FOR INSERT
AS
DECLARE @FNo INT,
@DOJRNY DATETIME,
@RMNGSTS INT
SELECT @FNO = i.FNO,
@DOJRNY = i.DOJRNY
FROM inserted i;
set @RMNGSTS = ("need to insert logic here?")--'Record Inserted'
INSERT INTO TBL_FSTS
(FNO , DOJRNY , RMNGSTS)
VALUES (@FNO , @DOJRNY , @RMNGSTS)
--select @RMNGSTS from inserted
|
|
|
|
|
What is the logic for finding @RMNGSTS Values?
|
|
|
|
|
Hi prabu,
Want to update the Remaining seats in the another table. So I used @RMNGSTS as variable.
How to frame the entire queries? Is the above is correct?
|
|
|
|
|
Hi,
You need to insert same details to another table right, Use same Same logic. No need to assign a values in variable.
|
|
|
|
|
dude, didnt get your logic. Kindly send me the codes.
|
|
|
|
|
Another one with a crappy design, available seats should be an enquiry on the Bookingtable! while using a trigger spit may fix this issue the design should be fixed to remove the need for a trigger spit
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
One could get the opinion that you don't like triggers spit
"The ones who care enough to do it right care too much to compromise."
Matthew Faithfull
|
|
|
|
|
One of my earliest sql jobs was to track down a bug, it was in a trigger spit and it took me ages to find the bloody thing, that was over 25 years ago and I have not forgiven them their sins!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I don't like them either, I'm considering triggers and distinct as a sign that there is something wrong in the design and query respectively. Cannot always be without them, but I try hard.
"The ones who care enough to do it right care too much to compromise."
Matthew Faithfull
|
|
|
|
|
Friends,,
Atlast what is the exact solution? Everybody posting ur concerns, but I want answer
|
|
|
|
|
Create a stored procedure.
Pass the update information into the stored procedure via parameters then update the relevant tables via the stored procedure.
I would tend to agree with Mycroft spit that triggers can hide things from you when you are trying to debug a problem later on.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
One could get the impression that you don't like Mycroft.
"The ones who care enough to do it right care too much to compromise."
Matthew Faithfull
|
|
|
|
|
Hi all,
DECLARE @DocsList nvarchar(max);
SELECT @DocsList = STUFF(
(SELECT ', ' + quotename(Particulars)
FROM [101_SalaryParticulars]
GROUP BY Particulars
ORDER BY Particulars
FOR XML PATH(''))
, 1, 2, '');
I wants to change the above query dynamically. My table name will vary like '[102_SalaryParticulars]','[103_SalaryParticulars]' Etc.,
Software Engineer
AcSys IT Software Solution
|
|
|
|
|
kasimmohamed wrote: '[102_SalaryParticulars]','[103_SalaryParticulars]'
Then you deserve all the horror you are going to get with such a terrible design. You should have 1 table with different key for 102 and 103!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Mycroft Holmes wrote: You should have 1 table with different key for 102 and 103
I agree with your point, but it is not uncommon to see such design in OLAP databases.
|
|
|
|
|
It's also common to vary the query from code, and not try and do this in the database-server.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
And if he is mucking around with OLAP databases and can't work out how to concatenate a string then they have bigger problems!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi Everyone,
I'm writing a report and there is a requirement to have repeating fields appearing inline. So rather than a table displaying say, user names, the final report should look like this:
Static text Static text Static text:
Person Name 1, Person Name 2, Person Name 3
I've had a long look, I've tried changing the properties of the table, I've tried playing with expressions.
Does anyone have any ideas?
Many thanks,
Larry
|
|
|
|
|
|
Thanks I'll have a look.
I actually got round the problem by writing a stored procedure and putting my output into a string.
|
|
|
|
|
Friends,
Iam using Persisted Primary key constraint for one column in a table.
while creating another table using of the above table column as reference constraint getting the following error.
"There are no primary or candidate keys in the referenced table that match the referencing column list in the foreign key."
How could I resolve this issue?
|
|
|
|
|
What database are you using, candidate key does not sound familiar.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|