|
If you are using SQL server you can use Sql Server Agent to periodically (say once a day at 00:00:1) run a job (stored procedure). The stored proc could check a table of Jobid/closeDate records and close out any jobs due for closure... if not SQL, then maybe use windows scheduler to run an exe that does the same thing(with or without a stored procedure).
|
|
|
|
|
Thank you very much Rob
|
|
|
|
|
Hey Rob,
I've scheduled a job in SQL Server Agent and created this step:
declare @ExpirationDate smalldatetime
select @ExpirationDate = min( ExpirationDate ) from PostedJobs where Status <> 'False'
while (select datediff (day, @ExpirationDate, getdate())) <= 0
begin
update PostedJobs set Status = 'False'
end
The problem is that when I tested it it executes successfully but it doesn't update rows that I set their date couple of days later.
Execuse me, this is the first time I use most of these tools.
thanks
-- modified at 21:06 Sunday 24th September, 2006
Altered the code to:
declare @ExpirationDate smalldatetime
select @ExpirationDate = min( ExpirationDate ) from PostedJobs where Status <> 'False'
while (select datediff (day, getdate(), @ExpirationDate)) <= 0
begin
update PostedJobs set Status = 'False' where PostedJobs.ExpirationDate = @ExpirationDate
select @ExpirationDate = min( ExpirationDate ) from PostedJobs where Status <> 'False'
end
worked fine
|
|
|
|
|
Is there a way of building an ADO Recordset from some data?
I need to return a Recordset structure from a function but the data is not available trough a database so the ideea was to load the recordset and return it. I want to do this because for some user settings my application cannot read data from a database and building my own recordset beats going trough all the code and reading settings. I can simply change the method that does the querying.
|
|
|
|
|
Hai friend,
You have to return a recordset from a function.
ur function
_Recordsetptr mRs;
mRs.CreateInstance(_uuidof(Recordset));
return mRs;
Ok try it
|
|
|
|
|
Hello,
I am creating a application that can connect any sql server on the network.
The customer would like a dialog box to be able to find a instance of a server, and then enter the password and username to get a list of all the database they want to connect to.
Does anyone have any examples projects in vb.net that does something like this.
I will be most grateful for any code.
Thanks in advance,
Steve
|
|
|
|
|
Hi Steve,
Refer the below link.
http://www.codeproject.com/cs/database/locate_sql_servers.asp
Regards
Narendra
|
|
|
|
|
Hi,
I was wondering when designing a database with multiple tables with PKs and FKs in place, why would I think to map those FKs and PKs between tables hence making relationships while I can retrieve whatever I need with joins without creating any relationships?
|
|
|
|
|
Hi
ADO.net Support you Option by GUI this help you to make relationships
and can make it by coding
|
|
|
|
|
Creating the relationships ensures database integrity.
If there is a relationship between table A and table B, where table A's PK is a FK in table B, then SQL server will not allow you to delete records in table A that has child records in table B.
I would not be surprised if there were not also performance benefits when joining table A and B aswell but I am not sure if this is the case.
|
|
|
|
|
You can get records using joins from any two tables. But if u are not using PKs and FKs how can u assure that a particular row or record in a child table is associated to a particular row in the master or parent table. By using PKs and FKs database forces a rule on data table so invalid data cannot be inserted.
Joins are used to fetch record from more than 1 tables but donot force the rules on datbase tables.
Do good and have good.
|
|
|
|
|
I need some help to find a solution for the problem. I have a VB6 application using ADO that needs to connect to a SQL Server Database with a UserID/Password for the secured database where the UserID/Password for the SQL Server access is different than the NT workstation Login ID and Password. The clients SQL Server is authorized for NT Authenication only and they will not allow SQL Authentication. Can this be done with ODBC? Or is there another method or can it be done at all? The environment is Server 2003, Active Directory, SQL Server 2000 and VB6 using ADO. Need help ASAP. Thanks..
flexTecs, Email Archive and eDiscovery Tool Development
|
|
|
|
|
1-add loging to SQL Server (windows logins from domain users)
2-use trusted connection in connection string:
"Provider=sqloledb;Data Source=SERVERNAME;Initial Catalog=DATABASENAME;Integrated Security=SSPI;"
|
|
|
|
|
OK, but does that me that I need to setup a group that I use in the Security Login on SQL Server and then have a user in that group that the Application uses and a user that is the Windows NT login. Remember I need the application to use a login that is the DBowner but the NT workstation login is a user. I would like to expand on this so that I clearly understand. So far the testing that we have done requires that the NT Workstation Login be the same as the SQL Login for the database. Thanks
flexTecs, Email Archive and eDiscovery Tool Development
|
|
|
|
|
For windows authentication to work as I described..Users must login to domain, not using a local machine login (You should setup an active directory).
|
|
|
|
|
You cannot do it at all. When using Windows Authentication, the identity of the thread is used to make the connection. You can only change the identity of a thread (to be different from the identity which the process is running under) using impersonation, but I'd really not like to try doing that with VB6.
|
|
|
|
|
I have a dataBase in Sql Server 2000 , and i want to connect to DataBase
I have crerated an conectionString by add connection in the server expolrer
(C#.Net Invironment) evry thing about connetion is correct but when program trying to connect DataBase an Exception occurs .
Exception Message is : Login failed for user 'Login1'.
Login1 is my login To DataBase registred in Security section of SqlServer 2000
---------------------
Areff Bahrami(KAVEH)
Areff.HB@Gmail.com
---------------------
|
|
|
|
|
Is the server configured for SQL Server authentication, Windows authentication or both (mixed)?
|
|
|
|
|
Hi all,
I've designed a database for a recruitment site, this is the my first time to design such a complex model, I feel that I have gone so far over-normalizing this database and made it too complicated. I need your comments/suggestions on its design. Please bear with me and I'll provide you with any details you might need.
An image of the database design model is here http://wunex.blogspot.com
|
|
|
|
|
Eliminate lookup tables that have only two or fewer choices (e.g. Gender). Military service - this is either yes/no or number of years - not a lookup
A lookup for Grades doesn't make sense - wouldn't this be a continuous range of values either a number (3.0) or a letter (A, B, C)?
Avoid "mapping tables" like Resumes_fields and Resumes_languages. In both cases, what is probaly wanted is
another tabel: Language_skills:(ResumeID,LanuageID,Language_proficiencyID), unless you really intend an n-to-m cross-reference (these can be difficult to maintain)
NoticePeriod does not seem like an attribute of a resume (rather a job-history) and should probably just be a range-limited value(0-n weeks) rather than a lookup.
|
|
|
|
|
Hey Rob, I just don't know what to say man....thank you
About your comments:
Eliminating lookup tables that have only 2 choices is reasonable, the reason why I created them because I don't have a clear idea as how much is too much normalization, I thought that even a table with two values should be separated!....but ok I'll eliminate them.
Grades here are (Excellent, Very Good, Good, Satisfactory), so would you still recommend eliminating it?
I don't understand this
Rob Graham wrote: Avoid "mapping tables" like Resumes_fields and Resumes_languages.
These two tables are junction tables between Resumes and Fields(job/company field) and Resumes and Languages(Spoken languages) respectively.
I don't understand this:
Rob Graham wrote: In both cases, what is probaly wanted is another tabel: Language_skillsResumeID,LanuageID,Language_proficiencyID), unless you really intend an n-to-m cross-reference (these can be difficult to maintain)
what do you mean by in both cases I need another table(Language_Skills)? and what is n-to-m cross-reference?
NoticePeriod contains values(1 week, 2 weeks,....,1 month) so is this ok to keep it or you still recommend to eliminate it and just get the value from user and put it in a varchar field in resumes/job_history?
Rob, thank you again and excuse me for being such a nag, but my resources are limited to forums, e-books, articles, and tutorials.
|
|
|
|
|
iskaza wrote: I thought that even a table with two values should be separated!
If it's always goint to be just a boolean answer (yes/no, true/false, etc.) then a boolean (bit) field will do, you can format the meaning of 1/0 in the UI as appropriate.
iskaza wrote: These two tables are junction tables between Resumes and Fields(job/company field) and Resumes and Languages(Spoken languages) respectively.
Do you really intend an m-to-n relation where both m & n can be > 1? I think you really want a
table related to a resume that contains the lanuage skills of the applicant: rows with resumeid, Language Id, and Language proficiency. The lanuage proficiency is an attribute of the applicant/resume, not of the language itself as your present structure implies.
Is a field an attribute of a resume, or of a job (in which case maybe its just a column in History_jobs)
If it is an attribute of the resume, then perhaps resume_fields isn't meant as a cross-reference, but just n fields per resume. Last modified: 10mins after originally posted -- Oops, hit post before I was done...
|
|
|
|
|
Yes there's a many-to-many relationship between (Resumes and Fields), (Resumes and Languages).
Rob Graham wrote: I think you really want a
table related to a resume that contains the lanuage skills of the applicant: rows with resumeid, Language Id, and Language proficiency. The lanuage proficiency is an attribute of the applicant/resume, not of the language itself as your present structure implies.
The languages table has predefined languages(English, French,....), so how would I map LanguageProficiency to every language skill per applicant. Yes LanguageProficiency is an attribute of the applicant's language skill but I have a FK named LanguageProficiency in the Languages table which further specifies the LanguageProficiency for every language skill per applicant...!
About Field...Well, Field is a table which contains the various business activities (Accounting, Construction, Import & Export, Computer Hardware,......). So, I make use of this table as the Employer's company field and the Applicant's required job field(s), just like the countries table, I use it to specify the Employer's country, the applicant's country and the location of a posted job.
|
|
|
|
|
iskaza wrote: Yes there's a many-to-many relationship between (Resumes and Fields), (Resumes and Languages).
I would argue that there is really a 1-n relationship between a resume and the applicable fields.
There is a different 1-m relation betwen a field and applicable jobs. although that implies a possible n-m relation between resumes and jobs, it will be easiier in the long run to maintain two 1-n relationsips than 1 m-n relation. Write some sample qureies that would use your junction tables (in particular some insert and update queries). See if they really make sense. If they do, then fine. I'm just generally suspect of tables that contain only fk's from non-lookup tables. iskaza wrote: Yes LanguageProficiency is an attribute of the applicant's language skill but I have a FK named LanguageProficiency in the Languages table which further specifies the LanguageProficiency for every language skill per applicant...!
I find it cumbersome to have to think about having to select the combination of lanugage and proficiency together as a single attribute of a resume. I would seem to make more sense to select the languages and proficiencies separately as values in a record related to a resume. But, whatever makes sense to you...again I would walk through some usage scenarios before settling on a design.
Usually it is good to start with a highly normalized design and then de-normalize as needed for ease of (programmer) use and efficiency.
|
|
|
|
|
Rob Graham wrote: I would argue that there is really a 1-n relationship between a resume and the applicable fields.
I'd like to give the applicant the chance to have more than 1 desired job in his resume, that makes a m-m relationship between resumes and fields.
Rob Graham wrote: I find it cumbersome to have to think about having to select the combination of lanugage and proficiency together as a single attribute of a resume
It's not a single attribute, language is an attribute of a given resume, proficiency is an attribute of that language attribute...it's attribute of an attribute, what I want to do is:
specifying proficiency of every language selected by the applicant to layout this part of the whole resume like:
Language Skills:
English Fluent
French Fair
So, do you have any alternative way to do that?
One last silly question: what exactly is meant by a lookup table and what distinguishes it from aother tables?
|
|
|
|