Sunday, September 21, 2014

Restoring a Database using bak files and SQL Scripts alone

The following is the script to restore any database from a .bak file without using Sql Server Management Studio
-- The database name in the restored bak file should be the same as the one given here RESTORE DATABASE [authserver] FROM DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL11.LOCAL\MSSQL\Backup\database.bak' WITH FILE = 1, MOVE N'authserver' TO N'C:\Program Files\Microsoft SQL Server\MSSQL11.LOCAL\MSSQL\DATA\database.MDF', MOVE N'authserver_LOG' TO N'C:\Program Files\Microsoft SQL Server\MSSQL11.LOCAL\MSSQL\DATA\database.LDF', NOUNLOAD, REPLACE, STATS = 10 GO

The world is as we see

An extrovertish view of the world around On the eve of a well started thursday, the penultimate day for a long work week, as often seen as this day 27th Feb 2014, I started my journey from my office working my way round to my home which stands farther from my office by approx 497kms. I made my way to the railway station, where we begin onboarding the train's to one's natives that are distant by approx 4hrs travel. My eldritch intuition began ringing within to pull off the strings from office to break for the week a day earlier and reach home to meet my lone parents. I reserved my berth in a train that get its ends loosened from the national capital a day before the ones that typically leave to my home town from my worktown, a sluggish way to get a confirmed birth. Though seemingly easy for an outsider, I have my painful way to kick-start off my travel by hurting myself for a two-and-a-half hour journey by scrambling for a seat to get me kinda comfortable for the next two-and-an-half hour journey. This so-felt painful travelling time has many-a-times gave me insights as to how the world spins off each day and how the time and people go head on to race each other. I onboarded a train in an unreserved compartment and a mini battle for a seat fetched me one amidst the other ones that I see as badgers. These people I mean are the ones from the part of the country that is perpendicular to where I am located [ beating around the bush, to evade a controversial demographic spec]. In what I saw in their faces was their parent's dream that their children could one day survive this gruesome world. I was some how moved by the way I perceived them that day. As time passed, I just started to drift my views among the persons that were seated in my compartment. The obvious findings were 1. The ones that called it their day were trying to doze off over the fleeing journey 2. The ones that I was perceiving as amiable ones, were finding hard time to get some food for a couple of them and the rest just gazing at each other and winding off their dinner with a couple of biscuits to fill their tummy to get them safe to their destination 3. As usual, the IT workers [explicit reference made, though sarcastic, I consider this to be a bit euphemistic], upper middle classes [one's that once dreamt of a smart phone, but now have a couple of them] started fiddling their gadgets to keep them occupied and show-off to the rest that they may be pompous, though I felt a prey into the latter category as time slipped off, you readers got to have me exempted from being so. The pathetic ones started off their chit chat and it progressed with a few prolonging the conversation and the rest just heeding their ears and eyes to live up to the rest. It is implicit that the reader comes in the same page that I am in now.... for the odd ones, you gotta hit the roads once to realize and stop reelizing. After half past a couple of hours, I get off the train and reach my intermediate station where I can onboard my train that will be ready to welcome me with a birth reserved on my name so that I can have a cozy journey way home. [I cite my class as a cozy one 'cos I feel blessed with the money and the comfort that I am gifted with, not to be perceived as an ostentation though]. In the mean time, an announcement in the station leaves my connective journey dangling by a deuce-ace hour delay of my train, the out of the blue schedule, esp for me to write this blog I guess. In this mean time, I start taking up a mild dinner, though not suiting my tongue, reminding me of my innate trait of damning things that I don't find interesting and later chiding and lamenting for it... [ it goes dexterously] with my case. As time passes, I move to the retiring room with the situation that I have totally drained off my batteries in a couple of my phones, but still trying to get their ends fried up. In the retiring room, I find my co-passengers and other people resting, it is a very tough task to get the readers see I perceived in my eye through the words, let me give it a shot here.... There were people in all the age range from approx 4 to 70. Some sitting in the arm chairs waiting to clock to tick fast and eager to hear the announcement that their respective train's have made the way to the nearby platforms to take them to their destined locations.... Quite a few awake like me [I see most of my nights, which you don't do and I wish better not done], just staring at each other. The kids sleeping on their parent's shoulders and wearing out their parents. I find a couple of family members that share the existing materials to keep themselves and their family members comfortable in the floor to have a quick nap till the announcement is for them. Readers are requested to condone me for the next para, though may be rated (R), it is what I found to be delivering my idea, Few people [a girl child and myself] trying to fiddle the gadgets and let the clock tick without bugging us a lot. The experience was consummate that I just fired up my windows box and started stroking my keys to get this to you all..., getting back to where I left off.... Most of the floor space, I find the news papers that served as a temporal bed to keep people on a fleeting R & R. Others preying on the bits of material [cloth] that could serve as their bed as well as a sheet to cover themselves from the unmeriful and vice mosquitoes [ hope you all agree with me... atleast the ones that could have been affected with dengue will sure be on my side here...] Some family members having a round-robin naps... This is how people do their travel, esp the underprivileged and the middle or lower and lower-middle classes. A night travel with these guys and gals gave me an opportunity, though lamentable and grim, was able to see the world in their shoes. Thank you reader [s] for your precious time to have travelled this long with me and enduring with my language and narration of the "one-night" travel experience. Not being interested in bogging you down, leaving a last note that you may also jot down some of your experiences so that the rest and have an insight in to how the "rest" works in this world... This is what I understand from some of my friends that always take the luxurious travel path and never peek around to the other world of people travelling within us day-in-day-out. With me left with a 16% battery life, I end this narration with "Have a Great Day and Bye..." from me... Written on 28-Feb-2014 between 00:50 - 00:15

World Peace day

As a protraction to the world peace day, I wish to present an extemporary propaganda. How about you making a wish now, for an ally or foe or a protagnoist (call it whatever) without an outlook. When you call it a day, just spare a couple of moments to ruminate on how was the day, had you experienced something good, be it a wish from someone. Had this wish bubble be kept springy, the world will ever require a day dedicated for world peace.

Friday, September 12, 2014

Static file content not served by IIS

Recently on encountering a issue where in the images / CSS / js and others being rendered with status as 200 (OK). But when looked in the browser, the content was not displayed.

The static modules were enabled in windows features along with the MIME type mapping.

Finally, when checking in the IIS Server, it was found that the Static module was missing in the handler registration. Updating that fixed the issue.

Tuesday, September 2, 2014

Could not load library when hosting the app in IIS

When an application is deployed in the server and if it throws the could not load library exception, we can enable the x86 support in application pool. In case any assembly was built targeting the x86 platform, this would be the right fix to make the site available.

However, it is strongly advised not to target specific platform unless a firm reason be found.