AristoSamar
Programmer
Hello,
My name is Mariusz,
I have been working on a database application using c++, win32api and MS Sql Server 2005Express.
My question is about T-Sql. In one of my tables I have some rows where one field is empty (some fields allow NULLs). The type are smalldatetime or varchar. I need to select these rows where the field is empty but my query doesn't receive anything.
I have used some basic queries like these:
select * from log_user where logout_date = NULL;
or
select * from log_user where logout_date = '';
How should I query to get these rows?
And a second question.
To deal with Sql Server I use OTL4 librtary in my c++ code what allow me to conect to the ODBC.
My application logins to Sql Server using login and password which exist as a user in a database. Having programming before every query I send to the SQL Server I logout and login the user I use to connect to this server because I don't know how to check after what time a user will be logged out automaticly by Sql Server. I couldn't find that settings either in Sql Server 2000 or 2005Express. There is possible that an user working with my program can login to the application (same to the SQL Server) and go to have a luch, and try to use a program again. So, break between queries a user is sending to the SQL Server can be long, and if I wouldn't logout and login the database user before every query my program sends I have a chance that my program will send some query to the Server where a datebase user is already disconected.
I'm not shure I explained that clear enought. If not please let me know I'll try to explain that by other way.
greets and thx by advance for answer.
Mariusz
My name is Mariusz,
I have been working on a database application using c++, win32api and MS Sql Server 2005Express.
My question is about T-Sql. In one of my tables I have some rows where one field is empty (some fields allow NULLs). The type are smalldatetime or varchar. I need to select these rows where the field is empty but my query doesn't receive anything.
I have used some basic queries like these:
select * from log_user where logout_date = NULL;
or
select * from log_user where logout_date = '';
How should I query to get these rows?
And a second question.
To deal with Sql Server I use OTL4 librtary in my c++ code what allow me to conect to the ODBC.
My application logins to Sql Server using login and password which exist as a user in a database. Having programming before every query I send to the SQL Server I logout and login the user I use to connect to this server because I don't know how to check after what time a user will be logged out automaticly by Sql Server. I couldn't find that settings either in Sql Server 2000 or 2005Express. There is possible that an user working with my program can login to the application (same to the SQL Server) and go to have a luch, and try to use a program again. So, break between queries a user is sending to the SQL Server can be long, and if I wouldn't logout and login the database user before every query my program sends I have a chance that my program will send some query to the Server where a datebase user is already disconected.
I'm not shure I explained that clear enought. If not please let me know I'll try to explain that by other way.
greets and thx by advance for answer.
Mariusz