header1   header
header
header Register : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left
Build Function and run as job
Last Post 22 May 2010 12:46 PM by LPJ. 0 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
LPJUser is Offline
New Member
New Member
Posts:2
Avatar

--
22 May 2010 12:46 PM
    Hi All, I am constructing a function that returns data from n to n seconds. Lets Say a reading data from a table in SQL Server from 10 to 10 seconds. I would like to do in a way that this function run as Job asynchronous and this parameter was a switch in it, because then I can stop it by stopping the job. I do not know if this is possible something like
    get-myfunction -seconds 10 -asjob

    function get-myfunction {
     param ([int] $seconds, [swithc] asjob)
     invoke-sqlcmd -serverinstance myserver -database Mydb -query "Select * from something" | select codigo,nome
     #Now I do not know how to do to execute in 10 and 10 seconds, maybe put in a loop ? and how to to this #as job
    start-sleep $seconds }

    thanks !!!

    laerte Junior
    You are not authorized to post a reply.


    Active Forums 4.3
    right
    footer   footer
    footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2 footer
    footer   footer