Click here to Skip to main content
15,914,820 members
Home / Discussions / Database
   

Database

 
GeneralRe: Get all tables in sql server instance Pin
Blue_Boy21-Apr-08 0:33
Blue_Boy21-Apr-08 0:33 
GeneralSSIS issue dynamic table structure Pin
Mycroft Holmes20-Apr-08 21:29
professionalMycroft Holmes20-Apr-08 21:29 
QuestionHow to design Table Pin
jason_mf20-Apr-08 19:34
jason_mf20-Apr-08 19:34 
Questionsqsh clear screen? Pin
devvvy20-Apr-08 17:57
devvvy20-Apr-08 17:57 
QuestionT-SQl (VS) VB Languages Pin
Feras Mazen Taleb19-Apr-08 19:22
Feras Mazen Taleb19-Apr-08 19:22 
GeneralRe: T-SQl (VS) VB Languages Pin
SimulationofSai20-Apr-08 5:28
SimulationofSai20-Apr-08 5:28 
GeneralRe: T-SQl (VS) VB Languages Pin
Christian Graus20-Apr-08 12:33
protectorChristian Graus20-Apr-08 12:33 
GeneralSQL: BETWEEN Condition by Date Pin
kimo code19-Apr-08 4:53
kimo code19-Apr-08 4:53 
GeneralRe: SQL: BETWEEN Condition by Date Pin
Blue_Boy19-Apr-08 5:09
Blue_Boy19-Apr-08 5:09 
GeneralRe: SQL: BETWEEN Condition by Date Pin
kimo code19-Apr-08 21:25
kimo code19-Apr-08 21:25 
GeneralRe: SQL: BETWEEN Condition by Date [modified] Pin
Blue_Boy19-Apr-08 22:01
Blue_Boy19-Apr-08 22:01 
GeneralRe: SQL: BETWEEN Condition by Date Pin
kimo code20-Apr-08 1:02
kimo code20-Apr-08 1:02 
GeneralRe: SQL: BETWEEN Condition by Date [modified] Pin
Blue_Boy20-Apr-08 1:29
Blue_Boy20-Apr-08 1:29 
GeneralRe: SQL: BETWEEN Condition by Date Pin
kimo code20-Apr-08 1:53
kimo code20-Apr-08 1:53 
GeneralRe: SQL: BETWEEN Condition by Date Pin
Blue_Boy20-Apr-08 2:03
Blue_Boy20-Apr-08 2:03 
GeneralRe: SQL: BETWEEN Condition by Date Pin
kimo code20-Apr-08 2:08
kimo code20-Apr-08 2:08 
GeneralRe: SQL: BETWEEN Condition by Date Pin
Blue_Boy20-Apr-08 3:25
Blue_Boy20-Apr-08 3:25 
GeneralRe: SQL: BETWEEN Condition by Date Pin
kimo code20-Apr-08 4:59
kimo code20-Apr-08 4:59 
GeneralRe: SQL: BETWEEN Condition by Date Pin
Blue_Boy20-Apr-08 8:07
Blue_Boy20-Apr-08 8:07 
GeneralRe: SQL: BETWEEN Condition by Date Pin
GuyThiebaut20-Apr-08 14:10
professionalGuyThiebaut20-Apr-08 14:10 
QuestionMS SQL Server 2005: Close cursors on commit Pin
Mat Graf18-Apr-08 2:49
Mat Graf18-Apr-08 2:49 
We have an application where we do not want to close the cursors after a commit.
I am testing the app with SQL Server 2005 SP2 on Windows XP Professional with ODBC and SQLNativeClient
I have done the following
- The server option "Close cursor on COMMIT" is not enabled
- The database option 'cursor close on commit' is not enabled
- In the connection code of my VC++ 2005 app I wrote
SQLSetConnectAttr(*phDbConnect, SQL_COPT_SS_MARS_ENABLED, (SQLPOINTER)SQL_MARS_ENABLED_YES, SQL_IS_UINTEGER);
SQLSetConnectAttr(*phDbConnect, SQL_COPT_SS_PRESERVE_CURSORS, (SQLPOINTER)SQL_PC_ON         , NULL);
SQLSetConnectAttr(*phDbConnect, SQL_AUTOCOMMIT              , (SQLPOINTER)SQL_AUTOCOMMIT_OFF, NULL);

In spite of these configurations SQL Server closes the cursors when a commit is done. What should I do?

I also tried the following ExecuteSql bevor executing a query:
ExecuteSql("SET CURSOR_CLOSE_ON_COMMIT OFF");


The reason, why I need open cursors after a commit is very simple:
What I do is
1) getting all rows from table y
SELECT xxx FROM y
2) fetching over each row from y
while (FETCH)
3) updating table z inside the fetch of table y
UPDATE z SET xxxx WHERE....
4) committing the changes made to table z
COMMIT
5) while-end

On 4) SQL Server closes also the cursor for the SELECT statement from 1) Confused | :confused: ...

Thank you very much
Mat
GeneralRe: MS SQL Server 2005: Close cursors on commit Pin
Alsvha18-Apr-08 20:44
Alsvha18-Apr-08 20:44 
GeneralReferential Integrity Pin
Adeel Chaudhry18-Apr-08 0:50
Adeel Chaudhry18-Apr-08 0:50 
GeneralRe: Referential Integrity Pin
Alsvha18-Apr-08 20:44
Alsvha18-Apr-08 20:44 
GeneralRe: Referential Integrity Pin
Adeel Chaudhry18-Apr-08 22:47
Adeel Chaudhry18-Apr-08 22:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.