|
I have an internet cafe software uses SQL Express 2005 and I am creating a setup package using InstalShield 2008. My plan is to save the MDF and LDF files in my folder not Microsoft SQL Server folder. My folder is C:\Program Files\Jassim Rahma\TICS\Data but InstallShield fails to complete. When contacting InstallShield support they said it's due to folder permission! and they advise to use the SQLACCOUNT.
I want to know how can I pass the SQLACCOUNT in InstallShield if my software will be used in different OS, XP and higher?
|
|
|
|
|
You're running into UAC issues, they are assuming your SQLACCOUNT has permissions to the program files folders which are locked down unless you are running as admin. I suggest you look into putting your data files into the application data under the user account section (there is an ALLUsers account I am sure), after all this is what it is designed for
|
|
|
|
|
Hi,
My application requires certain reporting queries to be totally dynamically determined from application level. What I have done [rather, am doing] is build the query as indicated from UI and store it as a SP in the database.
The confusion is, say, someone is running the reporting SP, [which takes around 30 secs time to get executed and start returning data], and at the same time someone else trigerred an Alter on the SP.
I do not want any one to get an exception, not even a timeout. So what I have planned is to have a list of the dynamic SP's in DB table, and indicate by a flag, whether it is in use, or not, also whether it is further callable or not. So we can effectively give proper messages instead of exception, if any [I actually do not know, whether there will be an exception]
So, my questions are:
1. What happens when someone calls for an Alter script on a SP while it is running
2. What if, due to some problem, like a connection drop or something, the running query stops executing. As the flags are shared, I cannot run these on a transaction. Essentially, I do not know what happens when the connection over which the query is invoked gets dropped midway in execution. Does the query stop executing, raising an error, or does it complete the execution, and stop silently?
Thanks in advance
|
|
|
|
|
Why not just trap the error returned if the SP is running when you try and do the alter, then wait x seconds and retry? Naturally you would need to put some sort of check in to prevent endless loops. This would also cover connectiosn dropping etc.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
I dont like your design. My advice to you is dont put the dynamic query in a stored procedure instead put it in your application business layer. you are using dynamic sql, so you are not going to make use of the query plan caching etc [its going to be recompiled]. This being said, if you insist on your design, create a table that keep records of whats running. When you get a request of changing an sp, query that table and check if the sp is running. if the sp is running report back a friendly error.
|
|
|
|
|
I'll back up Bassam, your design sucks (following the theme in the Lounge). ALTERing a stored proc to meet these requirements is nuts. Change your design to generate the SQL in the business layer and exec the sql string in your proc (I hate this as you are left open to sql injection) or parameterise EVERY option the user can select and pass in the data as parameters and build your select in the proc.
|
|
|
|
|
Respected,
how we Convert selected table Data into Tally .Please help.
Thanks.
|
|
|
|
|
|
Tally is the most famous accounting software in India.
|
|
|
|
|
UDI-Magic is a Software utility that allows you to Import data into Tally Accounting Software.
This may help you
SQL-Server to Tally[^]
Niladri Biswas
|
|
|
|
|
I am currently in a Distributed Systems Implementation class. My
group has created a project, which is a food ordering system. It is
coded in Java and uses Microsoft Access to make tables for the users,
orders, and items. In this class, we are required to connect our
program to two servers, one primary and another back-up. Our
professor expects the back-up server to be readily available on
another computer if the primary server fails on the first computer.
Can anyone explain to me how I would link my java coded proram with
access to two servers?
Thanks
|
|
|
|
|
Open a connection to the primary server and test it. If it fails, open the connection to the backup server.
|
|
|
|
|
I'm not a Java guy, but I believe the basic approach is something like this:
1) In all of your data access methods, you will need to open 2 connections to the databases; primary and secondary.
2) During your inserts/updates/deletes you will need to make it in both databases.
3) After attempting to make your connection to your primary database, if it fails, you should set some global flag indicating to all of your other database methods should reference the secondary database.
If you really want to be fancy, you could implement a round-robin access method for your primary and secondary databases to provide a load balance between them. Extra brownie points !
Good luck.
|
|
|
|
|
I am building a web app that allows people to apply for jobs at my company. Everything that the user submits in the app is placed in a SQL 2005 database. One of the requirements is that all information in the applicant information is held for at least one year. In my main table which holds the primary id for the applicant I have an entry date field that is populated with the getDate() function whenever a new applicant is added to the system. Also, to keep from having duplicate records of an applicant in the system, the web app calls a stored procedure that deletes all of the applicant's info from the database based on the appID number (the month and day of the applicant's birthday combined with the last four of their SSN). Is there any kind of trigger or other SQL programming that I can put into place that will check the database daily and delete all of the applicant data that has been in the database for over a year?
|
|
|
|
|
While in the SQL Server Management Studio logged in as "sa", look under SQL server Agent and you will see a spot where you can schedule jobs on the server. Create a job that does your cleanup and schedule it when you want it to run and you're done.
|
|
|
|
|
Okay, I can that, but how do I call my stored proc and loop through all of the apps that are over a year old? My Stored Proc is called DEL_App and it has a parameter of @appID, which is an integer. Now, I have created this select statement that will pull all of the apps that are over a year old:
select appID from applicant where Year(entryDate) < Year(getDate())
How can I loop through these apps and delete them using my stored proc?
|
|
|
|
|
Aptiva Dave wrote: select appID from applicant where Year(entryDate) < Year(getDate())
DANGER!! Deleting items that are returned by this select query will delete every app entered prior to the current year... while this seems like what you want, it's not.
For instance... say I enter 100 apps into your system on 31/12/2009. Then on 1/1/2010 the scheduled job runs... voila!! 100 apps that are only a day old are deleted!!!
|
|
|
|
|
hi,
you can use job schedule or else can put trigger on your applicant table which will fire after insert.
now use
select datediff(year,entryDate,getdate())
coz ur query will remove all records which are less than getdate()..
Reasons are not Important but Results are Important.
Swati Tripathi
|
|
|
|
|
Tripathi Swati wrote: put trigger on your applicant table which will fire after insert
Bad idea. What if it suddenly has to delete several thousand records? The delay will be significant. This sort of clean up should be done as a scheduled job, preferably out of hours and just after a backup, just in case anything goes wrong.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
yes, do agree that job scedule is better option but how come trigger will fire on delete also because i told trigger on after insert ???
Reasons are not Important but Results are Important.
Swati Tripathi
|
|
|
|
|
The trigger will not fire on delete, but will attempt to delete records when it is fired by an insert. If there are lots of records to delete (i.e. old records) then there could be a significant delay
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Alright, how do I pull all of the appIDs from the select statement into the Stored Proc that I have already built to delete items? The stored proc only accepts one parameter, which is a single appID.
|
|
|
|
|
I am having problem to build a query. I have following data in a table.
NAME SUBJECT
------------------
sri physics
sri chemistry
sri math
amit physics
amit bio
amit math
sanjay Phsysics
sanjay chemistry
sanjay math
Ritu physics
Ritu Chemistry
Ritu bio
i need to find the name of student (engineering) who are studying physics, Chemistry and math. in above table output should be as follows:
NAME
--------
sri
sanjay
Can anyone tell the sql query.
Thanks,
Sri...
|
|
|
|
|
Try this
declare @t table(name varchar(50),subject varchar(50))
insert into @t
select 'sri','physics' union all
select 'sri','chemistry' union all
select 'sri','maths' union all
select 'amit','physics' union all
select 'amit','bio' union all
select 'amit','maths' union all
select 'sanjay','physics' union all
select 'sanjay','chemistry' union all
select 'sanjay','maths' union all
select 'Ritu','physics' union all
select 'Ritu','chemistry' union all
select 'Ritu','bio'
select name from @t
where subject ='maths' or subject ='physics' or subject ='chemistry'
group by name
having (COUNT(name)>2)
Output:
name
sanjay
sri
Niladri Biswas
|
|
|
|
|
Thanks Biswas,
Its working fine
Thanks,
Sri...
|
|
|
|