显示标签为“internet”的博文。显示所有博文
显示标签为“internet”的博文。显示所有博文

2012年2月26日星期日

first day of week by Week Number

I was looking for a solution for this problem - but none of what I
found in Internet helped - so finally I made something myself ( based a
little bit on someone's idea). I hope it will be useful to someone - or
maybe u'll see some bugs in it? please report.
there 2 assumptions
1. before executing this function u SET DATEFIRST 1
2. u have already an IsoW function implemented ( found in Books
Online as example for CREATE FUNCTION)
create function fdaywk (@.year int, @.w int )
returns datetime
as
begin
declare @.date datetime
begin
set @.date = cast('01/01/' + cast(@.year as char(4))as datetime)
if datepart(dw,@.date)>4
set @.date = @.date+8-datepart(dw,@.date)
else
set @.date= @.date-datepart(dw,@.date)+1
set @.date = dateadd(wk, @.w-1, @.date)
end
return(@.date)
endHi,
your solution wont work on other servers than US or english one, using
US regional settings.
The code in cause is :
set @.date = cast('01/01/' + cast(@.year as char(4))as datetime)
You must use the short ISO date encode wich is SQL Server World Wide
portable solution :
YYYYMMDD HH:MM:SS.nnn
Try it :
SELECT CAST('20050225 11:23:17.852' AS DATETIME) AS DT
This datetime format is corresponding to CONVERT(... 121)
A +
tomek a crit :
> I was looking for a solution for this problem - but none of what I
> found in Internet helped - so finally I made something myself ( based a
> little bit on someone's idea). I hope it will be useful to someone - or
> maybe u'll see some bugs in it? please report.
> there 2 assumptions
> 1. before executing this function u SET DATEFIRST 1
> 2. u have already an IsoW function implemented ( found in Books
> Online as example for CREATE FUNCTION)
> create function fdaywk (@.year int, @.w int )
> returns datetime
> as
> begin
> declare @.date datetime
> begin
> set @.date = cast('01/01/' + cast(@.year as char(4))as datetime)
> if datepart(dw,@.date)>4
> set @.date = @.date+8-datepart(dw,@.date)
> else
> set @.date= @.date-datepart(dw,@.date)+1
> set @.date = dateadd(wk, @.w-1, @.date)
> end
> return(@.date)
> end
>
Frdric BROUARD, MVP SQL Server, expert bases de donnes et langage SQL
Le site sur le langage SQL et les SGBDR : http://sqlpro.developpez.com
Audit, conseil, expertise, formation, modlisation, tuning, optimisation
********************* http://www.datasapiens.com ***********************

2012年2月19日星期日

Firewall and port 1433

I read in a forum that port 1433 should never be opened to the internet. Is
this true?
We are developing Windows applications that will need access to our SQL
server from outside our firewall. Is it better to connect via a VPN first an
d
then run the Windows application?
Does anyone know how to open port 1433 on Netscreen 5gt? If it's ok to open
port 1433 to the internet.
We are using Netscreen 5GT as out main firewall and then we have Windows
fireall turned on."Curtis" <Curtis@.discussions.microsoft.com> wrote in message
news:44113285-9232-4CB1-96AD-116293A830CA@.microsoft.com...
> I read in a forum that port 1433 should never be opened to the internet.
Is
> this true?
Well, it depends. Do you want any random person knocking on that port and
waiting for the next Slammer type worm to come along and own your system?
If so, leave it open.

> We are developing Windows applications that will need access to our SQL
> server from outside our firewall. Is it better to connect via a VPN first
and
> then run the Windows application?
Yes.

> Does anyone know how to open port 1433 on Netscreen 5gt? If it's ok to
open
> port 1433 to the internet.
> We are using Netscreen 5GT as out main firewall and then we have Windows
> fireall turned on.
Also, if they are connecting from a specific range of IPs, narrow anything
you open to just that range for further protection.|||Hi
Have you considered creating a web based application? A half way house may
be to use a web service instead of direct database access.
John
"Curtis" wrote:

> I read in a forum that port 1433 should never be opened to the internet. I
s
> this true?
> We are developing Windows applications that will need access to our SQL
> server from outside our firewall. Is it better to connect via a VPN first
and
> then run the Windows application?
> Does anyone know how to open port 1433 on Netscreen 5gt? If it's ok to ope
n
> port 1433 to the internet.
> We are using Netscreen 5GT as out main firewall and then we have Windows
> fireall turned on.|||Thank you both for the sound advice.
We have considered web based application. I am not well versed in web
services, so I need to do some research.
"John Bell" wrote:
[vbcol=seagreen]
> Hi
> Have you considered creating a web based application? A half way house may
> be to use a web service instead of direct database access.
> John
> "Curtis" wrote:
>

Firewall and port 1433

I read in a forum that port 1433 should never be opened to the internet. Is
this true?
We are developing Windows applications that will need access to our SQL
server from outside our firewall. Is it better to connect via a VPN first and
then run the Windows application?
Does anyone know how to open port 1433 on Netscreen 5gt? If it's ok to open
port 1433 to the internet.
We are using Netscreen 5GT as out main firewall and then we have Windows
fireall turned on."Curtis" <Curtis@.discussions.microsoft.com> wrote in message
news:44113285-9232-4CB1-96AD-116293A830CA@.microsoft.com...
> I read in a forum that port 1433 should never be opened to the internet.
Is
> this true?
Well, it depends. Do you want any random person knocking on that port and
waiting for the next Slammer type worm to come along and own your system?
If so, leave it open.
> We are developing Windows applications that will need access to our SQL
> server from outside our firewall. Is it better to connect via a VPN first
and
> then run the Windows application?
Yes.
> Does anyone know how to open port 1433 on Netscreen 5gt? If it's ok to
open
> port 1433 to the internet.
> We are using Netscreen 5GT as out main firewall and then we have Windows
> fireall turned on.
Also, if they are connecting from a specific range of IPs, narrow anything
you open to just that range for further protection.|||Hi
Have you considered creating a web based application? A half way house may
be to use a web service instead of direct database access.
John
"Curtis" wrote:
> I read in a forum that port 1433 should never be opened to the internet. Is
> this true?
> We are developing Windows applications that will need access to our SQL
> server from outside our firewall. Is it better to connect via a VPN first and
> then run the Windows application?
> Does anyone know how to open port 1433 on Netscreen 5gt? If it's ok to open
> port 1433 to the internet.
> We are using Netscreen 5GT as out main firewall and then we have Windows
> fireall turned on.|||Thank you both for the sound advice.
We have considered web based application. I am not well versed in web
services, so I need to do some research.
"John Bell" wrote:
> Hi
> Have you considered creating a web based application? A half way house may
> be to use a web service instead of direct database access.
> John
> "Curtis" wrote:
> > I read in a forum that port 1433 should never be opened to the internet. Is
> > this true?
> >
> > We are developing Windows applications that will need access to our SQL
> > server from outside our firewall. Is it better to connect via a VPN first and
> > then run the Windows application?
> >
> > Does anyone know how to open port 1433 on Netscreen 5gt? If it's ok to open
> > port 1433 to the internet.
> >
> > We are using Netscreen 5GT as out main firewall and then we have Windows
> > fireall turned on.

FireFox challenge/response

Hi all,
We're having a problem with one of our major clients. We developed a series
of SRS reports that works fine in Internet Explorer. However, when we
navigate to the site using Firefox 1.0, we get prompted to enter a
UserName/Password, which doesn't happen w/ IE. I have tried a lot of
different things to try to get rid of this, but I haven't found a way to do
so. Essentially, we have the Report Users group, which has Browse access to
the reports. All Domain Users are a member of this group. I have even
tried turning on Anonymous access to both the Reports and ReportServer
virtual directories, to no avail - the prompt keeps coming up.
Unfortunately, our client isn't very MS friendly, and we don't have the
ability to control which browser they use ... and at least half the company
is now using FireFox!
Help!!!
Thanks, JimJim wrote:
> Hi all,
> We're having a problem with one of our major clients. We developed a series
> of SRS reports that works fine in Internet Explorer. However, when we
> navigate to the site using Firefox 1.0, we get prompted to enter a
> UserName/Password, which doesn't happen w/ IE. I have tried a lot of
> different things to try to get rid of this, but I haven't found a way to do
> so. Essentially, we have the Report Users group, which has Browse access to
> the reports. All Domain Users are a member of this group. I have even
> tried turning on Anonymous access to both the Reports and ReportServer
> virtual directories, to no avail - the prompt keeps coming up.
> Unfortunately, our client isn't very MS friendly, and we don't have the
> ability to control which browser they use ... and at least half the company
> is now using FireFox!
> Help!!!
> Thanks, Jim
>|||Jim,
From my experience the only reason it doesn't happen in IE is because
you've set your RS site as a "Local Intranet" site within the Internet
Settings in Windows. IE then passes the users domain ID/PW
automatically thus bypassing the prompt to login. Firefox/Mozilla can't
do this so you the prompt will always comeup. You can tell your end
users they need to login then click the 'remember password' so they
atleast don't have to type in each time.
Re-reading you posting the above may not really apply, I guess it sounds
like you are linking directly to a report - and that report's datasource
is set to use the users creds for authentication when the report is run?
Same issue as above Firefox can't pass these autmagically like IE -
I'd suggest having the data source use a fixed domain ID/PW.
David
Jim wrote:
> Hi all,
> We're having a problem with one of our major clients. We developed a series
> of SRS reports that works fine in Internet Explorer. However, when we
> navigate to the site using Firefox 1.0, we get prompted to enter a
> UserName/Password, which doesn't happen w/ IE. I have tried a lot of
> different things to try to get rid of this, but I haven't found a way to do
> so. Essentially, we have the Report Users group, which has Browse access to
> the reports. All Domain Users are a member of this group. I have even
> tried turning on Anonymous access to both the Reports and ReportServer
> virtual directories, to no avail - the prompt keeps coming up.
> Unfortunately, our client isn't very MS friendly, and we don't have the
> ability to control which browser they use ... and at least half the company
> is now using FireFox!
> Help!!!
> Thanks, Jim
>