hi friends,
i want stored procedure in LINKED SERVER to below query and how to write calldate > latest date time
USE MYDB
INSERT INTO mytable(calldate,clid,src,dst,dcontext,channel,dstchannel,lastapp,lastdata,duration,billsec,disposition,amaflags,accountcode,uniqueid,userfield)
select * from openquery(LNKMYVP,'SELECT DATE_FORMAT(calldate,''%Y%-%m-%d %H:%I:%s.000'') as calldate,clid,src,dst,dcontext,channel,dstchannel,lastapp,lastdata,duration,billsec,disposition,amaflags,accountcode,uniqueid,userfield FROM mytable Order By calldate desc limit 100')
i create Linked server in sql server management studio 2005
mysql to sqlserver
LNKMYVP is Linked server Name,
how to use this below query using stored procedure and execute every time (1 hour) in job schedule.
please give the steps for and how to implement check the CALLDATE AFTER THE LATEST RECORDS IS INSERTED.
USE MYDB
INSERT INTO mytable(calldate,clid,src,dst,dcontext,channel,dstchannel,lastapp,lastdata,duration,billsec,disposition,amaflags,accountcode,uniqueid,userfield)
select * from openquery(LNKMYVP,'SELECT DATE_FORMAT(calldate,''%Y%-%m-%d %H:%I:%s.000'') as calldate,clid,src,dst,dcontext,channel,dstchannel,lastapp,lastdata,duration,billsec,disposition,amaflags,accountcode,uniqueid,userfield FROM mytable Order By calldate desc limit 100')
PLEASE GIVE THE SOLUTION
THANKS.