Showing posts with label written. Show all posts
Showing posts with label written. Show all posts

Wednesday, March 28, 2012

How do i limit number of rows in a table based on dates?

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!
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.

Monday, March 19, 2012

How do I get Table Owner?

I need to the table owner.
Not from in Enterprise Manager, but from my app. (it's written in Delphi).
Any suggestions?
Thank you,
KeithUSE Northwind
GO

DECLARE @.TABLE_NAME sysname

SELECT @.TABLE_NAME = 'Orders'

SELECT TABLE_SCHEMA
FROM INFORMATION_SCHEMA.Tables
WHERE TABLE_NAME = @.TABLE_NAME|||I'd use:SELECT TABLE_SCHEMA AS owner
FROM INFORMATION_SCHEMA.TABLES
WHERE 'myTable' = TABLE_NAME
-PatP

Monday, March 12, 2012

How do I get a RS report onto an Internet website?

I've written our first Reporting Services report, using SQL Server 2005. Since we've never used RS before, we may, or may not, have done some things correctly. One of the things is that we only have the Reporting Services, and Report Manager, on our SQL Server 2005 server, which is in our network behind our firewall.

We also have an ASP.NET 1.1 application which is used by external users (other businesses that do business with us). Because of the nature of our business, we don't want people from one agency to access data from another agency. Since calling the report in RS involved passing parameters to the report in the URL, I decided that I would hide those details by putting the web page returned by RS into an IFRAME in an aspx page. It works just fine in our network, but I discovered that it does not work at all outside of our network.

So, my question is how do I make the RS report available to users outside of our network, in such a way that they don't have access to the parameters that I pass to the report? Should I discard the whole IFRAME approach? I have been told that it will likely require doing something about passing credentials to the backend server from the ASP.NET app, but I don't know how to do that, nor do I know what would be involved.

The most straightforward approach is to use the VS reportviewer control & run your report in local mode, e.g., do not rely upon the report server. This approach eliminates the need to create a security extesion for report server. Cheers!|||

I'm sorry to be so obtuse, but what do you mean by, "run [my] report in local mode"?

|||

DoctorWho:

I'm sorry to be so obtuse, but what do you mean by, "run [my] report in local mode"?

Never mind, I've found it (local mode).

How do I get a RS report onto an Internet app?

I've written our first Reporting Services report, using SQL Server 2005. Since we've never used RS before, we may, or may not, have done some things correctly. One of the things is that we only have the Reporting Services, and Report Manager, on our SQL Server 2005 server, which is in our network behind our firewall.

We also have an ASP.NET 1.1 application which is used by external users (other businesses that do business with us). Because of the nature of our business, we don't want people from one agency to access data from another agency. Since calling the report in RS involved passing parameters to the report in the URL, I decided that I would hide those details by putting the web page returned by RS into an IFRAME in an aspx page. It works just fine in our network, but I discovered that it does not work at all outside of our network.

So, my question is how do I make the RS report available to users outside of our network, in such a way that they don't have access to the parameters that I pass to the report? Should I discard the whole IFRAME approach? I have been told that it will likely require doing something about passing credentials to the backend server from the ASP.NET app, but I don't know how to do that, nor do I know what would be involved.

Your report will be trying to access data from the SQL Server and your internet site will be passing through port 80 (Open to the world) and therefore the SQL Data side will be blocked, If you open the SQL Port on the firewall then you will see the report runs fine, but then you have a SQL Port open!! Thats a whole other issue, You can do an internal redirect which will give you the same result but slightly more secure.

Your choice on that one...

|||

Andy,

What do you mean by I "... can do an internal redirect...". What is that and how do I do that, please?

|||

Rod, possibly Teo's article will help you: "Harden MS Reporting Services Using Custom Extensions"