I want to convert a date to a weeknumber in my view.
How is this possible with SQL?
select datepart(wk,getdate())
hth|||Thanx!
Works fine for me!
I want to convert a date to a weeknumber in my view.
How is this possible with SQL?
select datepart(wk,getdate())
hth|||Thanx!
Works fine for me!
This is probably obvious, but....
In MSAS 2000, I could immediately view the new calc measure in Analysis Manager without rebuilding the cube. Is this still possible in SSAS 2005? Can you list the steps?
Yes you can using the new MDX debugger.
When in BIDS, in the caluclaiton tab, create your calculated member and then select the Debug menu and start debuggging.
The cube browser will appear just beneath the calculaiton script.
You can not only step by step through your various caluclaiton, but you can also change them and see the impact immediately.
It is a full fledge VS debugger for MDX...
|||Thierry,
Thanks for the answer. It was very helpful.
I've read that you can develop in Online Mode in the BI Studio to get the same affect as in Analysis Manager (AS 2000). What is the difference between using the debugger in project mode and seeing the change immediately online mode? Are there pros and cons to using online mode versus project mode?
Justin
If I create a view and then a mining structure run it everything works fine BUT if I then alter the view (e.g change a filter setting in a named query) or the actual contents of the database, the OLD contents persist.
Using the view refresh says there are no changes (which is correct as I don't change any column names etc.). If I remove Keep Training Cases, this fixes it, but for Time Series, it then gives an error, so you have to go back and re-select it... is there a direct option to clear caches?
The dependency settings aren't sensitive to non-destructive changes in the DSV. You can simply do a ProcessFull on the mining structure to reprocess from the data.
There is an option ProcessClearStructureOnly (something like that), that clears the training cases from the cache.
TimeSeries requires the cache or the viewer will not work - you can likely drop the cache using the process method above, but you will get errors when trying to view the time series models (at least the chart part)
I am trying to setup cached reports so that one of my larger reports doesn't have to be re-run every time someone wants to view it (the data source only updates every 24 hours).
Anyway I made a new data source, set the report to use that, and in that data source I said to use "SQLexampleUserName" as the stored credentials.
Now when I go to run the report it says: Login failed for user 'username'. The user is not associated with a trusted SQL Server connection.
This is referenced in the MSKB here:
http://support.microsoft.com/default.aspx/kb/555332
Which makes sense, but now my question is: If I want to used a cached report do I HAVE to allow SQL Server Credentials?
I was using Windows Authentication only up to this point.
Yes, you can still use windows credentials for cached reports. To use windows user credentials, in the report properties, on the data sources tab, select 'credentials stored securely in the report server' then enter yorur windows creds, check the use as windows credentials checkbox, then click apply.
Hope that helps,
-Lukasz
|||I'm afraid I'm still having trouble.
I followed your steps from the report manage web based interface and now I have:
An error has occurred during report processing.
Cannot create a connection to data source 'My-Server'.
Login failed for user 'DOMAIN\testuser'.
To make the changes I went to the Data Sources tab as you said, then selecteed "A Customer Data Source" and the Microsoft SQL Server. My Connection string is:
Data Source= My-Server; Initial Catalog=MyDatabase
Then "credentials stored securely in the report server" and "use as windows credentials when connecting to the data source"
I tried the user name as DOMAIN\user and just user.
Now it may just be that I don't have things configured properly somehow, but the report runs just fine if I use Windows Authentication and don't try to cache the report.
Can I make these adjustments from inside the design studio instead of the web based report manager?
That config seems like it should work, it matches the one I'm used. Couple things to check:
1- Did you add the correct permissions for the test account to actually access the database?
2- Create a local user account, make it an SysAdmin (just to troubleshoot!!!!) and try it that way. I don't use a AD account because that account doesn't need to access any network resources, and have more control over the password reset time, etc. Creating a local account to troubleshoot should also rule out any strange AD issues you might be having.
Don't check the 'impersonate' box (you didn't mention it, so I'm guessing you haven't checked it)
Otherwise, once it's running, you'll want to harden the system by ensuring the account that's cached has the lowest possible permissions needed to execute the reports.
Geof
|||Thank you, I will check on that.
As for security, what permissions does an account need to run a basic report?
If I was reporting off TestDatabase on the server I just need to grant the account a login on the server and then read (public) access to TestDatabase, is that correct?
|||Depends on what security you've added to the basic database, but yes, a login, and then public access as described.
Based on your error message, I think you aren't getting past the login stage. There is no need to grant any access rights to any reportserver system databases.
|||Thanks.
I agree that it appears my test account is having issues as I tried it with my personal account and it works just fine.
I'll review my security permissions and work it out from there..
We are experiencing a problem in SQL Server 2005 Standard Edition (on x86 & x64, RTM & SP1 CTP1). The problem is we have a view which does something like "CREATE VIEW myView;SELECT * FROM MyTable WHERE ISNumeric(MyVal)=1" when you do "SELECT * FROM myView" you see a dataset which only contains numeric values.
However it's clear that if you do "SELECT * FROM myView WHERE MyVal>5" that it is evaluating the >5 before the IsNumeric function (I assume as > is less costly than IsNumeric and thus it is more efficient this way). This didn't happen in Sql Server 2000 & 7.0.
My concern here is that how can you trust views if when you put evaluations on them they're working against a different dataset to that which you view if you do SELECT * ?
I am currently working with a workaround which is to simply put TOP in the sub-queries to force the execution order to that which I've defined. However this is nasty as I can't do TOP 100% as it gets optimised out and so instead I have to do TOP 999999999 or similar.
However my biggest concern by far is that even in "SQL Server 2000 (80)" compatibility mode the behaviour is not consistent wtih SS2000.
CREATE TABLE #Problem (idkey int IDENTITY(1,1), numinastr varchar(25))
INSERT INTO #Problem (numinastr) values ('1')
INSERT INTO #Problem (numinastr) values ('10')
INSERT INTO #Problem (numinastr) values ('25')
INSERT INTO #Problem (numinastr) values ('40')
INSERT INTO #Problem (numinastr) values ('>500')
INSERT INTO #Problem (numinastr) values ('600')
INSERT INTO #Problem (numinastr) values ('1000')
INSERT INTO #Problem (numinastr) values ('error!')
-- Note Lack of any non-numeric rows
SELECT numinastr FROM #Problem WHERE ISNUMERIC(numinastr)=1
-- This Command executes correctly
SELECT numinastr FROM #Problem WHERE ISNUMERIC(numinastr)=1 AND numinastr>15
--This one however is parsed incorrectly, with >15 being evalutated before ISNumeric
SELECT * from (
SELECT * FROM #Problem WHERE ISNUMERIC(numinastr)=1
) a where numinastr>15
-- Creating a view of SELECT * FROM #Problem WHERE ISNUMERIC(numinastr)=1 and
-- then querying that also gives the same error
DROP TABLE #Problem
I have been told (by an MVP) that you can't assume a specific execution order for queries. Do any DBA's out there really think this acceptable? I consider this a bug. If I put a query in as a sub-query or view, or if I bracket my where statement in such a way I expect it to respect what I've told it!
A view is nothing more than a representation of some SQL. The optimiser will not treat the view as a single entity but rather merge the SQL into the main SQL.
Secondly, SQL does not guarentee order of execution therefore you have to assume the worst. (as you've been told) This is core to how the opimser works.
You could create an indexed view and use the noexpand clause.
|||This is not a bug. You can hit the problem in SQL Server 2000 also depending on your query plan and/or data. Some new changes to the query optimizer causes more chances of this happening in SQL Server 2005. See the older threads below for more information:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=299697&SiteID=1
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=250271&SiteID=1
Note that even though the ANSI SQL standards talks about various parts of the SELECT statement getting evaluated in a specific order like ON, WHERE, GROUP BY, HAVING, SELECT, ORDER BY most relational database systems optimize the query as a whole for performance reasons. For example, the engine might reorder certain predicates based on internal processing logic or evaluate certain parts of the query using an indexed or materialized view or employ other join strategies. So you should not assume any order in the evaluation of predicates. The only way to guarantee it is to rewrite the predicate conditions in cases like this using a CASE expression or dump intermediate results into a temporary table and then perform the filters which may raise errors depending on the data. Hope this helps.
|||I appreciate that you can never guarantee the order in which expressions get evaluated but surely these two commands should be optimised to the the same plan....they don't.
-- This Command executes correctly
SELECT numinastr FROM #Problem WHERE ISNUMERIC(numinastr)=1 AND numinastr>15
--This one however is parsed incorrectly, with >15 being evalutated before ISNumeric
SELECT * from (
SELECT * FROM #Problem WHERE ISNUMERIC(numinastr)=1
) a where numinastr>15
SQL Server 2000 optimiser was consistent in this regard.
|||The optimiser is cost based. My understanding is that one of the major things that changes between versions is the costs of different operations due to changes in hardware etc.
I suspect that the different versions may have different costs and so different plans are compiled. I would also suspect to get different plans on different machines due to differences in processor memory etc.
Bulkload XML Code,sql