August 19, 2002 at 7:22 pm
i need to insert 93903494 into row 40, column cfadestination, table numplan, databses ccm0300 at 6pm everynight and clear this field at 7am each morning. How would i go about doing this?? any hep is greatly appreciated.
August 19, 2002 at 9:19 pm
SQL Agent will allow you to create jobs which run on a schedule. However, SQL Agent has to be running during the time the jobs need to run.
SQL Server is a relational database. That means it works on the concept of relations... which is a mathematical construct. We typically show a relation as a table, much like a spreadsheet with cells and columns. However, unlike a spreadsheet, neither the order of the rows nor the order of the columns are guaranteed unless specified by the query. So whether or not you can insert into row 40 depends on whether or not (a) there is some way to uniquely identify row 40 and (b) whether or not the row exists.
Let's assume it does, that rowid = 40 identifies the row and you're just looking to modify the value of the column.
If you are in the ccm0300 database (this is possible with SQL Agent because you can specify the database), here's how to go about changing the row:
To "insert" the value in the column:
UPDATE numplan
SET cfadestination = 93903494
WHERE rowid = 40
To remove the value from the column:
UPDATE numplan
SET cfadestination = NULL
WHERE rowid = 40
K. Brian Kelley
http://www.truthsolutions.com/
Author: Start to Finish Guide to SQL Server Performance Monitoring
http://www.netimpress.com/shop/product.asp?ProductID=NI-SQL1
K. Brian Kelley
@kbriankelley
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply