|
Nice try, but this wouldn't work because it doesn't update the table. I need the tblSender Table to reflect this value too.
What i realise too is that i could use the result of the query and store it in a Temp table or something, and then use that to update the Sender table. BUT,...and this is a big BUT... i would need to extract the Sender_id field in the query too and then use that to match it back to the tblSender table, but when i include this field it messes up the result.
But all in all, if i can just get the result to be updated in the query that would be great.....
|
|
|
|
|
I believe your UPDATE should look something like this:
UPDATE
tblSender
SET
User_Flag = 1
WHERE
createdate = (SELECT
MAX(s.createdate)
FROM
tblSender s
WHERE
s.Sender_FName = tblSender.Sender_FName AND
s.Sender_LName = tblSender.Sender_LName)
My 2 cents:
DISTINCT is a waste of syntax since you are using a GROUP BY Clause.
I see more and more examples on this board of tables without proper primary keys. Last/First names are lousy columns to use for an update (or a primary key).
|
|
|
|
|
thanks alot, this seems to do the job. I'm gonna look it over and let u know
FIFI
|
|
|
|
|
yeah man this works great. Thanks alot.
|
|
|
|
|
Please can someone assist me with hooking-up an InfoPath Button event to a SQL Database. Button controls inserting of new data? Thanks for the rescue!
|
|
|
|
|
Hello...Unfortunately infopath dosent provide inserting/Updating data from Infopath to SQl server.Only we can only retrive data from SQL Server - Infopath but not insert/update.
However we can do this by implementing webservice.
1.Create webservice that can interact with sql server(write functionality Update/Delete what ever you want)
2.Create connection to webservice in infopath(Tools>connectins)
3.Submit data to webservice from infopath.
How ever some of professional thirdparty tools available to interact with sql server,like QDABRA DBXL tool.
Regards
Kamalonline4@yahoo.com
|
|
|
|
|
Hi everbody,
Iam currently working on datbase design.
Iam stucked at:If a primary key is assigned in database,I need to know all the foreign key relation of this PK on other tables in that database.
please help out on this,
thanks in advance,
Rupa
Rupa
|
|
|
|
|
|
Primary keys and foreign keys are the backbone for how tables relate to each other.
|
|
|
|
|
I need to know the tables which are in related with the same foreign key.
Pls do tell the table which constitutes the FK available in the database.
Means that IS there any table in the database in SQL SERVER which is having the FK's.sitting in it.
Please try to understand the query first,then reply it in more meaning manner
Surya
|
|
|
|
|
If I understand your question properly, you want to be able to find out which tables have FKs pointing to a PK.
To do this, you need to look in the tables sysobjects and sysdepends (plus syscolumns for column names). The xtype in sysobjects lets you specify PK for primary keys. I hope that this helps.
Arthur Dent - "That would explain it. All my life I've had this strange feeling that there's something big and sinister going on in the world."
Slartibartfast - "No. That's perfectly normal paranoia. Everybody in the universe gets that."
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I have got four tables. When update happens in any of the four tables a trigger should be fired. i have written it for one table. is there any way to get this same trigger for all the other tables also? Or should i write different triggers for all the tables. I am having difficutly in enabling the trigger for other tables using the enable trigger command. dont know if that is possible. Please help.
Thanks in advance.
Lavanya
|
|
|
|
|
You should have different triggers for each table, mainly because each table will be structured differently, and I assume that the triggers will be different.
Arthur Dent - "That would explain it. All my life I've had this strange feeling that there's something big and sinister going on in the world."
Slartibartfast - "No. That's perfectly normal paranoia. Everybody in the universe gets that."
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
How i can detemine a changes that occure in my database and then i deside based on it.
for example :
i have a database program that locate in one server in my local network,two or more users run it and each one use own sections in my application.when one user add,delete or update records of my database Tables how i can determine this event.because i want to show changes immidiatly to other users that syncronously running my app.
please help me.
|
|
|
|
|
Each user is using a different DB? if so, then replication is what your looking for.You can also look at writing Trigers..
|
|
|
|
|
I have one App in Server and Each user Login to it then based on permissions that define , can access to own sections in app.my program have one database and 40 table.
Please guide me by sample.
|
|
|
|
|
Can we write a procedure in MS sql server to make a connection with oracle?
|
|
|
|
|
I'm not sure what you want to do, but it is possible that a linked server[^] is an answer to your problem.
|
|
|
|
|
Hi,
I am using MS SQL 7 and would like to know if there is a way to setup MS SQL to run a script at a given time, i.e running an end of day script at midnight on some tables.
Thanks in advance,
Pieter
|
|
|
|
|
There is - you're in luck. What you do is to set up a job in SQL Server to do this. Here's how:
http://support.microsoft.com/kb/269074[^]
Good luck.
Arthur Dent - "That would explain it. All my life I've had this strange feeling that there's something big and sinister going on in the world."
Slartibartfast - "No. That's perfectly normal paranoia. Everybody in the universe gets that."
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi All,
I am looking for the functions in SQL server which would return me the mid day, last day of the month given the current date and the param. I would appreciate if you could point me to some related links. I have written some SQLs to do this but looks very ugly with lots of code.
Input will be some date and period.
Output will be the Till ending date interval1 and Till ending date interval2
If period(1) = weekly then the Till ending date = end of the current week (Sun) - I assume a week begins on Monday.
If period(2) = bi-weekly then the Till ending date = end of the following week (Sun)
If period(3) = semi-monthly & today <= 15th of the month then the Till ending date = 15th of the current month, otherwise Till ending date = end of month.
If period(4) = monthly then the Till ending date = end of month
For example:
Input
Some_date : 1-Jan-2006
Period
Output
Period Out1 Out2
1 8-Jan 15-Jan
2 15-Jan 29-Jan
3 15-Jan 31-Jan
4 31-Jan 28-Feb
Thanks for the help.
|
|
|
|
|
Do you have SQL Server Help? Start by looking at the help for functions GETDATE() and DATEPART(). Then follow other related links from there.
Scott
|
|
|
|
|
I can not connect to a database oracle 10g from the .net
I receive this error msg "ORA-12154:TNS could not resolve the connect identifier specified
Dad
|
|
|
|
|
See my reply in the other thread. Please don't cross post
Some people have a memory and an attention span, you should try them out one day. - Jeremy Falcon
|
|
|
|
|
ORA-12154 TNS:could not resolve service name
Cause: The service name specified is not defined correctly in the TNSNAMES.ORA file.
Action: Make the following checks and correct the error:
Verify that a TNSNAMES.ORA file exists and is in the proper place and accessible. See the operating system specific manual for details on the required name and location.
Check to see that the service name exists in one of the TNSNAMES.ORA files and add it if necessary.
Make sure there are no syntax errors anywhere in the file. Particularly look for unmatched parentheses or stray characters. Any error in a TNSNAMES.ORA file makes it unusable. See the Oracle Net Services Administrator's Guide. If possible, regenerate the configuration files using the Oracle Network Manager.
Rupa
|
|
|
|