How can I query XML data in SSRS / VS 2008? - sql-server-2008

I have a report query using a lot of WITH XMLNAMESPACES to query some XML data in SQL Server 2008. It doesn't look like i can create a report in VS 2008 using this query because of the xml querying. If I'm reading MS's whitepaper correctly, you have to pull the XML out and then do a separate query against it? Anyone have any experience with this, or is there a better way?

And this is an issue of misinterpreting errors. The real issue in my query wasn't the use of WITH XMLNAMESPACES, but the use of "sql:variable("#varName") in the WHERE of my XSL. Easy way to solve that is to add a DECLARE #varName in the query and set it to the passed in parameter. After that, it worked like a champ.

Related

Update a specific cell in MS Access using visual basic

good day, i would like to ask if it is possible to update a specific cell in ms access using visual basic. If it is possible, may i ask what would be the syntax to be used? Thanks!
Yes, it is possible.
The syntax would simply be an Update Query.
When you say "..using visual basic". I am interpreting that as using Visual Basic for Applications. Am I correct?
You can either create the query using QBE, and pass in the parameters in the Criteria field within the query.
You could then run the query via code:
DoCmd.OpenQuery "YourQueryName"
MS Reference
If that's not your preferred way, you need to look into constructing SQL strings into VBA.
Check out this StackOverflow question. String concatenation in VBA is different than just writing SQL in Access.
Hope this helps.

Is there a LookupSet equivalent in SQL Server 2008 ... NOT r2?

Just spent the day figuring out how to properly use the LookupSet method only to find out it isn't supported on my production database which is NOT running SQL Server 2008 R2 (it is just running ol' SQL Server 2008).
So, is there a way to re-produce the functionality so it will work with old SQL Server 2008?
Thanks - wg
As Gordon Linoff points out in the comments, this can usually be implemented in the SQL query. If the datasource for your target of the LookupSet is similar enough to the the main query, then you can accomplish this with a Common Table Expression or a correlated subquery in SQL.
Your could write custom code - which I wouldn't recommend because it's probably simpler to combine the data relationally first in your query. If one of the data sources is non-relational, then use SSIS to get it into a table and then use a query to combine the two sets of data.

Can I obfuscate the SQL code in MySQL?

I'm trying to find some way to obfuscate SQL code in MySQL.
In the Oracle databases exists the "wrap" funcionality, but I didn't found some similar. Some ideas?
The final goal is that the client has some difficuties to understand the code.
I think MySQL do not have the ability to obfuscate the code. You can encapsulate the whole SQL query code by creating a STORED PROCEDURE, although not encapsulated but at least your whole SQL query is not shown when used inside your code (PHP, .Net, and the like...).
MySQL does not have any obfuscation abilities - you could write some code that would be confusing to read by having some other table with defined values that you could use IF statements against to make your code difficult to read...
SELECT co1, co2, IF(3 > 18, co3, '') AS co3 FROM table INNER JOIN...
etc... or using COUNTs as parameters in conditional statements is as best as you're going to get (obviously performance may become an issue depending on how "obfuscated").

How to create a query in Data Method to select from OLAP cube in moxl reports?

I can without any problems run a sql query in DataMethods in Business Intelligence when I use DynamicsReports.
Question: How to use the same way for MDX query?
I want to run a MDX query in DataMethod because I need to work with the results - to use Linq to Datatable.
Is any way to do that, or to run a DataSet in DataMethod?
I assume that you want data access methods similar to SQL for MDX as well.
You can created linked server for SSAS and use openquery to exec MDX.
SELECT * FROM OPENQUERY(linked_server_olap, mdx_query)
You can execute this as sql statement / store procedure
Other alternative would be using ADOMD.NET

How does the Linq to SQL works?

I use Linq to SQL in my project. I fetch data from a SQL Stored procedure using it. It works perfectly, but I dont understand exactly how does LINQ SQL communicates with SQL server internally, where does it stores the data after fetching it? From where it gets the connection string?
Thanks in advance..
better to read: http://msdn.microsoft.com/en-us/library/bb425822.aspx