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
 General SQL Server Forums
 New to SQL Server Programming
 Compare two tables and update or ????

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-08-07 : 14:06:00
ans writes "I’m using SQL Server
• I’ve got 3 tables: tblOne, tblTwo, tblThree
• Using the stored procedure(let call this stored procedure sp_Result) I generate result using all the above tables(tblOne, tblTwo, tblThree).
• The problem is, it takes too long to execute(around 15 sec), which is not acceptable as I’m using in the result in the web application
• I’m thinking of scheduling to run the above stored procedure to run once every hour and write the result in a new table, tblResult.
• now the user only queries in the tblResult tables. Since it is a straight forward query it will take less than 1 sec. Perfect !!!
• Now the tblResult already exist, and the user are queries only to this table.
• How would I compare the result produced by stored procedure sp_result and the table tblResult?
• How would I update tblResult with the produced result?
• Would be a good idea to write the result in a new table called temp, then drop the table tblResult and then rename the table temp to tblResult?"

X002548
Not Just a Number

15586 Posts

Posted - 2006-08-07 : 15:31:19
care to post the query?

Read the hint link in my sig and post some details



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-08-08 : 12:54:32
If you want to compare resultset of procedure with other table, you need to copy resultset to temp table and compare

Madhivanan

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

crazymahe
Starting Member

2 Posts

Posted - 2006-08-24 : 05:48:13
Hello sir ,
How to change the sql time formate.Please send the coding.
send the sql query.


Please rey me sir.
Go to Top of Page

crazymahe
Starting Member

2 Posts

Posted - 2006-08-24 : 05:50:35
Hello sir ,
How to change the sql date(dd/mm/yyyy) formate.Please send the coding.
send the sql query.


Please rey me sir.
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-08-24 : 06:20:53
make use of convert function like

select convert(varchar(20), getdate(),105)


to display date in dd-mm-yy format

Check Convert in BOL !

Harsh Athalye
India.
"Nothing is Impossible"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-08-26 : 03:53:05
quote:
Originally posted by crazymahe

Hello sir ,
How to change the sql date(dd/mm/yyyy) formate.Please send the coding.
send the sql query.


Please rey me sir.


Post your question as new topic.
Where do you want to format date? If you use front end application, do formation there

Madhivanan

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

- Advertisement -