sql server - automated task

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default sql server - automated task

    Hi,

    Is there anyway I can tell SQL server, to update a table in one db, with info
    from a table in a diffferent db, each morning at a set time?

    Currently I use scheduled tasks in CF, I would like to do all this in SQL
    server though if possible.

    Thankyou

    Mattastic Guest

  2. Similar Questions and Discussions

    1. sql server and asp.net and automated payments
      hi,, everybody i have an asp.net application, where members (clients) have their information stored in sql server Database. Now I want to...
    2. Cannot End Task w/Task Manager
      I had a crash of FrameMaker, and Task Mgr would not end the task. It went through the routine (hour glass followed by offer to send report to...
    3. XP Home Networking (Not Enough Server Space To Complete The Task)
      I have 4 XP Home machines. They all can see each other. They all can share printers. They all have permissions and log ons set. If you try to...
    4. block "new task" on task manager
      We are limiting access to what a patron in the library can run from our pc's. We used gpedit and taskbar features to hide the run command and to...
    5. automated response
      Hi... Just wanted to let you know we received your message. Corey and Jay http://www.coreyandjayshow.com...
  3. #2

    Default Re: sql server - automated task

    Mattastic wrote:
    > Hi,
    >
    > Is there anyway I can tell SQL server, to update a table in one db, with info
    > from a table in a diffferent db, each morning at a set time?
    schedule a job via enterprise manager. under management, sql server agent (which
    needs to be running to use the scheduler). it's pretty straight forward.

    PaulH *ACE* Guest

  4. #3

    Default Re: sql server - automated task

    Thanks for your reply.

    However, when I start a new job, I can only select tables from my current db, do you know how i can select a table from a different db?

    Thankyou
    Mattastic Guest

  5. #4

    Default Re: sql server - automated task

    Mattastic wrote:
    > However, when I start a new job, I can only select tables from my current db, do you know how i can select a table from a different db?
    how are you doing it now? just stuff your sql into each step you need. if you're
    doing it via cf (ie using cfoutput over cfquery) post your code.
    PaulH *ACE* Guest

  6. #5

    Default Re: sql server - automated task

    I can figure out how to do it within a single db, table to table.

    But, i have db on a different server, Im not sure how i can get data from that.

    Thanks again
    Mattastic Guest

  7. #6

    Default Re: sql server - automated task

    Mattastic wrote:
    > I can figure out how to do it within a single db, table to table.
    >
    > But, i have db on a different server, Im not sure how i can get data from that.
    as long as you have a user w/permissions & this is on the same sql server, the
    syntax is always the same:

    dbName.dbOwner.tableName

    SELECT name,accountBalance
    FROM customer
    INNER JOIN otherDB.dbo.accounting
    ON customer.customerID = otherDB.dbo.accounting.customerID
    PaulH *ACE* Guest

  8. #7

    Default Re: sql server - automated task

    Mattastic wrote:
    > But, i have db on a different server, Im not sure how i can get data from that.
    messages seem to be doubling up....oh well, trying again.

    as long as you have a user w/permissions & this is on the same sql server, the
    syntax is always the same:

    dbName.dbOwner.tableName

    SELECT name,accountBalance
    FROM customer
    INNER JOIN otherDB.dbo.accounting
    ON customer.customerID = otherDB.dbo.accounting.customerID
    PaulH *ACE* Guest

  9. #8

    Default Re: sql server - automated task

    If the tables are on separate instances or separate physical servers, the only
    way to do this is to create a link server entry, which you can refer to in your
    SQL statements through four-part naming.

    So, if I have two servers, SQL1 and SQL2, and I want to update a table in SQL2
    with data from SQL1, I would create a link server on SQL2 that points to SQL1.
    Then a scheduled job can do operations on both servers, e.g.

    INSERT INTO sql2.mydb.dbo.mytable
    SELECT * from sql1.mydb.dbo.mytable
    WHERE ....

    But, seriously, if you need to update the target server on a regular basis,
    use replication. That's what it's there for.

    philh Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139