Showing posts with label window. Show all posts
Showing posts with label window. Show all posts

Friday, March 30, 2012

putting mdx query in sql job and emailing the results?

Is this possible to email w/ just using the job script window, as long as working with 2D and 3D queries?

I want to know the dates of data in the cube ie:

WITH MEMBER Min1 as

Head(Exists([Date].[Date].[Date].Members, , 'Internet Sales'))(0).MemberValue

MEMBER Max1 as

Tail(Exists([Date].[Date].[Date].Members, , 'Internet Sales'))(0).MemberValue

SELECT {Min1, Max1} on COLUMNS

FROM [Adventure Works]

In the past, I've used xp_sendmail to send out query results. Of course, this requires a SQL query to be performed. One option here would be to perform the MDX query through a SQL OPENROWSET function call. This KB article is a little dated but shows you the basics: http://support.microsoft.com/kb/218592.

So, I have to ask, where are the dates in the OLAP cube coming from? Are these coming from a relational database? If so, could you more easily just query that database?

B.

|||I could query the sql data. but I wanted to know without a doubt that the data is in the cube. I can more easily look at my email than remote in to connect to the cube.

I'll first try openrowset().
Thanks!

Tuesday, March 20, 2012

pulling a pdf out of a blob and displaying it in a browser window

I need to pull a PDF file out of a blob that I have uploaded it into. We
need it available on the web.
I can't think of how to utter a statement that will allow acrobat reader to
know that it needs to fire and open what is in the blob.
Ack.In your client code, create a memory stream, or byte arrray, and just write
the contents of that stream or byte array out to the web client using
Response.write...
To tell client browser to load Acrobat reader, just set the
Response.ContentType...
Don't know what you web server programming language is.. but in C#, it
would be:
Response.ContentType = "application/pdf";
"Linda Lalewicz" wrote:

> I need to pull a PDF file out of a blob that I have uploaded it into. We
> need it available on the web.
> I can't think of how to utter a statement that will allow acrobat reader t
o
> know that it needs to fire and open what is in the blob.
> Ack.|||Just like images, except you set the ContentType to application/pdf instead
of image/gif.
http://support.microsoft.com/kb/173308
However, just like images, you may consider storing them in the filesystem.
http://www.aspfaq.com/2149
This is my signature. It is a general reminder.
Please post DDL, sample data and desired results.
See http://www.aspfaq.com/5006 for info.
"Linda Lalewicz" <LindaLalewicz@.discussions.microsoft.com> wrote in message
news:17F6237B-C408-46CE-9194-0DB528D4B255@.microsoft.com...
>I need to pull a PDF file out of a blob that I have uploaded it into. We
> need it available on the web.
> I can't think of how to utter a statement that will allow acrobat reader
> to
> know that it needs to fire and open what is in the blob.

Monday, March 12, 2012

pull subscription

My name is Tech guy,
I want to use window script program to execute a pull subscription installed on SQL 2005 express edition. Because it free for downloand.
is there a script that can call an existing pull subscription execution.I want to use window script program to execute a pull subscription installed on SQL 2005 express edition.
Do you mean VB or Java script...?

Using Enterprise Manager you can generate a SQL script.

select Pull Subscription -> Press Right Hand Key -> Generate SQL Script.

Modify script for subscriber name, subscriber DB etc.|||thanks Rajesh for replying my question.
Here is the problem. I created a pull subscription and pull subscription script file in SQL 2005 Management express. but the express does not have option to run a schedule job. I want to create a vb script to run that pull subscription script file. I cannot find a command for execute the pull subscription package in vb script.
example:
dim objserver
set objserver = createobject("SQLDMO.SQLserver")
obvjserver.loginsecure = true
objserver.connect "."
objserver.script, "myPullSubscription.sql"
set objserver = nothing

I need a vb command to execute mypullscubscription.sql because the one I used above does not work.|||You could launch osql.exe (or sqlcmd.exe in 2005) to execute any .sql script from a shell script.|||Can you give me an example script using osql to execute a pull subscription file. do I need to log on SQL management in order to run qsql?|||there are many resources on the net for osql. just google "osql syntax". Here's an example:

http://www.sql-server-performance.com/rd_osql.asp

it's a console app that you can use to execute arbitrary scripts. If you are on 2005, use sqlcmd.exe though. it's better. :)|||Using osql you can run any TSQL script, it's command prompt utility. You can refer Books OnLine from Query Analyzer.