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.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2001-10-03 : 13:41:28
|
| Alice writes "I connect from SQL Server on Windows 2000 to Progress Database on UNIX. The database name of SQL Server is cstarsql and the name is cstarint on UNIX.I would like to schedule to copy data from cstarint(Progress) to cstarsql(SQLServer). I did for one time, but I want to control if the data has already copied or not. If not, it will copy. In DTS Query Builder to copy from Progress to SQL Server, SELECT * from calls WHERE call_date = TODAYThe name of table of calls is the same for both database.The above calls is cstarint(Progress Database)This command is enough for one time. But I need to control if the record has already copied.In SQL Server, I control if the record is available or not with @@FETCH_STATUS .Now I would like to mix two queries, but I couldn't. Can anybody do this?DECLARE calls_cursor SCROLL CURSOR FOR SELECT * FROM calls WHERE call_date = TODAY OPEN calls_cursor-- Perform the first fetch.FETCH NEXT FROM calls_cursor-- Check @@FETCH_STATUS to see if there are any more rows to fetch.WHILE @@FETCH_STATUS = 0BEGIN-- This is executed as long as the previous fetch succeeds. FETCH NEXT FROM calls_cursorEND CLOSE calls_cursorDEALLOCATE calls_cursor" |
|
|
|
|
|