Categories
Ramblings Random

Windows Vista Customer Experience Program – Why Do I have To Click "On" Then "Off" Again?

image

After installing Microsoft Windows Vista SP1 – This pops up, just like when you install Vista fresh.

What gets me, is that the OK button is grayed out by default. I have to first click on the “Join the Windows Customer Experience Improvement Program” radio button and then back on “I Don’t want to join the program at this time” . Why is this? I want to just hit OK with the default choice. Just irks me I guess 🙂

Categories
Business Intelligence Geeky/Programming SQLServerPedia Syndication

SQL 2005, SSAS 2005: Using ascmd.exe To Create SQLAgent Jobs That Give You Completion Status

In SQL2005, you can create SQL Agent jobs. They can be scheduled, have multiple steps, alert, notify, etc. Pretty great setup. There are some downfalls though.

Like in order to call a job from a job, you need to execute the second job with T-SQL. Thing is, it doesn’t run synchronously. It runs asynchronously, which really stinks if you want to wait to see if the second job completes successfully or what not.

Another thing, if you call an XMLA script from a SQL Agent job, if the XMLA query or command fails, the SQL Agent job still reports success – that’s no good! What can you do? Use ascmd.exe!

ascmd.exe is a utility that you actually have to download the SQL Samples from CodePlex (http://www.codeplex.com/SqlServerSamples/Release/ProjectReleases.aspx?ReleaseId=4000) and then build the ascmd solution, to get ascmd.exe A few notes. The samples are VS2005, and I don’t have that installed ,so I had to open with VS2008, then it is digitally signed, and when building couldn’t find the .snk file to sign it, so I turned that off as well, after I had it built, I did some testing locally and made sure it would work as I wanted it to.

You can test by just calling it from the cmd line, for example:

ascmd.exe -S SSASServerName -d SSASDatabaseName -i MyXMLA.xmla

you can use -Q and try to pass in XMLA, but then you have to handle all the special characters and what not, which is a pain. Now, if you just put this on your C drive, (or wherever), then create a SQL Agent Job to call this command, it will fail the job if the ascmd.exe reports back failure. Exactly what we want!!

You will notice in the SQL Agent job setup that you can specify the value for a failed command  – 0 is the default and that is what we want.

Now, get some XMLA that you know works, set it up in the xmla file and test it, the job should succeed. Now just change something in the xmla (like CubeId) to some fake value and test it, the job should fail, and you can have it alert your DBA’s or whoever.

Pretty sweet, but I wish SQL Agent would handle failed XMLA like a failed query and report failure, I am not sure if in SQL 2008 it does that or not, but it would make life a lot easier. Otherwise you could be scratching your head trying to find where stuff is failing, looking in logs, etc, but not seeing any failures. The only way you would be able to tell is to run the XMLA manually, ugh 🙂

 

Categories
Geeky/Programming

Server Move: Hosting My Own Site(s)

Well, I have been on HostMySite for a few years now, and I just wasn’t liking it. I didn’t have control, and couldn’t do everything I wanted to. Last week I signed up with ServerBeach and I have my own dedicated server. I am running Windows 2003, IIS, SQL, MySQL, PHP, etc.

I changed for now my DNS to GoDaddy from Active-Domain, since GoDaddy has SPF records (for Google talk federation, etc). I might change that up here in the future as well.

Transferring a domain takes way to long! Took like 4 days overall. Also, I first went with EasyCGI , a VPS solution, but the box couldn’t get to the Internet! I put in tickets, etc, they just wouldn’t fix it, so I canceled and went to ServerBeach. I am liking them so far, they had the server provisioned in about 4 hours.

One thing I can do now as well, is write a site for myself and import all the log files (Firewall, SMTP, All the Sites, FTP, etc) and have a nice little reporting solution.

ServerBeach is good, very professional. If you want to sign up, use referrer code BW27Q37B6D  (http://www.serverbeach.com/)

To get PHP/MySQL/WordPress, I loosely followed these three tutorials

How to Install PHP on IIS 6.0
How to Install MySQL On IIS 6.0
How to Install WordPress on IIS 6.0

For my ASP.NET Site, it was just copying over files and configuring IIS a little. For my blog, I used this dbbackup plugin (http://www.ilfilosofo.com/blog/wp-db-backup/) and then once I had my WordPress files over, and MySQL/PHP running, I connected to the instance of a DB I created and ran the SQL backup script, which created everything the way I needed it for WordPress.

For Mail, I use the built in SMTP in Windows 2003. I just had to turn on relaying, but yeah, spammers, so I just allowed the local server to send mail, and it works. Tested it using this (http://support.microsoft.com/kb/323350) and it worked.

Other than that, its pretty much basic server admin stuff. Firewall, FTP, etc. Everything is running smooth… for now 🙂

I will just have to make sure I have backups!

 

Categories
Random

Hitting the Threshold: More Facebook Friends than MySpace Friends

well, today, I have more Facebook friends than MySpace friends. That is a first. 149 to 147. What does that say? I have been on MySpace longer, so it seems that more people are using Facebook, or using both, now. I like Facebook better, for sure. They both could use some work though.

Seems that lately, I have been using Pownce and Twitter more than Facebook/MySpace.

Everything is cyclical

 

Categories
Random

Happy 3-11 Day

Today is 3/11 – the day for my favorite band, 311 !!!

The are in New Orleans putting on a HUGE show, probably playing 80 or so songs, I am sure it rocks!

Technorati Tags: ,,
Categories
Geeky/Programming

Google Apps For Your Domain – Google Talk, Federation, SRV Records, Domain Transfers, DNS

Well, I want my Google Apps (GAFYD) account to be able to use Google Talk with other users (using Federation) besides Gmail and GAFYD (ex: Twitter, Meebo, etc). To do this, you need to add SRV records to your DNS (http://www.google.com/support/a/bin/answer.py?answer=34143) – no problem right?

Well, my current hosting (hostmysite) doesn’t allow SRV records, so after going at it with Tech Support the answer was to "switch to another DNS provider". Yikes. My current registar is active-domain, which doesn’t support SRV records either (from what I can tell). GoDaddy does, so I will transfer my domain there. Another no problem, right?

I initiate the transfer from active-domain to GoDaddy, but then read in the FAQ on active-domain I have to manually request to be transferred to get the auth code. Still waiting for that. Then I will have to make sure GoDaddy is set up as active-domain was so my stuff still works. Then, I can finally change GoDaddy to run all the DNS for the domain instead of just pointing to hostmysite’s nameservers.

I tell ya, nothing can be easy. 🙂

Categories
Geeky/Programming SQLServerPedia Syndication

SQL DBA: Function To Get Database Last Restore Time (From Log Shipping Filename)

If you need to get the last time that a database is restored from log shipping based off the transaction log file name, here is a function to do so. It parses out the date from the "last_restored_file" column, then converts it from UTC to your regular time.

 

CREATE FUNCTION [dbo].[GetLogShippingFileDate]
(
    @DatabaseName varchar(100)
)
RETURNS smalldatetime
AS
BEGIN

    DECLARE @Result smalldatetime

    SELECT  @Result =
    CAST(SUBSTRING(fds,5,2)+’/’+SUBSTRING(fds,7,2)+’/’+LEFT(fds,4) + ‘ ‘ + SUBSTRING(fds,9,2) + ‘:’ + SUBSTRING(fds,11,2) AS SMALLDATETIME)
    FROM (
    SELECT secondary_database AS  ‘DatabaseName’,
    LEFT(RIGHT(last_restored_file,18),14) AS ‘fds’
        FROM  
        msdb.dbo.log_shipping_secondary_databases
    ) a
    WHERE DatabaseName = @DatabaseName

    — convert the UTC file time to regular time
    SELECT @Result = DATEADD(HOUR,DATEDIFF(HOUR,GETUTCDATE(),GETDATE()),@Result)

    RETURN @Result

END

 

Categories
Geeky/Programming

Visual Studio 2005/2008 Web Application Projects: Profile Class Auto Generation Workaround

I have been doing some coding with VS2008, and have been playing with the .NET Membership, Role, and Profile providers. I don’t use "Web Sites" when I create projects, instead I use "Web Applications" – what is the difference? Web Sites don’t really act like a first class application, there are some weird things with references, the bin directory, etc. Web Application act like a console app, or windows form app, the way you can reference assemblies, etc. There are a ton more differences I am sure, but those are the ones that stand out for me.

Now, with the Profile stuff in ASP.NET, you can use a Login control, and CreateUserWizard control, and then hook up your site to a SQL backend using the ASP.NET Membership provider. Everything works great. But you can also add custom properties (ex: First Name, Last Name, etc) to your user’s "Profile". You add these settings in the Web.Config

<profile enabled="true">
    <properties>
        <add name="FirstName" type="string"/>
        <add name="LastName" type="string"/>
        <group name="Address">
            <add name="Address1" type="string"/>
            <add name="Address2" type="string"/>
            <add name="City" type="string"/>
            <add name="State" type="Int32"/>
            <add name="Country" type="Int32"/>
            <add name="PostalCode" type="string"/>
        </group>
        <add name="PhoneNumber" type="string"/>
    </properties> 
</profile>

and then when you build your project, Visual Studio is supposed to auto create a class behind the scenes with those properties. This works fine if you use a "Web Site", but fails to do so when you have a "Web Application"

In VS2005, there was an add in you could install that would auto create this class on build, and there is one as well for VS2008 – Web Profile Builder.

You can use the Web Profile Builder which just creates a class for you, or you can create your own, or you can just code around it, like this:

CreateUserWizard cuwWiz = (CreateUserWizard)lgnView.FindControl("CreateUserWizard1");

ProfileBase p = ProfileBase.Create(cuwWiz.UserName, true);

p.SetPropertyValue("FirstName", ((TextBox)cuwWiz.CreateUserStep.ContentTemplateContainer.FindControl("txtFirstName")).Text);
p.SetPropertyValue("LastName", ((TextBox)cuwWiz.CreateUserStep.ContentTemplateContainer.FindControl("txtLastName")).Text);

p.GetProfileGroup("Address").SetPropertyValue("Address1", ((TextBox)cuwWiz.CreateUserStep.ContentTemplateContainer.FindControl("txtAddress1")).Text);
p.GetProfileGroup("Address").SetPropertyValue("Address2", ((TextBox)cuwWiz.CreateUserStep.ContentTemplateContainer.FindControl("txtAddress2")).Text);
p.GetProfileGroup("Address").SetPropertyValue("City", ((TextBox)cuwWiz.CreateUserStep.ContentTemplateContainer.FindControl("txtCity")).Text);
p.GetProfileGroup("Address").SetPropertyValue("State", Globals.IntParse(((DropDownList)cuwWiz.CreateUserStep.ContentTemplateContainer.FindControl("ddlState")).SelectedValue));
p.GetProfileGroup("Address").SetPropertyValue("PostalCode", ((TextBox)cuwWiz.CreateUserStep.ContentTemplateContainer.FindControl("txtPostalCode")).Text);
p.GetProfileGroup("Address").SetPropertyValue("Country", Globals.IntParse(((DropDownList)cuwWiz.CreateUserStep.ContentTemplateContainer.FindControl("ddlCountry")).SelectedValue));

p.SetPropertyValue("PhoneNumber", ((TextBox)cuwWiz.CreateUserStep.ContentTemplateContainer.FindControl("txtPhone")).Text);

p.Save();

Using ProfileBase lets you get around the use of the auto generated class, or the hand created class you might make. It does make it a little harder to set and get the properties though. If you did have the WebProfile or ProfileCommon class, you could just say

wp.FirstName = "Steve";

I wrestled with this profile stuff here for a good hour or two before I finally found on the net that Web Applications don’t auto create the class, etc. The class that it does generate though is derived from ProfileBase, so you can just use that and be OK. It would be nice if Web Application Projects did create the class though, it would have saved me a couple of head scratching hours. 🙂

Categories
Business Intelligence Geeky/Programming SQLServerPedia Syndication

SSAS 2005: Cube Perspectives Are Good, But Something Is Missing…

In SQL Server Analysis Services 2005, you can create "perspectives" on cubes. What a perspective can do, is allow you hide different dimensions, measure groups and attributes. This works great but I still think there are a few things that are missing.

The first thing is that the cube itself is a perspective, one that is always there and you cannot hide. In a scenario where you want to build a cube but then have multiple perspectives, but you don’t want end user clients to see the main cube, or use the main perspective, you can’t do it, or at least I cannot find a way to do it. 🙂

The second thing is, which really is more to do with linked objects, is that when you link in a dimension, for instance, you cannot hide or show attributes, you are stuck with what is in the main dimension in your source cube. So what do you do? Use a perspective. But if SSAS let you hide attributes, etc on the dimension, it would let you forgo the use of perspectives.

The third thing is just security in general. You cannot secure a perspective. If you want Accounting to see XYZ perspective, and HR to see ABC perspective, but you don’t want them to see each other’s perspectives, you are out of luck, and need to come up with a new solution, which probably involves crazy security in your cube, or creating new cubes that link in dimensions and measure groups from the main cube.

Don’t get me wrong, SSAS 2005 is a vast improvement over SSAS 2000, but there are just a few things that I feel are missing, or , I might not know about how to enable some of the things I want to do. 🙂 I know SSAS 2008 has more improvements and that will be a good change, hopefully there are some cool things that let you manage your cubes and perspectives a little better.

Categories
Business Intelligence Geeky/Programming SQLServerPedia Syndication

Reporting Services: Can't Uninstall – The setup failed to read IIsMimeMap table. The error code is -2147024893

Ran into this error tonight trying to uninstall SQL Server Reporting Services. Not sure if it is just Vista, or XP and other OS’s as well, but the fix is to stop IIS and then re-run the Uninstall.