Wednesday, March 28, 2012
How do i limit number of rows in a table based on dates?
My application is written in c# and uses sql Express to store
information relating to what time employees clock in/out of work each
day.
How can i restrict the amount of rows in my attendance database table
so that entries older than 3 months are automatically deleted from the
database?
Thanks in advance!
KHi
I'd create a stored procedure that does deletion and then create a
job(weekly...) that will run this SP
<kls.systems@.btinternet.com> wrote in message
news:1176719432.941536.219550@.o5g2000hsb.googlegroups.com...
> Hi,
> My application is written in c# and uses sql Express to store
> information relating to what time employees clock in/out of work each
> day.
> How can i restrict the amount of rows in my attendance database table
> so that entries older than 3 months are automatically deleted from the
> database?
> Thanks in advance!
> K
>|||Thanks for the help uri, I thought that sql express couldnt use
scheduled jobs though as it doesnt use sql agent?
Thanks again.|||Ah I see, did not read properly your post
Perhaps here you will find some info
Automating Database maintenance in SQL 2005 Express Edition Part I
http://www.sqldbatips.com/showarticle.asp?ID=27
Automating Database maintenance in SQL 2005 Express Edition Part II
http://www.sqldbatips.com/showarticle.asp?ID=29
<kls.systems@.btinternet.com> wrote in message
news:1176721669.824203.42940@.l77g2000hsb.googlegroups.com...
> Thanks for the help uri, I thought that sql express couldnt use
> scheduled jobs though as it doesnt use sql agent?
> Thanks again.
>|||How about using a .sql script file, execute it using SQLCMD (in a .bat file) and use the Windows
scheduler to execute that .bat file?
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
<kls.systems@.btinternet.com> wrote in message
news:1176721669.824203.42940@.l77g2000hsb.googlegroups.com...
> Thanks for the help uri, I thought that sql express couldnt use
> scheduled jobs though as it doesnt use sql agent?
> Thanks again.
>|||On 16 Apr, 12:22, "Uri Dimant" <u...@.iscar.co.il> wrote:
> Ah I see, did not read properly your post
> Perhaps here you will find some info
> Automating Database maintenance in SQL 2005 Express Edition Part Ihttp://www.sqldbatips.com/showarticle.asp?ID=27
> Automating Database maintenance in SQL 2005 Express Edition Part IIhttp://www.sqldbatips.com/showarticle.asp?ID=29
> <kls.syst...@.btinternet.com> wrote in message
> news:1176721669.824203.42940@.l77g2000hsb.googlegroups.com...
>
> > Thanks for the help uri, I thought that sql express couldnt use
> > scheduled jobs though as it doesnt use sql agent?
> > Thanks again.- Hide quoted text -
> - Show quoted text -|||Thanks very much for all of your help, I'll try setting up a windows
scheduled job to run an sql script to do this as suggested in the
articles you provided links for.
I just thought there would have been a quick and easy setting within
management studio express i could configure to do it but nevermind!
Thanks very much again for your help Uri, very much appreciated.
Friday, March 9, 2012
How do I find the server name?
I need to deploy a multi-user application to several different customers. My app was built on VB.net and uses SQL Server Express. For remote client to connect to the server I understand that I need to use a connection string something like this:
“Server=ServerName;Database=myDB;Trusted_Connection=True;”
My question is, how will I know what the server name is? Can that be different for different customers? When I test this on my PC, I use (Server=.\SQLEXPRESS;), but what do I use for deployment?
Thanks.
hi,
for each "remote" client, you have to store (on each client) the server instance name they are pointing to...
if I have to connect form my machine to your SQLExpress instance, I should connect to YourMachineName\SQLExpress, as you installed a named instance...
you can perhaps have a look at http://www.sqldev.net/misc.htm for 3 different way to enlist SQL Server instances on the lan...
regards
|||Thank you Andrea for your response. I would like to make the installation an automated process using InstallShield. I will have two install packages - one for Server and the other for Clients. How can I find the ServerName during the client install?
P.S: I was trying to locate a relevant article/info at the site you mentioned, but could not find any. I would appreciate it if you can point me to a specific article.
|||hi,
unfortunately, usually you can't...
say you install the "clients" before SQL Server ()... how can you tell what the server name is?
you can perhaps, in your InstallShield code, try instantiating a SQL-DMO.SQLServer object to perform a network scan of installed instances, but this will fail if SQL-DMO has not been already locally installed on the client workstation..
but you can find "smart" solutions.. you can define a share where all your client will point to in order to read some "config" file where they can find the SQL Server they will connect to, but you are there again.. how can you define the network share your app should look for at install time?
so just provide, in your client application, a tool\dialog to define the server name.. at very first startup it could be void and the dialog can automatically pop up, so that the user can finally "browse for installed SQL Server instances" the way you like or is just required to type it's name as the local admin already reported him by internal mail
regards
|||
Thank you for your reply. I have written below what I am thinking as to how I may go about it. Please review and let me know if you have suggestions or comments.
On the install CD, there will be only a Server Install package. During the server installation, it creates a "Client Install" folder and copies Client Install files to that folder. Also it creates a text file called "ServerName.txt" in the same folder and writes the Server's Computer name on it.
To install a client, from the client machine user needs to access the folder on the server and run install. The Client install process reads the Server Computer Name and creates a registry entry on the client.
My application, when run, it reads the "Server's Computer Name" from the registry and coins the connection string and connects to the server.
Please let me know if I can make this process more efficient.
Thanks.
|||hi,
yes, this can be a "smart" solution...
regards
Friday, February 24, 2012
How do I drop sql server mobile database when ...?
How do I drop sql server mobile database at specifical time in my application in PPC?
And, How do I drop it when user input the worng password third times in my application in PPC?
Thank you very much.
Simply delete (or open and fill with junk) the database file at particular time or after user entered incorrect password too many times.
|||
I mean How do I trigger the event?
if (sysdate>'01-may-2006' )
{
//Simply delete (or open and fill with junk) the database file
}
Is that right?
|||As far as I know SQL Mobile does not support database triggers. You have to perform this operation from your application instead.Sunday, February 19, 2012
How do i discover SQL server is running ...
I'm trying to create an application, which would say if sql server is
running on a machine.
Hope i can get this from windows registry. Is there any other way do
achieve this programatically through windows SDK , or checking the
services programatically ?
If i need to check the registry what are the fields that i should look
at ?
thanks in advance,
VeluChecking the registry would only tell you that SQL Server has been
installed -it wouldn't tell you IF it is running, or incompletely removed,
etc.
Asking SQL directly would require that you knew the SQL Server
name -normally the same as the host, but not necessarily.
Checking the services for 'Started' (or not) could work.
Arnie Rowland*
"To be successful, your heart must accompany your knowledge."
<thirumalaivelu@.gmail.com> wrote in message
news:1152253106.670394.42180@.k73g2000cwa.googlegroups.com...
> Hello ,
> I'm trying to create an application, which would say if sql server is
> running on a machine.
> Hope i can get this from windows registry. Is there any other way do
> achieve this programatically through windows SDK , or checking the
> services programatically ?
> If i need to check the registry what are the fields that i should look
> at ?
> thanks in advance,
> Velu
>|||Arnie,
So what is the best way to do it ?
thanks,
Velu|||Velu,
Not sure if this is what you are after, but you could just create a very
quick .NET application that trys to open a connection to an IP (or hostname)
address on the usual SQL Server port, and display a message box if it did, o
r
didn't connect?
Is all you are after, is, a way to find out if a server is running on a
system or not?
Jamie.
"thirumalaivelu@.gmail.com" wrote:
> Arnie,
> So what is the best way to do it ?
> thanks,
> Velu
>|||Jamie,
thanks a lot this is wat i wanted ...
velu
How do I disable the help (?) link?
The reports are embedded in our web application. Everything works
great except for the help link, which when clicked, launches an IE
window that displays the login page. Is there any way to disable,
hide, or change the href for this link?
TimCan someone please just tell me it's not possible so that I can stop
asking?
How do I devlop application which can use 2000 Reporting Services and 2005 Services
Please guide me in developing applications which can work with Reporting Services of 2000 and 2005.
Are there any design considerations to be taken to develop such applications.
Thanks,
V
Please note that RS 2005 includes SOAP endpoint that is fully compatible with one in RS 2000. If you have an application that uses RS 2000 SOAP endpoint you should be able to use this application with RS 2005 without any changes (unless you want new cool features of RS 2005).|||Could you please give me some references for the documentation to develop applications which can work both on 2000 Reporting services and 2005 Reporting Services .
Best Regards,
V