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

Friday, March 23, 2012

Month and date wrong way around

Hi,

I am querying a report that was written with reporting services, via a webpage in vs2005. However when I input a date field to query from i.e 14/01/2007, this produces an error because the report is seeing this as 01/14/2007, even though in the database the record shows 14/01/2007? Please can someone offer any advice what to check?

thanks,

Harry.

Is that report runs client side?

|||

It seems to happen when report is tested in 'preview mode', and when the report is deployed it happens on the client. An error results because it can't handle the DD/MM the wrong way around?

There must be something I'm missing here...?

Many thanks,

Harry

|||

Hi, Harry:

You should try to format your date before you using them.

You can check out this article about how to format the date in SSRS.

http://msdn2.microsoft.com/en-us/library/ms157328.aspx

I hope the above information will be helpful. If you have any issues or concerns, please let me know. It's my pleasure to be of assistance

|||

Hi,Confused

I'm a little confused how I can use the conversions,

I'm passing StartDate AND EndDate from 2 txtboxes,, my data is SELECT par1, par2, par2 from tbldatabase1 WHERE par1 >@.StartDate and par1 <@.EndDate.

But the parameters from the date boxes are taken in the wrong wat around. Do you know how I can implement some code to change this?. My main visual studio pages are written in c#?.

Or would you do this in the query itself?

Any help would be greatly appreciated.

Thanks Harry.

|||

HI,camper :

If your referring toReport Manager displaying the DateTime in theparameter input box, then no, you cannotformat this. You can onlyformat the date within thereport itself, or like the example I posted as following, give the user a dropdownparameter list of dates.

Apparently you can set theparameter to a string and then it won't enter the time, though you'll have to convert it into a date before it runs against your dataset. This way though,report users can enter a non-date as aparameter.

For some of myreports I create aparameter dataset based on the table holding the dates.

SELECT DATENAME(day, MyDateField) + ' ' + DATENAME(month, MyDateField) + ' ' + DATENAME(year, MyDateField) AS Label, MyDateField AS Value
FROM MyTable
GROUP BY DATENAME(day, MyDateField) + ' ' + DATENAME(month, MyDateField) + ' ' + DATENAME(year, MyDateField), MyDateField
ORDER BY MyDateField

This creates 2 fields, 'Label' which is what the user selects from and 'Value' which the dataset uses to query on.
Create aparameter (@.MyParameterDate) and reference it against your main dataset e.g.

SELECT * FROM MyTable WHERE MyDateField = @.MyParameterDate

In yourReportparameters set the values to be from a query and select yourparameter dataset. Set the Value and Label datafields to the ones created above and ensure theparameter datatype is DateTime. You can change the aboveformat if you don't want dates displaying as '7 November 2005'

I hope the above information will be helpful. If you have any issues or concerns, please let

me know. It's my pleasure to be of assistance

|||

Hi,

I know it's a few months since the last entry but I was having the same problems and fixed it by setting the Report properties: Language Property to my locale (English (United Kingdom) in this case). You can get at these properties from the report designer (in local mode) and clicking on the grey area outside the design grid. This stopped the report from swapping the months and days around :-)

Good luck.

|||

Change this line in your model's smdl file

<Culture>de-DE</Culture>

In this case German yyyy.mm.dd

|||

I am having the same problem. I saw your solution and tried that. However, it appears that those settings do not get passed to the report server. The report now correctly allows entry of the date in the Visual Studio designer, and when selected shows the date correctly, however, when the report is delpyed, the server, does not change behavior. It still thinks it is using mm/dd/yyy format.

Any ideas how to change the server side format to allow dd/mm/yy parameter format entry?

|||I also had to change regional settings to YYYY/MM/DD format on server. In layout view click properties on righthand side and select report from available fields, Click on language and choose English South Africa for YYYY/MM/DD format.sql

Monday, March 19, 2012

Monitoring SQL Server Error Message - Severity Level Messages

Hello,
Do SQL server error messages (severilty level messages 11-16 & 17-25),
both 2000 & 2005, get written to the Windows Application Log, as well
as, the SQL server error log? I mainly monitor the server externally
(Windows Event Logs) and would like to NOT have to configure a MAPI
client on SQL to receive the SQL server severity errors.
Thanks,
Dan
The ones that are written to the errorlog are also written to the eventlog.
However, whether an error is to be written to eventlog/errorlog depends on whether it is configured
to do so. In 2000, sysmessages table, check the dlevel column. In 2005, check sys.messages. In 2000,
you can specify whether an error is to be logged (using sp_altermessage), but not in 2005.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"danfoxley@.anon.postalias" <danfoxley@.gmail.com> wrote in message
news:1187251441.579647.169310@.i38g2000prf.googlegr oups.com...
> Hello,
> Do SQL server error messages (severilty level messages 11-16 & 17-25),
> both 2000 & 2005, get written to the Windows Application Log, as well
> as, the SQL server error log? I mainly monitor the server externally
> (Windows Event Logs) and would like to NOT have to configure a MAPI
> client on SQL to receive the SQL server severity errors.
> Thanks,
> Dan
>

Monitoring SQL Server Error Message - Severity Level Messages

Hello,
Do SQL server error messages (severilty level messages 11-16 & 17-25),
both 2000 & 2005, get written to the Windows Application Log, as well
as, the SQL server error log? I mainly monitor the server externally
(Windows Event Logs) and would like to NOT have to configure a MAPI
client on SQL to receive the SQL server severity errors.
Thanks,
DanThe ones that are written to the errorlog are also written to the eventlog.
However, whether an error is to be written to eventlog/errorlog depends on whether it is configured
to do so. In 2000, sysmessages table, check the dlevel column. In 2005, check sys.messages. In 2000,
you can specify whether an error is to be logged (using sp_altermessage), but not in 2005.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"danfoxley@.anon.postalias" <danfoxley@.gmail.com> wrote in message
news:1187251441.579647.169310@.i38g2000prf.googlegroups.com...
> Hello,
> Do SQL server error messages (severilty level messages 11-16 & 17-25),
> both 2000 & 2005, get written to the Windows Application Log, as well
> as, the SQL server error log? I mainly monitor the server externally
> (Windows Event Logs) and would like to NOT have to configure a MAPI
> client on SQL to receive the SQL server severity errors.
> Thanks,
> Dan
>

Monitoring SQL Server Error Message - Severity Level Messages

Hello,
Do SQL server error messages (severilty level messages 11-16 & 17-25),
both 2000 & 2005, get written to the Windows Application Log, as well
as, the SQL server error log? I mainly monitor the server externally
(Windows Event Logs) and would like to NOT have to configure a MAPI
client on SQL to receive the SQL server severity errors.
Thanks,
DanThe ones that are written to the errorlog are also written to the eventlog.
However, whether an error is to be written to eventlog/errorlog depends on w
hether it is configured
to do so. In 2000, sysmessages table, check the dlevel column. In 2005, chec
k sys.messages. In 2000,
you can specify whether an error is to be logged (using sp_altermessage), bu
t not in 2005.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"danfoxley@.anon.postalias" <danfoxley@.gmail.com> wrote in message
news:1187251441.579647.169310@.i38g2000prf.googlegroups.com...
> Hello,
> Do SQL server error messages (severilty level messages 11-16 & 17-25),
> both 2000 & 2005, get written to the Windows Application Log, as well
> as, the SQL server error log? I mainly monitor the server externally
> (Windows Event Logs) and would like to NOT have to configure a MAPI
> client on SQL to receive the SQL server severity errors.
> Thanks,
> Dan
>

Monday, March 12, 2012

Monitoring Disk activity

Whats the best perfmon counter to use to check how many
bytes are being read and written to disk/sec ?
I know most of the read and writes take place within a
virtual buffer cache, but what triggers a read/write from
disk .. I am currently running SQL 2000 if that helps
The Physical Disk: Bytes Read(and Write) / Sec will give you just that. You
can also use fn_virtualfilestats() to get totals.
Andrew J. Kelly SQL MVP
"Jamie" <anonymous@.discussions.microsoft.com> wrote in message
news:23a5a01c45ecc$0b2044e0$a301280a@.phx.gbl...
> Whats the best perfmon counter to use to check how many
> bytes are being read and written to disk/sec ?
> I know most of the read and writes take place within a
> virtual buffer cache, but what triggers a read/write from
> disk .. I am currently running SQL 2000 if that helps
|||Hi,
Add on, Have a look into this link.
http://www.sql-server-performance.co...ounters_io.asp
Thanks
Hari
MCDBA
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:#bLPn2sXEHA.2816@.TK2MSFTNGP11.phx.gbl...
> The Physical Disk: Bytes Read(and Write) / Sec will give you just that.
You
> can also use fn_virtualfilestats() to get totals.
> --
> Andrew J. Kelly SQL MVP
>
> "Jamie" <anonymous@.discussions.microsoft.com> wrote in message
> news:23a5a01c45ecc$0b2044e0$a301280a@.phx.gbl...
>
|||I generally start off by observing Physical Disk queue length counters as
this tells you whether the disk subsystem is keeping up with the i/o
requests made by sql (or other apps on the same box) through windows. This
is because i/o requests are queued by windows against the i/o subsystem and
if that queue is too large (more than a few i/o's per phsyical disk) or
growing, you have a clear indication that the disk is a bottleneck (not
keeping up).
If you do see a problem here, you next need to ascertain whether the amount
of work being sent to the disk is excessive, due to inefficient query plans
etc.
HTH
Regards,
Greg Linwood
SQL Server MVP
"Jamie" <anonymous@.discussions.microsoft.com> wrote in message
news:23a5a01c45ecc$0b2044e0$a301280a@.phx.gbl...
> Whats the best perfmon counter to use to check how many
> bytes are being read and written to disk/sec ?
> I know most of the read and writes take place within a
> virtual buffer cache, but what triggers a read/write from
> disk .. I am currently running SQL 2000 if that helps

Monitoring Disk activity

Whats the best perfmon counter to use to check how many
bytes are being read and written to disk/sec ?
I know most of the read and writes take place within a
virtual buffer cache, but what triggers a read/write from
disk .. I am currently running SQL 2000 if that helpsThe Physical Disk: Bytes Read(and Write) / Sec will give you just that. You
can also use fn_virtualfilestats() to get totals.
--
Andrew J. Kelly SQL MVP
"Jamie" <anonymous@.discussions.microsoft.com> wrote in message
news:23a5a01c45ecc$0b2044e0$a301280a@.phx.gbl...
> Whats the best perfmon counter to use to check how many
> bytes are being read and written to disk/sec ?
> I know most of the read and writes take place within a
> virtual buffer cache, but what triggers a read/write from
> disk .. I am currently running SQL 2000 if that helps|||Hi,
Add on, Have a look into this link.
http://www.sql-server-performance.com/performance_monitor_counters_io.asp
Thanks
Hari
MCDBA
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:#bLPn2sXEHA.2816@.TK2MSFTNGP11.phx.gbl...
> The Physical Disk: Bytes Read(and Write) / Sec will give you just that.
You
> can also use fn_virtualfilestats() to get totals.
> --
> Andrew J. Kelly SQL MVP
>
> "Jamie" <anonymous@.discussions.microsoft.com> wrote in message
> news:23a5a01c45ecc$0b2044e0$a301280a@.phx.gbl...
> > Whats the best perfmon counter to use to check how many
> > bytes are being read and written to disk/sec ?
> >
> > I know most of the read and writes take place within a
> > virtual buffer cache, but what triggers a read/write from
> > disk .. I am currently running SQL 2000 if that helps
>|||I generally start off by observing Physical Disk queue length counters as
this tells you whether the disk subsystem is keeping up with the i/o
requests made by sql (or other apps on the same box) through windows. This
is because i/o requests are queued by windows against the i/o subsystem and
if that queue is too large (more than a few i/o's per phsyical disk) or
growing, you have a clear indication that the disk is a bottleneck (not
keeping up).
If you do see a problem here, you next need to ascertain whether the amount
of work being sent to the disk is excessive, due to inefficient query plans
etc.
HTH
Regards,
Greg Linwood
SQL Server MVP
"Jamie" <anonymous@.discussions.microsoft.com> wrote in message
news:23a5a01c45ecc$0b2044e0$a301280a@.phx.gbl...
> Whats the best perfmon counter to use to check how many
> bytes are being read and written to disk/sec ?
> I know most of the read and writes take place within a
> virtual buffer cache, but what triggers a read/write from
> disk .. I am currently running SQL 2000 if that helps

Monitoring Disk activity

Whats the best perfmon counter to use to check how many
bytes are being read and written to disk/sec ?
I know most of the read and writes take place within a
virtual buffer cache, but what triggers a read/write from
disk .. I am currently running SQL 2000 if that helpsThe Physical Disk: Bytes Read(and Write) / Sec will give you just that. You
can also use fn_virtualfilestats() to get totals.
Andrew J. Kelly SQL MVP
"Jamie" <anonymous@.discussions.microsoft.com> wrote in message
news:23a5a01c45ecc$0b2044e0$a301280a@.phx
.gbl...
> Whats the best perfmon counter to use to check how many
> bytes are being read and written to disk/sec ?
> I know most of the read and writes take place within a
> virtual buffer cache, but what triggers a read/write from
> disk .. I am currently running SQL 2000 if that helps|||Hi,
Add on, Have a look into this link.
http://www.sql-server-performance.c...counters_io.asp
Thanks
Hari
MCDBA
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:#bLPn2sXEHA.2816@.TK2MSFTNGP11.phx.gbl...
> The Physical Disk: Bytes Read(and Write) / Sec will give you just that.
You
> can also use fn_virtualfilestats() to get totals.
> --
> Andrew J. Kelly SQL MVP
>
> "Jamie" <anonymous@.discussions.microsoft.com> wrote in message
> news:23a5a01c45ecc$0b2044e0$a301280a@.phx
.gbl...
>|||I generally start off by observing Physical Disk queue length counters as
this tells you whether the disk subsystem is keeping up with the i/o
requests made by sql (or other apps on the same box) through windows. This
is because i/o requests are queued by windows against the i/o subsystem and
if that queue is too large (more than a few i/o's per phsyical disk) or
growing, you have a clear indication that the disk is a bottleneck (not
keeping up).
If you do see a problem here, you next need to ascertain whether the amount
of work being sent to the disk is excessive, due to inefficient query plans
etc.
HTH
Regards,
Greg Linwood
SQL Server MVP
"Jamie" <anonymous@.discussions.microsoft.com> wrote in message
news:23a5a01c45ecc$0b2044e0$a301280a@.phx
.gbl...
> Whats the best perfmon counter to use to check how many
> bytes are being read and written to disk/sec ?
> I know most of the read and writes take place within a
> virtual buffer cache, but what triggers a read/write from
> disk .. I am currently running SQL 2000 if that helps

Friday, March 9, 2012

Monitoring blocking...

Is there a way to be notified automatically when blocking
occurs (either via net send or e-mail and maybe even have
that written to the NT event log)?
ThanksHi Rob
Blocking happens all the time, but it is usually for so short a period of
time that if you had a notification every time you thing there was another
spam virus. There is no automatic way to e notified about blocking, but here
are some avenues you might consider:
Set up a script to run a loop, that captures sysprocesses output and saves
it in a table. Compare the waittime column from one run to the next, if the
blocked column is >0. If the waittime is above some threshhold, send a
notification.
Set lock timeout to 0 for each connection, so that any time a block occurs,
the process will get an error 1222 and stop. You will have to add code to
retry if needed. You can then set up an alert to notify you when error 1222
occurs, or you could change the definition of error 1222 to include writing
it to the event log. Getting every session to set the lock timeout value may
require changing a lot of application code.
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Rob" <rhchin@.hotmail.com> wrote in message
news:02ba01c38f5a$285b5a50$a101280a@.phx.gbl...
> Is there a way to be notified automatically when blocking
> occurs (either via net send or e-mail and maybe even have
> that written to the NT event log)?
> Thanks|||Oops, I also meant to suggest you take a look at these KB articles:
http://support.microsoft.com/default.aspx?scid=kb;en-us;271509&Product=sql2k
INF: How to Monitor SQL Server 2000 Blocking
http://support.microsoft.com/default.aspx?scid=kb;en-us;283725&Product=sql2k
INF: How to View SQL Server 2000 Blocking Data
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:uOe6jK2jDHA.2964@.tk2msftngp13.phx.gbl...
> Hi Rob
> Blocking happens all the time, but it is usually for so short a period of
> time that if you had a notification every time you thing there was another
> spam virus. There is no automatic way to e notified about blocking, but
here
> are some avenues you might consider:
> Set up a script to run a loop, that captures sysprocesses output and saves
> it in a table. Compare the waittime column from one run to the next, if
the
> blocked column is >0. If the waittime is above some threshhold, send a
> notification.
> Set lock timeout to 0 for each connection, so that any time a block
occurs,
> the process will get an error 1222 and stop. You will have to add code to
> retry if needed. You can then set up an alert to notify you when error
1222
> occurs, or you could change the definition of error 1222 to include
writing
> it to the event log. Getting every session to set the lock timeout value
may
> require changing a lot of application code.
> --
> HTH
> --
> Kalen Delaney
> SQL Server MVP
> www.SolidQualityLearning.com
>
> "Rob" <rhchin@.hotmail.com> wrote in message
> news:02ba01c38f5a$285b5a50$a101280a@.phx.gbl...
> > Is there a way to be notified automatically when blocking
> > occurs (either via net send or e-mail and maybe even have
> > that written to the NT event log)?
> >
> > Thanks
>

Monday, February 20, 2012

MOM blocking analysis

MOM contains its own Block Analysis script. It is a script written on
VB, that looks for the monitored servers, creates for each one
MomCreateObject("SQLDMO.SQLServer"), afterwards connects to each
database on each server and executes SELECT GETDATE() query. If MOM
doesn't receive answer for 6 minutes, it sends alert. Several times
since I started to monitor my servers I received the next alert:

The program "SQLDMO_789" has been blocked for 6 minutes on database
BurstingDataWarehouse in the SQL instance MSSQLSERVER. The defined
acceptable blocking threshold is 1 minute(s). "SQLDMO_789" is running
on SPID 134 as login NT AUTHORITY\SYSTEM and is blocked by SPID 133.
The resource id is KEY: 10:2:1 (a2007950f190)

SQLDMO_789 - is the MOM itself (number varies from time to time). 10 -
is BurstingDataWarehouse database. As far as I can judge, MOM connects
to the server succesfully (otherwise, how can it know SPID?) The server
itself worked fine at that time - nothing unusual, all the jobs
finished succesfully including the heavy ones. What can block SELECT
GETDATE() query for 6 minutes?I had a similar issue and it turned out that some scrappy application
held thousands of locks on the tempdb. Run sp_who2 in combination with
sp_lock to see which process is blocking the MOM agent.

M