Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Remote View set identity_insert on
Message
From
16/10/2003 12:09:14
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00839334
Message ID:
00839335
Views:
23
What version of SQL Server are you using?

If you're using SQL 7 or up, why are you dropping and recreating the tables?
You can ALTER TABLE in these versions of SQL Server just like in VFP.

>I am using remote views to update data in an sql server database. This is all good. My problem is:
>
>One thing I'm doing is using VFP as a meta data tool in order to affect structure changes on a sql server database. When I determine that a table needs a stucture change, I do the following:
>
>1. Execute and SQLEXEC that pulls the records from SQL Server into a VFP cursor
>2. DROP and CREATE the SQL Server table
>3. Create a remote view that connects to the new SQL Server table
>4. Append the records from the cursor (that was holding the data) into my remote view
>5. Issue tableupdate()
>
>This is all beatiful except:
>I use identity columns on my sql server database. If there are deleted records in my sql server database, when the data gets appended into my remote view and then updated to SQL Server, SQL Server "renumbers" my identity column because I created a new table.
>
>Thus, I lose the missing ids, which then breaks relationships, etc, etc.
>
>Does anyone know how I might SET IDENTITY_INSERT ON inside of the connection that SQL Server is working with. Or, does anyone have a better way to do this?
>
>Dave
Insanity: Doing the same thing over and over and expecting different results.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform