Thursday, March 22, 2012
ASP error while accessing the website
I get different errors when I access the same web page....This page opens a
ADO connection....
First time --
__________________________________________________ ___
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC SQL Server Driver]Timeout expired
/common/common.asp, line 65
_______________________________________________--
Another time...I got an Invalid connection error..
Can someone tell me what the problem really is...The website was working
perfectly fine until few days agao..There were no changes to the ASP code...
Thanks & Regards
Imtiaz
sql client changed from tcp\ip to named pipes ?
nic card setting set from 100mb Full to "Auto"
?
Greg Jackson
PDX, Oregon
|||Timeout occurs if you don't take network congestion (i.e. lag) into account.
Double check your connection string to see if you have given enough time for
sql connection (default is 15 sec) and sql command execution (default is 30
sec).
-oj
"Imtiaz" <Imtiaz@.discussions.microsoft.com> wrote in message
news:F757C5B8-0EC9-4A09-888E-6A7282DFC922@.microsoft.com...
> Hi
> I get different errors when I access the same web page....This page opens
> a
> ADO connection....
> First time --
> __________________________________________________ ___
> Microsoft OLE DB Provider for ODBC Drivers error '80004005'
> [Microsoft][ODBC SQL Server Driver]Timeout expired
> /common/common.asp, line 65
> _______________________________________________--
> Another time...I got an Invalid connection error..
> Can someone tell me what the problem really is...The website was working
> perfectly fine until few days agao..There were no changes to the ASP
> code...
>
> Thanks & Regards
> Imtiaz
>
|||Problem has been solved...Web Server wasn't able to ping to SQL Server
properly...
Thanks for your replies...
"oj" wrote:
> Timeout occurs if you don't take network congestion (i.e. lag) into account.
> Double check your connection string to see if you have given enough time for
> sql connection (default is 15 sec) and sql command execution (default is 30
> sec).
> --
> -oj
>
> "Imtiaz" <Imtiaz@.discussions.microsoft.com> wrote in message
> news:F757C5B8-0EC9-4A09-888E-6A7282DFC922@.microsoft.com...
>
>
ASP error while accessing the website
I get different errors when I access the same web page....This page opens a
ADO connection....
First time --
________________________________________
_____________
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC SQL Server Driver]Timeout expired
/common/common.asp, line 65
________________________________________
_______--
Another time...I got an Invalid connection error..
Can someone tell me what the problem really is...The website was working
perfectly fine until few days agao..There were no changes to the ASP code...
Thanks & Regards
Imtiazsql client changed from tcp\ip to named pipes ?
nic card setting set from 100mb Full to "Auto"
?
Greg Jackson
PDX, Oregon|||Timeout occurs if you don't take network congestion (i.e. lag) into account.
Double check your connection string to see if you have given enough time for
sql connection (default is 15 sec) and sql command execution (default is 30
sec).
-oj
"Imtiaz" <Imtiaz@.discussions.microsoft.com> wrote in message
news:F757C5B8-0EC9-4A09-888E-6A7282DFC922@.microsoft.com...
> Hi
> I get different errors when I access the same web page....This page opens
> a
> ADO connection....
> First time --
> ________________________________________
_____________
> Microsoft OLE DB Provider for ODBC Drivers error '80004005'
> [Microsoft][ODBC SQL Server Driver]Timeout expired
> /common/common.asp, line 65
> ________________________________________
_______--
> Another time...I got an Invalid connection error..
> Can someone tell me what the problem really is...The website was working
> perfectly fine until few days agao..There were no changes to the ASP
> code...
>
> Thanks & Regards
> Imtiaz
>|||Problem has been solved...Web Server wasn't able to ping to SQL Server
properly...
Thanks for your replies...
"oj" wrote:
> Timeout occurs if you don't take network congestion (i.e. lag) into accoun
t.
> Double check your connection string to see if you have given enough time f
or
> sql connection (default is 15 sec) and sql command execution (default is 3
0
> sec).
> --
> -oj
>
> "Imtiaz" <Imtiaz@.discussions.microsoft.com> wrote in message
> news:F757C5B8-0EC9-4A09-888E-6A7282DFC922@.microsoft.com...
>
>
ASP ADO SQL Time Out
out. I was doing just fine when I wasnt doing an inner join. I test
an instance of the query (Using the inner join) in sql query and it
ran fine, but when I did the query in the web page it times out.
Any Suggestions
thanks
Kirk"Kirk" <Kirk.Mccann@.NAV-INTERNATIONAL.com> wrote in message
news:eeff0422.0401151918.48768a14@.posting.google.c om...
> I am programing an asp web page using ado/sql. My query is timing
> out. I was doing just fine when I wasnt doing an inner join. I test
> an instance of the query (Using the inner join) in sql query and it
> ran fine, but when I did the query in the web page it times out.
> Any Suggestions
> thanks
> Kirk
You don't give much information, but if your query works fine in QA, then I
would use Profiler to verify that the ASP page is sending the same query to
the server. Profiler should also show you how long the query takes to
execute on the server, so it may help to narrow the problem down to the ASP
side or the database side.
Simon
Monday, March 19, 2012
ask user to select excel
Dear friends, can anyone please tell me that how at the time when user executes the package i can ask a user to choose the datasource excel sheet and what are the constraints i have to take care of in the integration package desing.
thanks,
If you'd like to ask user something, then, I'm afraid, you shoud write your own client application, cause SQL Server does provide nothing to bild any interfaces.|||
dear Sergey Gavrilenko,
is there any way that before running the integration service package i can ask the user to enter the file path of excel that he wants to use as the souce file.
if not easy way then please tell me the only possible way, even if i have to use visual studio .net to get the same.
thanks,
Saturday, February 25, 2012
AS 2005 References/Books
Hi All -
I have come across the need to use a cube in AS 2005 for an application. Unfortunately this will be the first time writting an ASP.Net application which uses one. I was wondering if any of you had any good books or references that I could look at to get an idea of how I should approach this issue.
Thanks in advance.
Have a look at ISBN: 0470176377 ; ISBN13: 9780470176375 at http://www.compman.co.uk/scripts/browse.asp?ref=834216&source=A94
Also look at http://www.codeproject.com/cs/database/CubesAdomd.asp An article on Cubes, MDX, Analysis Services and ADOMD in .NET
and http://www.codeproject.com/cs/database/MyMdDataReader.asp This code replaces the buggy ADOMD.NET DataAdapter and DataReader.
|||Thanks for the help. I will look into them.
AS 2005 Business Intelligence Wizard scripts
In Analysis Services 2005, using the Business Intelligence Wizard in the BI Development Studio to add time calculations to a cube worked fine when only base measures are included in the scope. When a calculated measure is added to the scope of the Business Intelligence Wizard time calculation, all that is returned for the Business Intelligence Wizard time calculation value is “NA”. What could be the problem/how can I make this work correctly?
The exact same time calculation was being created by the Business Intelligence Wizard - the only difference was adding one calculated measure to the scope. Could this have anything to do with pass and solve order? Do the measures that the calculated measure depends on also have to be listed in the scope for the BI Development Studio time calculation? I'm sort of reaching here.
Any help is appreciated,
Dan
There are two separate issues, both of which have been fixed for the next CTP:
1. A redundant scope is created when both physical and calculated measures are chosen.
2. Seeing NA in the context of calculated measures.
The only *possible* workaround I know of for issue 2 is to edit the MDX script and replace the AGGREGATE function with SUM, but this should only be done if you are postive that it makes sense to sum the measures in question. Applying this change may then cause you to hit issue 1, at which point you would, if needed, want to remove the first (outer scope) and move those physical measures into the inline scopes (on the left hand side of the '=').
-rob|||Thanks for the thorough explanation. I will attempt to apply the solution(s).
Dan
|||Is a CTP planned between now and the final release?|||Yes, there will be another CTP released in the near future.
-rob
AS 2005 Business Intelligence Wizard - rerunning to add time calculations
Assuming I understand you correctly, you want to add additional custom time calculations after running the Time Intelligence wizard...
The wizard creates a calculated column in your time dimension table within the DSV. It then adds a new attribute hierarchy to your time dimension based on this new attribute. This serves as an "holding point" for the calculations. It then creates the calculations you selected in the calculations script for the cube, using the following steps:
- it starts the calcuations by adding new members to the attribute hierarchy with a default value of "NA"
- the script then uses a "scope" statement to scope the calculations to the measures you selected in the wizard
- each of the calculations you selected by the wizard are then implemented by using an MDX expression to define the values of the new calculated member across the time hierarchy the calculations apply to
- finally, an "end scope" statement closes things out
If you review the calculation script for the cube, you should see this at the end of the script after running the Time Intelligence wizard.
To add new custom calculations to the same attribute hierarchy created by the wizard, you can just add new calculated members to the hierarchy and add the custom MDX expressions needed. To add a new member, simply add a new "Create Member" statement before the "scope" statement, using the same syntax and construction as the ones added by the wizard. Then, add a new calculation after the "scope" statement that specifies the MDX expression that should be used to calculate values for the new calculated member. Use a syntax similar to that used for the existing calculations.
You should note that any calculated members that you add in this manner will be restricted to the same scope as the ones added by the wizard -- meaning the calculated member will only return values for the same list of members selected in the wizard. You can use variations of this technique with your own scope statements to change this.
Hope this helps and is understandable :-)
Dave Fackler
|||It does help. I had been thinking of the wizard as more of a development tool that would allow me to iteratively refine my cube. However, at this point in time, it serves more to codify best practices and generate examples of how to implement certain features in the context of the cube.
As is, it certainly is a big benefit.
Thanks for the clarification.|||
Hi Dave
I have tried to 'add time intelligence' but when I browse the result I only get something in 'current time'. In 'year to date' I only get the value 'N/A'
On my calculations I have nothing in my 'parent hierarchies' . On the parent hierarchies i got an error
the specified hierarchy [Time].[Year - Quarter - Month - Date Time Calculations] does not exist int the cube.
Scope(
{
[Measures].[Invoice Net Sales Amt]
}
)
( [Time].[Year - Quarter - Month - Date Time Calculations].[Quarter to Date],
[Time].[Quarter].[Quarter].Members ) =
Aggregate(
{ [Time].[Year - Quarter - Month - Date Time Calculations].DefaultMember } *
PeriodsToDate(
[Time].[Year - Quarter - Month - Date].[QuarterName],
[Time].[Year - Quarter - Month - Date].CurrentMember
)
)
End Scope
|||Some of the calculations produced by the Time Intelligence Wizard, including the Year to Date ones, don't work - see
http://spaces.msn.com/cwebbbi/blog/cns!7B84B0F2C239489A!379.entry
Hopefully this will be fixed in SP1.
Chris
|||I'm running SP1 on Standard Edition. I'm also using the code (below) that's recommended as a workaround but still get the same problem. NAs are displayed when I try to browse the data for this measure / calculation combo. All I've done is put the code into my calculations script on Adventure Works. Current Date (which I assume is a hidden calculation) works.
Is there any other issue that could be causing this or is there something I've missed? Any help on this would be much appreciated.
Create Member
CurrentCube.[Date].[Fiscal Date Calculations].[Year to Date]
As "NA" ;
Scope(
{
[Measures].[Internet Sales Amount],
[Measures].[Reseller Sales Amount]
}
);
( [Date].[Fiscal Date Calculations].[Year to Date],
[Date].[Fiscal Year].[Fiscal Year].Members ) =
Aggregate(
{ [Date].[Fiscal Date Calculations].DefaultMember } *
PeriodsToDate(
[Date].[Fiscal].[Fiscal Year],
[Date].[Fiscal].CurrentMember
)
) ;
AS 2005 Business Intelligence Wizard - rerunning to add time calculations
Assuming I understand you correctly, you want to add additional custom time calculations after running the Time Intelligence wizard...
The wizard creates a calculated column in your time dimension table within the DSV. It then adds a new attribute hierarchy to your time dimension based on this new attribute. This serves as an "holding point" for the calculations. It then creates the calculations you selected in the calculations script for the cube, using the following steps:
- it starts the calcuations by adding new members to the attribute hierarchy with a default value of "NA"
- the script then uses a "scope" statement to scope the calculations to the measures you selected in the wizard
- each of the calculations you selected by the wizard are then implemented by using an MDX expression to define the values of the new calculated member across the time hierarchy the calculations apply to
- finally, an "end scope" statement closes things out
If you review the calculation script for the cube, you should see this at the end of the script after running the Time Intelligence wizard.
To add new custom calculations to the same attribute hierarchy created by the wizard, you can just add new calculated members to the hierarchy and add the custom MDX expressions needed. To add a new member, simply add a new "Create Member" statement before the "scope" statement, using the same syntax and construction as the ones added by the wizard. Then, add a new calculation after the "scope" statement that specifies the MDX expression that should be used to calculate values for the new calculated member. Use a syntax similar to that used for the existing calculations.
You should note that any calculated members that you add in this manner will be restricted to the same scope as the ones added by the wizard -- meaning the calculated member will only return values for the same list of members selected in the wizard. You can use variations of this technique with your own scope statements to change this.
Hope this helps and is understandable :-)
Dave Fackler
|||It does help. I had been thinking of the wizard as more of a development tool that would allow me to iteratively refine my cube. However, at this point in time, it serves more to codify best practices and generate examples of how to implement certain features in the context of the cube.
As is, it certainly is a big benefit.
Thanks for the clarification.|||
Hi Dave
I have tried to 'add time intelligence' but when I browse the result I only get something in 'current time'. In 'year to date' I only get the value 'N/A'
On my calculations I have nothing in my 'parent hierarchies' . On the parent hierarchies i got an error
the specified hierarchy [Time].[Year - Quarter - Month - Date Time Calculations] does not exist int the cube.
Scope(
{
[Measures].[Invoice Net Sales Amt]
}
)
( [Time].[Year - Quarter - Month - Date Time Calculations].[Quarter to Date],
[Time].[Quarter].[Quarter].Members ) =
Aggregate(
{ [Time].[Year - Quarter - Month - Date Time Calculations].DefaultMember } *
PeriodsToDate(
[Time].[Year - Quarter - Month - Date].[QuarterName],
[Time].[Year - Quarter - Month - Date].CurrentMember
)
)
End Scope
|||Some of the calculations produced by the Time Intelligence Wizard, including the Year to Date ones, don't work - see
http://spaces.msn.com/cwebbbi/blog/cns!7B84B0F2C239489A!379.entry
Hopefully this will be fixed in SP1.
Chris
|||I'm running SP1 on Standard Edition. I'm also using the code (below) that's recommended as a workaround but still get the same problem. NAs are displayed when I try to browse the data for this measure / calculation combo. All I've done is put the code into my calculations script on Adventure Works. Current Date (which I assume is a hidden calculation) works.
Is there any other issue that could be causing this or is there something I've missed? Any help on this would be much appreciated.
Create Member
CurrentCube.[Date].[Fiscal Date Calculations].[Year to Date]
As "NA" ;
Scope(
{
[Measures].[Internet Sales Amount],
[Measures].[Reseller Sales Amount]
}
);
( [Date].[Fiscal Date Calculations].[Year to Date],
[Date].[Fiscal Year].[Fiscal Year].Members ) =
Aggregate(
{ [Date].[Fiscal Date Calculations].DefaultMember } *
PeriodsToDate(
[Date].[Fiscal].[Fiscal Year],
[Date].[Fiscal].CurrentMember
)
) ;
AS 2005 Business Intelligence Wizard - rerunning to add time calculations
Assuming I understand you correctly, you want to add additional custom time calculations after running the Time Intelligence wizard...
The wizard creates a calculated column in your time dimension table within the DSV. It then adds a new attribute hierarchy to your time dimension based on this new attribute. This serves as an "holding point" for the calculations. It then creates the calculations you selected in the calculations script for the cube, using the following steps:
- it starts the calcuations by adding new members to the attribute hierarchy with a default value of "NA"
- the script then uses a "scope" statement to scope the calculations to the measures you selected in the wizard
- each of the calculations you selected by the wizard are then implemented by using an MDX expression to define the values of the new calculated member across the time hierarchy the calculations apply to
- finally, an "end scope" statement closes things out
If you review the calculation script for the cube, you should see this at the end of the script after running the Time Intelligence wizard.
To add new custom calculations to the same attribute hierarchy created by the wizard, you can just add new calculated members to the hierarchy and add the custom MDX expressions needed. To add a new member, simply add a new "Create Member" statement before the "scope" statement, using the same syntax and construction as the ones added by the wizard. Then, add a new calculation after the "scope" statement that specifies the MDX expression that should be used to calculate values for the new calculated member. Use a syntax similar to that used for the existing calculations.
You should note that any calculated members that you add in this manner will be restricted to the same scope as the ones added by the wizard -- meaning the calculated member will only return values for the same list of members selected in the wizard. You can use variations of this technique with your own scope statements to change this.
Hope this helps and is understandable :-)
Dave Fackler
|||It does help. I had been thinking of the wizard as more of a development tool that would allow me to iteratively refine my cube. However, at this point in time, it serves more to codify best practices and generate examples of how to implement certain features in the context of the cube.
As is, it certainly is a big benefit.
Thanks for the clarification.|||
Hi Dave
I have tried to 'add time intelligence' but when I browse the result I only get something in 'current time'. In 'year to date' I only get the value 'N/A'
On my calculations I have nothing in my 'parent hierarchies' . On the parent hierarchies i got an error
the specified hierarchy [Time].[Year - Quarter - Month - Date Time Calculations] does not exist int the cube.
Scope(
{
[Measures].[Invoice Net Sales Amt]
}
)
( [Time].[Year - Quarter - Month - Date Time Calculations].[Quarter to Date],
[Time].[Quarter].[Quarter].Members ) =
Aggregate(
{ [Time].[Year - Quarter - Month - Date Time Calculations].DefaultMember } *
PeriodsToDate(
[Time].[Year - Quarter - Month - Date].[QuarterName],
[Time].[Year - Quarter - Month - Date].CurrentMember
)
)
End Scope
|||Some of the calculations produced by the Time Intelligence Wizard, including the Year to Date ones, don't work - see
http://spaces.msn.com/cwebbbi/blog/cns!7B84B0F2C239489A!379.entry
Hopefully this will be fixed in SP1.
Chris
|||I'm running SP1 on Standard Edition. I'm also using the code (below) that's recommended as a workaround but still get the same problem. NAs are displayed when I try to browse the data for this measure / calculation combo. All I've done is put the code into my calculations script on Adventure Works. Current Date (which I assume is a hidden calculation) works.
Is there any other issue that could be causing this or is there something I've missed? Any help on this would be much appreciated.
Create Member
CurrentCube.[Date].[Fiscal Date Calculations].[Year to Date]
As "NA" ;
Scope(
{
[Measures].[Internet Sales Amount],
[Measures].[Reseller Sales Amount]
}
);
( [Date].[Fiscal Date Calculations].[Year to Date],
[Date].[Fiscal Year].[Fiscal Year].Members ) =
Aggregate(
{ [Date].[Fiscal Date Calculations].DefaultMember } *
PeriodsToDate(
[Date].[Fiscal].[Fiscal Year],
[Date].[Fiscal].CurrentMember
)
) ;
article on Windows 2003 + sql
It talked about the advantages of migrating your SQL 2000 from Windows 2000
to windows 2003.
Can someone who knows about this, send me a linkHi
I don't know of any SQL Server specific articles, but you will gain all the
generic advantages from using this version:
Top 10:
http://tinyurl.com/bqnx
Why upgrade:
http://tinyurl.com/2u2j9
Performance comparison:
http://tinyurl.com/x7ma
Upgrade site:
http://tinyurl.com/2yhgj
Analyst reports:
http://tinyurl.com/8fnxj
Background:
http://tinyurl.com/adhaf
John
"Hassan" wrote:
> I came across an article long time ago and cannot seem to track it now.
> It talked about the advantages of migrating your SQL 2000 from Windows 2000
> to windows 2003.
> Can someone who knows about this, send me a link
>
>
article on Windows 2003 + sql
It talked about the advantages of migrating your SQL 2000 from Windows 2000
to windows 2003.
Can someone who knows about this, send me a link
Hi
I don't know of any SQL Server specific articles, but you will gain all the
generic advantages from using this version:
Top 10:
http://tinyurl.com/bqnx
Why upgrade:
http://tinyurl.com/2u2j9
Performance comparison:
http://tinyurl.com/x7ma
Upgrade site:
http://tinyurl.com/2yhgj
Analyst reports:
http://tinyurl.com/8fnxj
Background:
http://tinyurl.com/adhaf
John
"Hassan" wrote:
> I came across an article long time ago and cannot seem to track it now.
> It talked about the advantages of migrating your SQL 2000 from Windows 2000
> to windows 2003.
> Can someone who knows about this, send me a link
>
>
article on Windows 2003 + sql
It talked about the advantages of migrating your SQL 2000 from Windows 2000
to windows 2003.
Can someone who knows about this, send me a linkHi
I don't know of any SQL Server specific articles, but you will gain all the
generic advantages from using this version:
Top 10:
http://tinyurl.com/bqnx
Why upgrade:
http://tinyurl.com/2u2j9
Performance comparison:
http://tinyurl.com/x7ma
Upgrade site:
http://tinyurl.com/2yhgj
Analyst reports:
http://tinyurl.com/8fnxj
Background:
http://tinyurl.com/adhaf
John
"Hassan" wrote:
> I came across an article long time ago and cannot seem to track it now.
> It talked about the advantages of migrating your SQL 2000 from Windows 200
0
> to windows 2003.
> Can someone who knows about this, send me a link
>
>
Friday, February 24, 2012
Arrows with point labels in charts
time it showed little arrows under the numbers in the layout preview
(but not in the rendered preview). I don't really care if there are
arrows on this chart or not, but I'd like to know what property it was
that I changed to make the arrows appear, so that I can do it another
time if I need to. Is it possible that the arrow didn't show up because
I'm only labeling one point?What version of RS are you using? It is a 3-D style chart? I've
noticed in the past 3-D charts screw with point labels.
Andy Potter
Sunday, February 19, 2012
Array as variable ?
I am in a situation where I have an array of userIDs in VB .Net. For each of
these UserIDs I need to query the database for the fastest time for each
user and would like to fill a dataset ordered with fastest to slowest time.
Is there any way I can manage this in T-SQL and submit an array of userIDs
as a variable to the stored procedure, or do I need to manage this in my
code by submitting one query per user and do the sorting etc in code ?
Niclashttp://www.sommarskog.se/arrays-in-sql.html|||To add to Omnibuzz's response, you can also consider using the XML data type
if you're using SQL 2005.
Hope this helps.
Dan Guzman
SQL Server MVP
"Niclas" <lindblom_niclas@.hotmail.com> wrote in message
news:OOAMYC4aGHA.4788@.TK2MSFTNGP02.phx.gbl...
> Hi,
> I am in a situation where I have an array of userIDs in VB .Net. For each
> of these UserIDs I need to query the database for the fastest time for
> each user and would like to fill a dataset ordered with fastest to slowest
> time.
> Is there any way I can manage this in T-SQL and submit an array of userIDs
> as a variable to the stored procedure, or do I need to manage this in my
> code by submitting one query per user and do the sorting etc in code ?
> Niclas
>|||> I am in a situation where I have an array of userIDs in VB .Net. For each
> of these UserIDs I need to query the database for the fastest time for
> each user and would like to fill a dataset ordered with fastest to slowest
> time.
> Is there any way I can manage this in T-SQL and submit an array of userIDs
> as a variable to the stored procedure, or do I need to manage this in my
> code by submitting one query per user and do the sorting etc in code ?
The simplest way of dealing with an array of updates / inserts / deletes in
.NET is to either (a) iterate over that array, passing each value one at a
time to your stored procedure, which is pretty inefficient, or to (b) slurp
the data up into a DataTable or DataSet and do something like this:
If you want to see it in C#, just say so, and I will repost:
Imports Jedi.Mind.Trick
' you're putting your connection strings in your .config file, aren't you?!?
Dim cnstr As String = ConfigurationSettings.AppSettings("connectionString")
Dim cn As New SqlConnection(cnstr)
' SQL Statement or stored procedure that updates a *single* record
Dim cm As New SqlConnection("INSERT INTO ... VALUES (...)", cn)
Dim da As New SqlDataAdapter(cm)
' whatever you need to hold your *multiple records* of data.
Dim dt As New DataTable() ' or, if you prefer, Dim ds As New DataSet()
' get your data from wherever
da.Update(dt) ' does inserts, updates, and deletes, as neccesary
Peace & happy computing,
Mike Labosh, MCSD MCT
Owner, vbSensei.Com
"Escriba coda ergo sum." -- vbSensei
Thursday, February 16, 2012
Arithmetic overflow error
After 6 months running with the datatype decimal(15,2), every time that I want to update a row, the following message is displayed,
Microsoft SQL Server:8115[Microsoft][ODBC SQL Server Driver][SQL
Server]Arithmetic overflow error converting float to data type
numeric
and the decimal data is shift to left, like this sample:
41.61 >> 4161.00
62.30 >> 623.00
Anyone can help?
tksHave you run a dbcc check on the table/database?
Try doing a compare
select * from tbl where fld = 62.3 to find if it is a presentation or data problem (probably it is the data)
What happens if you do
select convert(decimal(15,2),62.3)
Monday, February 13, 2012
Arithmetic overflow
Every time a run a query where dates are included, I get an 'Arithmetic
overflow error converting expression to data type datetime'.
The dates are stored as yyyymmdd (nvarchar 8) and usually the 'month(DATE_X)
AS Month' syntax is used.
I think that somehow, some of the dates are corrupted.
How can I found out which of then are corrupted? There're too many to scroll
through.
TIA,
Ana
************************************************** *****************************
"Eres dueo de lo que callas y esclavo de lo que dices"
"Judge your success by what you had to give up in order to get it"
************************************************** *****************************
On Tue, 28 Sep 2004 23:22:39 +0200, Ana wrote:
>The dates are stored as yyyymmdd (nvarchar 8) and usually the 'month(DATE_X)
>AS Month' syntax is used.
>I think that somehow, some of the dates are corrupted.
>How can I found out which of then are corrupted?
Hi Ana,
SELECT YourDateCol
FROM YourTable
WHERE ISDATE(YourDateCol) = 0
And change your database design: use the datetime format to store dates
instead. <g>
Best, Hugo
(Remove _NO_ and _SPAM_ to get my e-mail address)
Aren't IIF statements supposed to be straight forward...
Hi
IIF statements are simple and I have had them work on other reports. But for the first time I'm using "Like" operator for string comparison and I can't get this to work!
For ease, my boolean condition is in blue color, and the green color field value is to be returned incase the condition is TRUE and the red color field value is to be returned incase the condition is FALSE.
=IIF(((First(Fields!well_type.Value, "WellAttributes")Like First(Fields!code.Value, "LookUpCodeTblAttributes"))And (First(Fields!code_type.Value, "LookUpCodeTblAttributes")Like "well type")),First(Fields!description.Value, "LookUpCodeTblAttributes"),"N/A")
Instead, its giving me the following error:
[rsCompilerErrorInExpression] The Value expression for the textbox ‘well_type’ contains an error: [BC30455] Argument not specified for parameter 'FalsePart' of 'Public Function IIf(Expression As Boolean, TruePart As Object, FalsePart As Object) As Object'.
Build complete -- 1 errors, 2 warnings
If anyone has encountered a similar problem or an idea to resolve this. Please let me know - appreciate it.
Thanks
preps.
I used StrComp operator instead.
Syntax and usage for Like operator can be found at http://msdn2.microsoft.com/en-us/library/swf8kaxw.aspx
Cheers
preps
Sunday, February 12, 2012
are you sql god?
Hi all,
I need the time that a stored procedure was created/altered.
In sysobjects table, creation date of the stored procedure is logged. But if the stored procedure is altered this column is not updated.
1. Is last alter date of a stored procedure loged somewhere?
2. If not, can I restrict users to "alter procedure" but not "drop/create procedure" so that they will have to drop and re-create procedures so sysobjects.crdate will always be updated.
I hope I will get a positive answer.
Ata
Besides the create_date, there is also a modify_date in the objects catalog. That is probably what you are looking for.
Thanks
Laurentiu
If this is SQL Server 2005, you should query the DMV... sys.objects
This is taken from the Books-on-line (the sys.objects DMV.)
| Column name | Data type | Description |
|---|---|---|
| name | sysname | Object name. |
| object_id | int | Object identification number. Is unique within a database. |
| schema_id | int | ID of the schema that the object is contained in. For all schema-scoped system objects that ship with SQL Server 2005, this value will always be IN (schema_id('sys'), schema_id('INFORMATION_SCHEMA'). |
| principal_id | int | ID of the individual owner, if different from the schema owner. By default, schema-contained objects are owned by the schema owner. However, an alternate owner can be specified by using the ALTER AUTHORIZATION statement to change ownership. Is NULL if there is no alternate individual owner. Is NULL if the object type is one of the following: C = CHECK constraint D = DEFAULT (constraint or stand-alone) F = FOREIGN KEY constraint PK = PRIMARY KEY constraint R = Rule (old-style, stand-alone) TA = Assembly (CLR-integration) trigger TR = SQL trigger UQ = UNIQUE constraint |
| parent_object_id | int | ID of the object to which this object belongs. 0 = Not a child object. |
| type | char(2) | Object type: AF = Aggregate function (CLR) C = CHECK constraint D = DEFAULT (constraint or stand-alone) F = FOREIGN KEY constraint PK = PRIMARY KEY constraint P = SQL stored procedure PC = Assembly (CLR) stored procedure FN = SQL scalar function FS = Assembly (CLR) scalar function FT = Assembly (CLR) table-valued function R = Rule (old-style, stand-alone) RF = Replication-filter-procedure SN = Synonym SQ = Service queue TA = Assembly (CLR) DML trigger TR = SQL DML trigger IF = SQL inlined table-valued function TF = SQL table-valued-function U = Table (user-defined) UQ = UNIQUE constraint V = View X = Extended stored procedure IT = Internal table |
| type_desc | nvarchar(60) | Description of the object type. AGGREGATE_FUNCTION CHECK_CONSTRAINT DEFAULT_CONSTRAINT FOREIGN_KEY_CONSTRAINT PRIMARY_KEY_CONSTRAINT SQL_STORED_PROCEDURE CLR_STORED_PROCEDURE SQL_SCALAR_FUNCTION CLR_SCALAR_FUNCTION CLR_TABLE_VALUED_FUNCTION RULE REPLICATION_FILTER_PROCEDURE SYNONYM SERVICE_QUEUE CLR_TRIGGER SQL_TRIGGER SQL_INLINE_TABLE_VALUED_FUNCTION SQL_TABLE_VALUED_FUNCTION USER_TABLE UNIQUE_CONSTRAINT VIEW EXTENDED_STORED_PROCEDURE INTERNAL_TABLE |
| create_date | datetime | Date the object was created. |
| modify_date | datetime | Date the object was last modified by using an ALTER statement. If the object is a table or a view, modify_date also changes when a clustered index on the table or view is created or altered. |
| is_ms_shipped | bit | Object is created by an internal SQL Server component. |
| is_published | bit | Object is published. |
| is_schema_published | bit | Only the schema of the object is published. |
are you sql god?
Hi all,
I need the time that a stored procedure was created/altered.
In sysobjects table, creation date of the stored procedure is logged. But if the stored procedure is altered this column is not updated.
1. Is last alter date of a stored procedure loged somewhere?
2. If not, can I restrict users to "alter procedure" but not "drop/create procedure" so that they will have to drop and re-create procedures so sysobjects.crdate will always be updated.
I hope I will get a positive answer.
Ata
Besides the create_date, there is also a modify_date in the objects catalog. That is probably what you are looking for.
Thanks
Laurentiu
If this is SQL Server 2005, you should query the DMV... sys.objects
This is taken from the Books-on-line (the sys.objects DMV.)
| Column name | Data type | Description |
|---|---|---|
| name | sysname | Object name. |
| object_id | int | Object identification number. Is unique within a database. |
| schema_id | int | ID of the schema that the object is contained in. For all schema-scoped system objects that ship with SQL Server 2005, this value will always be IN (schema_id('sys'), schema_id('INFORMATION_SCHEMA'). |
| principal_id | int | ID of the individual owner, if different from the schema owner. By default, schema-contained objects are owned by the schema owner. However, an alternate owner can be specified by using the ALTER AUTHORIZATION statement to change ownership. Is NULL if there is no alternate individual owner. Is NULL if the object type is one of the following: C = CHECK constraint D = DEFAULT (constraint or stand-alone) F = FOREIGN KEY constraint PK = PRIMARY KEY constraint R = Rule (old-style, stand-alone) TA = Assembly (CLR-integration) trigger TR = SQL trigger UQ = UNIQUE constraint |
| parent_object_id | int | ID of the object to which this object belongs. 0 = Not a child object. |
| type | char(2) | Object type: AF = Aggregate function (CLR) C = CHECK constraint D = DEFAULT (constraint or stand-alone) F = FOREIGN KEY constraint PK = PRIMARY KEY constraint P = SQL stored procedure PC = Assembly (CLR) stored procedure FN = SQL scalar function FS = Assembly (CLR) scalar function FT = Assembly (CLR) table-valued function R = Rule (old-style, stand-alone) RF = Replication-filter-procedure SN = Synonym SQ = Service queue TA = Assembly (CLR) DML trigger TR = SQL DML trigger IF = SQL inlined table-valued function TF = SQL table-valued-function U = Table (user-defined) UQ = UNIQUE constraint V = View X = Extended stored procedure IT = Internal table |
| type_desc | nvarchar(60) | Description of the object type. AGGREGATE_FUNCTION CHECK_CONSTRAINT DEFAULT_CONSTRAINT FOREIGN_KEY_CONSTRAINT PRIMARY_KEY_CONSTRAINT SQL_STORED_PROCEDURE CLR_STORED_PROCEDURE SQL_SCALAR_FUNCTION CLR_SCALAR_FUNCTION CLR_TABLE_VALUED_FUNCTION RULE REPLICATION_FILTER_PROCEDURE SYNONYM SERVICE_QUEUE CLR_TRIGGER SQL_TRIGGER SQL_INLINE_TABLE_VALUED_FUNCTION SQL_TABLE_VALUED_FUNCTION USER_TABLE UNIQUE_CONSTRAINT VIEW EXTENDED_STORED_PROCEDURE INTERNAL_TABLE |
| create_date | datetime | Date the object was created. |
| modify_date | datetime | Date the object was last modified by using an ALTER statement. If the object is a table or a view, modify_date also changes when a clustered index on the table or view is created or altered. |
| is_ms_shipped | bit | Object is created by an internal SQL Server component. |
| is_published | bit | Object is published. |
| is_schema_published | bit | Only the schema of the object is published. |
Are transactional settings used only during updates?
In the Web application I am working on, data is read from a SQL Server
database. At any time, there are about 15 people browsing the web.
The SQL Server database is updated with new information once every
hour. The update takes a couple of minutes. The isolation level during
the update is so to Serialazable so that the front-end does not get
any incorrect data.
Now, here is my problem. When the web page is being loaded, the server
side ASP.NET code uses several SELECT statements at multiple places.
For various design reasons, these SELECT statements cannot be combined
into a single statement. As a result, it may happen that during the
page load, we get some data before an update and some data after an
update.
I am wondering if I must used a transactional lock even for the Web
application although technically it is not updating the database.
Also, after playing with various transactional settings, I noticed the
following behavior for the readers when a writer enters a transaction:
1. If the reader app has not yet executed the query, the call to query
execution blocks until the writer has done its job.
2. If the reader app has already begun executing the query, the call
is not blocked and SQL Server provides the needed isolation.
I do not wish to block the readers while the update is going on.
Ideally, I would like it to be such that even if the writer is
updating, the readers must continue to get the old data, that is,
until the writer commits the update. However, I did not find any
isolation settings that would let me achieve this non-blocking
behavior. Am I missing something?
Thank you in advance for enlightening me.
PradeepPradeep (ipradeep@.msn.com) writes:
> The SQL Server database is updated with new information once every
> hour. The update takes a couple of minutes. The isolation level during
> the update is so to Serialazable so that the front-end does not get
> any incorrect data.
The isolation level for the update process has nothing to do with
what happens at the front-end. What matters for the front-end is its
isolation level.
> Now, here is my problem. When the web page is being loaded, the server
> side ASP.NET code uses several SELECT statements at multiple places.
> For various design reasons, these SELECT statements cannot be combined
> into a single statement. As a result, it may happen that during the
> page load, we get some data before an update and some data after an
> update.
> I am wondering if I must used a transactional lock even for the Web
> application although technically it is not updating the database.
Yes, this is the place for serialiable isolation level. You start a
transaction, so if the update process chimes in while you are reading,
it will be blocked until you are completed and commit.
There is certainly all reason to be careful here. For instance, don't wait
for user input before you commit, because then the update process could
be blocked forever.
> I do not wish to block the readers while the update is going on.
> Ideally, I would like it to be such that even if the writer is
> updating, the readers must continue to get the old data, that is,
> until the writer commits the update. However, I did not find any
> isolation settings that would let me achieve this non-blocking
> behavior. Am I missing something?
This would be possible in Oracle today, and a new isolation level called
Snapshot isolation in the upcoming version of SQL Server, SQL 2005, also
makes this possible.
But now we are in SQL2000, and will have to do the best we can. I would
probably look into that update process. I don't know how much data that
is involved, but "a couple of minutes" for the update sounds a tad long
to me. I would not be surprised if that time can be significantly reduced.
Particularly the time for inserting data into the actual target tables.
If you need to clean up data, you can use staging tables, that are only
used by the update process.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp