Thursday, May 27, 2010

Windows Vista:: how to delete failed mapped network drive?

NET USE * /delete will delete all network drives and printers. Replace the * with the full UNC path and share name to delete a specific connection to a share. A standard user may not have the rights to disconnect from a network share.

Tuesday, May 25, 2010

Analysis Services:: Problem Starting SQL Server Analysis Services.

For those who are facing problem in Starting SQL Server Analysis Services, please follow the following steps to fix the issue.

Open Control Panel
Go to Regional and Language Options Locale Settings
Change the Format, Location and Administrative from English(India) to English(United States)
Restart the System
Once your system is Restarted open the Registry Editor (from Start = > Run => regedit)
Navigate to HKEY_USERS
Look for LSA entry @ S-1-5-18
Search for LocaleName
Update the following keys
Locale = 00000409
LocaleName = en-US
sCountry = United States
10. Open the SQL Server Configuration Manager, and start the SQL Server Analysis Services.

FYI: This is caused because Windows Vista is supporting en-IN whereas SQL Server 2005 does not provide support for en-IN, so if you try to run SQL Server Analysis Services it will give the following exception (can be found in Event Viewer)

The service cannot be started: Message-handling subsystem: The message manager for the default locale cannot be found. The locale will be changed to US English. Errors in the metadata manager. LOG file extension can be only .LOG. Message-handling subsystem: The message manager for the default locale cannot be found. The locale will be changed to US English. Message-handling subsystem: The message manager for the 16393 locale cannot be found. Internal error: Failed to generate a hash string.

http://dotnetslackers.com/Community/blogs/bmdayal/archive/2009/04/04/problem-starting-sql-server-analysis-services.aspx

Monday, May 24, 2010

Reporting Services:: Subscription Fail - The user or group name ‘Domain\User’ is not recognized

For any of you that work closely with Reporting Services, I am sure you can vouch that the system offers a great amount of flexibility and capability. At the same time though you also have probably encountered your fair share of strange, random and undocumented issues. One today I found happened with a Subscription.

Failed sending mail: The user or group name ‘Domain\UserNoMore’ is not recognized

Recently, we had a user leave the company. For the sake of this article we will happily refer to him as UserNoMore. When you create a subscription you are not propted to define an owner. You get the happy assignement automagically. When the user account is deactivated authentication ceases and emails and file archives begin to fail.

In my experience here it took a little finess and hackery to correct. Now let me first say I niether condone nore dismiss the need of making direct changes to data. So in this case after attempting any known fix or finding any interface I determined the fix would be in a bit of DML. Really the fix was pretty simple. Find the subscription, determine a different user to own, update the subscriptions. In this case I selected the service account for Reporting Services so I wouldn’t have to worry later (and I guess technically you could do this for all subscriptions if thats how you shop is set security wise).

In the ReportServer$InstanceName database for reporting services you will find 3 key tables:

Catalog – Reports, Folders and basically all Items
Subscriptions – The scheduled report processes
User – Well…any user or group in Reporting Services

Step 1- Get the Report ID in Question

SELECT ItemID, Name
FROM [ReportServer$InstanceName].[dbo].[Catalog]
WHERE [Name] =‘MonthlySalesReport’
and [Type] = 2 –Report Item Type

Step 2 – Find the Subscription

SELECT

[SubscriptionID],[OwnerID],[Report_OID]
FROM [ReportServer$InstanceName].[dbo].[Subscriptions]
WHERE [Report_OID] = ’1551AA5B-0FF1-494B-8725-73E22AA34D9F’

Step 3 – Select another User

SELECT [UserID],[UserName]
FROM [ReportServer$InstanceName].[dbo].[Users]
WHERE [UserName] = ‘Domain\RSServiceAccount’

Step 4 – Update the Subscription

UPDATE

[ReportServer$InstanceName].[dbo].[Subscriptions]
SET [OwnerID] = ’6BDB4964-EE28-4E96-BCB2-E4509FAC909B’
WHERE [OwnerID] = ’3D272CE2-A9B3-4B89-8993-C72E8D43A6EE’
AND [Report_OID] = ’1551AA5B-0FF1-494B-8725-73E22AA34D9F’

Really an easy fix…not clean but it worked for me. Feel free to provide feedback.

Enjoy!


http://speeddba.wordpress.com/2008/10/17/failed-sending-mail-the-user-or-group-name-domainuser-is-not-recognized/

Saturday, May 22, 2010

Set permissions on SSRS

  1. Run Sql Server Management Studio as Administrator (right click "Run as Administrator")
  2. Connect to a Reporting Services server using Windows Authentication.
  3. Right click Home, Select Properties, Select Permissions.
  4. Click Add Group or User, Type your Username, Click Ok.
  5. Check the box for Content Manager, Click Ok.

Now you can access Reporting Services via Sql Server Management Console without running as administrator.

You should also have permissions to browse Report Manager (http://localhost/Reports). If not, but you do see the Information Bar complaining then add http://localhost/ to Explorer's Trusted Sites Zone.

Friday, May 21, 2010

How to Disable Adobe Updater

  1. Step
    1. 1

    Open "My Computer" by double-clicking on the desktop icon or clicking on the "Start" menu and selecting the "My Computer" button. Open the drive that contains your Adobe programs. By default, this is the "C" drive.

  2. Step2

    Double-click on "Program Files" to view software files installed on your computer. Open the "Common Files" folder by double-clicking on the folder name.

  3. Step3

    Locate the Adobe folder and double-click on it to open it. The Adobe folder contains files for all Adobe programs installed on your system. Locate and open the Adobe Updater folder, which will be named "Updater" followed by a version number, such as 5 or 6.

  4. Step4

    Locate the executable file titled "Adobe Updater" within the "Updater" folder. Double-click the file to initiate the Adobe Updater application. The program will take a few moments to connect to the Internet to search for updates.

  5. Step5

    After it finishes searching, a prompt window will appear to install new updates. Click "Preferences" on the left-hand side and uncheck the "Automatically check for Adobe updates" box. Click "OK" to accept the changes. Adobe Updater will not check for available updates unless manually instructed to do so.


http://www.ehow.com/how_5098323_disable-adobe-updater.html

Thursday, May 20, 2010

SubSonic 2.x

http://www.codeproject.com/KB/database/SubsonicDAL.aspx

Wednesday, May 19, 2010

SQL Server:: VIEW in a VIEW

AVOID REUSING VIEW IN ANOTHER VIEW

Subsonic

SubSonic2
Work through
http://www.codeproject.com/KB/database/SubsonicDAL.aspx

SubSonic3
FAQ
http://subsonicproject.com/docs/SubSonic_3_Frequently_Asked_Questions

How to generate classes for Views
http://stackoverflow.com/questions/1078311/sql-views-in-subsonic-3-0

Classes generated for View DO NOT work
http://stackoverflow.com/questions/1299998/activerecord-and-gethashcode-fails-if-int-is-nullable



Friday, May 14, 2010

Java Script

Lesson 1
Lesson 2

SQL Server :: Storing Images and BLOB files

  1. Insert BLOB 

    INSERT INTO BLOBTest (BLOBName, BLOBData)  

     SELECT 'First test file',    

      BulkColumn FROM OPENROWSET(Bulk 'C:\temp\nextup.jpg', SINGLE_BLOB) AS BLOB 


 

http://www.databasejournal.com/features/mssql/article.php/3724556/Storing-Images-and-BLOB-files-in-SQL-Server-Part-2.htm


 

  1. Export BLOB 

    bcp "select datei from Person.Address WHERE
    addressid=1 " queryout "c:\TestOut.doc" -T -n -Slocalhost\AdventureWorks

http://www.sqlservercentral.com/Forums/Topic487470-338-1.aspx

Monday, April 12, 2010

Where have all the good guys gone?

Pritish Nandy, 12 April 2010, 11:17 AM IST

I was born into a world without villains. The British had left India. We were a free nation. There were many heroes: Gandhi, Subhash Bose, Sri Aurobindo, Nehru, Sardar Patel, Maulana Azad, Ambedkar. Remarkable guys who fought, each in his own way to bring us freedom. A spanking new nation was about to be built. Everyone was excited. It was heady times; it felt great to be an Indian. All our other identities were subsumed.

Yes, there was a bloody Partition. Many had lost their homes and families. Some people were angry, very angry, but that anger was specific. It was directed at those responsible for the bloodshed. It was not free floating rage. No one in those days was stupid enough to confuse Pakistanis with Muslims or the British with Christians. Everyone was anxious to put the past behind and get on with the task of building a new India. Since I grew up in Kolkata I met many people, Hindus and Muslims, who had fled what was then East Pakistan. They were trying hard to rebuild their lives. The locals did not see them as unwelcome immigrants. Instead, they went out of their way to help them. I remember my mother giving her blouses to a refugee woman to embroider even though she could barely afford it on her meagre school teacher’s salary.

There was magic in the air, the magic of nation building. There were dreams that everyone dreamt, of creating a new India where we would all be Indians first. In our living room hung pictures of Rabindranath Tagore, Gandhi, Subhash Bose. My father would proudly tell me stories of the freedom struggle and politicians were then our biggest heroes. No, I never heard of a film star or a cricketer then. We spoke only about politicians and how they would change India. We believed in them. We admired them.

By the time I was in high school things had changed. People were burning buses and trams to protest against a one paisa ticket price rise. It wasn’t actually the price rise. It was free floating rage against being let down by the political class. When I joined college, the best students of my class vanished one day only to surface in Naxalbari fighting for what they saw as a just cause, the rights of the rural poor. I may not have agreed with them but like all young men of the time I believed in the good fight. Student politics in Europe was hotting up. Tariq Ali in England, Daniel Cohn-Bendit in Paris, Rudi Dutschke in Germany inspired the May uprising in Europe. Governments began to feel threatened by youth power. Che was the new idol and young people swore by his vision of a new world. But no, it didn’t take long for disenchantment to set in. Marxism became the God that failed.

It wasn’t only Marxism. Politics failed India. Pictures of politicians in the living rooms disappeared. We read about bloody clashes between political parties, religious groups, castes, communities. Regional issues reared their head. New conflicts emerged. We began to hear of crimes we had never heard before. Suddenly there were villains all around. People we began to hate, who were among us but not one of us. Politics became murky; we began to seek our heroes elsewhere. Actors became stars. So did writers, singers, journalists, sports people. Doctors, teachers, social workers were still respected. Some of them migrated to politics, won elections. But our world without villains had changed forever.

Today we live in a world where villains are everywhere. Politics has more than its share and even though everyone wants to be in politics, the reasons are different. Politics hardly offers nation building opportunities. It offers money, power, pelf. So do some other professions as well but politics is the shortest cut. That’s because at the heart of it lies all pervasive corruption. An honest politician today is as rare as the mountain quail that ornithologist Salim Ali spent his whole life searching for. When I began my life as a journalist, it was possible to expose a corrupt neta and see him sacked or punished. Today, if you expose a corrupt neta, you are more likely to get sacked yourself.

Then there are the other villains around us. Terrorists, extortionists, underworld syndicates, Maoists (often confused with the Naxalites of yore), the khaps who love to murder their own, suicide bombers fighting for lost causes, bigots who beat up young girls for drinking or wearing short dresses, fundamentalists constantly in search of new victims, regional groups who see other Indians as the enemy, book burners, art vandals, hackers, poachers who are wiping out entire animal species, corrupt Government officers, rogue policemen, environmental predators, fake drug manufacturers, the land mafia encroaching on public land in connivance with those who are supposed to protect it. The villains are everywhere, growing by the day. Where have the heroes gone? I often wonder. Where’s the India we once dreamt of?


64bit ODBC Driver

Scenario: Consume MySQL data in a report or in a SSIS package
- Install 64bit version of ODBC driver
- Create a User/System DSN on the machine
- Use the DSN in place of Buid Command

Run SQL Job from website on 64bit machine

Error: Problem with Microsoft.SqlServer.BatchParser.dll on Windows 64-bit


Download: SQLServer2005_XMO_x64.msi (pre req sql native client)


Permission to run SQL Job

1. Select database user
2. Go to database mapping
3. Select msdb database
4. look for privilege window below
5. Select all the rights related to SQL Agent
6. Save/Submit

Tuesday, April 06, 2010

SSIS Package on 64 bit machine

debugging
For the SSIS packages that really don't make use of the 64-bit processor, the SSIS project property Run64BitRuntime can be set to False. This is a instruction to load 32-bit runtime environment rather than 64-bit, and your packages would still run without doing any plumbing work. The property can be found under SSIS Project Property Pages -> Configuration Properties -> Debugging.


Run as SQL Agent Job
JobType: Operating system (CmdExec).
Package Path: "C:\Program Files (x86)\Microsoft SQL Server\90\DTS\Binn\DTExec.exe" /FILE "" /MAXCONCURRENT " -1 " /CHECKPOINTING OFF

Other Links

Wednesday, March 31, 2010

Your riot was worse than mine

http://www.hindu.com/2010/03/31/stories/2010033157731000.htm
When double standards take charge, it is the victims of communal violence who suffer, be they the Sikhs of Delhi, the Muslims of Gujarat or the Pandits of Kashmir.

India's polity has an unerring taste for the irrelevant. That is why the controversy over a sitting Chief Minister being summoned to answer questions about mass murder has made way for an unseemly debate about the morality of an ageing actor. After his embarrassing, nine-hour appearance before the Special Investigation Team, one would have thought Narendra Modi presented a large enough target. Instead, the Congress has chosen to launch a full-throated campaign against Amitabh Bachchan for choosing to become a brand ambassador for tourism in Mr. Modi's State. The party has accused the Bollywood superstar of being indifferent to allegations of State complicity in the massacre of Muslims which took place there in 2002. And it has started boycotting him in a manner that is as crude and mean-spirited as it is ineffective and pointless. Thanks to this, the mass media are today discussing Big B rather than the Little Men whose role the SIT is now investigating.

As can be expected, the Gujarat Chief Minister is thrilled. The spotlight which was earlier on him is now being trained elsewhere. Instead of being forced to rally others to his own defence, Mr. Modi has happily mounted the barricades on behalf of Mr. Bachchan. In keeping with his party's fondness for technology and Islamophobia, he has blogged that the actor's critics are ‘Talibans of untouchability'.

If Mr. Bachchan is guilty of overlooking mass violence today, it is because equally illustrious gentlemen, including some industrialists, did the same when they declared Mr. Modi prime ministerial material. For that matter, the actor himself has done this sort of thing before. In his movies, Mr. Bachchan was a crusader for the underdog. In real life, he is attracted to the kind of powerful men he once fought on the big screen. His fans have a right to feel cheated. Political parties, especially the Congress, do not have that right.

The party finds fault with him for representing Gujarat in the wake of 2002. But in 1984, barely weeks after the blood in the streets of Delhi had dried, the actor accepted a Congress ticket for Allahabad and got elected to Parliament. “As a brand ambassador does he endorse or condemn the mass murder in Gujarat?” Congress spokesperson Manish Tiwari asked the other day, adding: “It is high time Amitabh Bachchan came out and said what his position on [the] Gujarat riots is.” Despite the party having ‘apologised' for its role in the massacre of Sikhs following Indira Gandhi's assassination, I doubt Mr. Tiwari or any other Congress spokesman will ever ask Mr. Bachchan what his position on the Delhi riots was or is.

But if the Congress prefers to forget the history of 1984, the BJP and its leaders act as if history ended that year. In their telling, 2002 either didn't happen or pales in comparison with what preceded it. And so begins the sordid exercise of weighing the suffering of victims and, worse, of playing the plight of one set against another. Mention the suffering of the Muslims of Gujarat and the BJP will start talking about the plight of the Pandits, driven by terrorism from their homes in the Kashmir Valley in 1989 and 1990. Try talking about the injustice done to the Sikhs of Delhi and the Congress will insist on speaking only of Gujarat. And the minute the microphones in the studio are switched off, the politicians are quite happy to forget about the shared travails of all victims.

The reality is that the Delhi and Gujarat massacres are part of the same excavated site, an integral part of the archaeology of the Indian state. Eighteen years separate 2002 from 1984. Eighteen is normally the age a human being is considered to have become an adult. Inhumanity also seems to take 18 years to fully mature. In an act of conception which lasted four bloody days, something inhuman was spawned on the streets of Delhi in 1984; by 2002, it had fully matured. Paternity for the ‘riot system' belongs to both the Congress and the BJP, even if the sangh parivar managed to improve upon the technologies of mass violence. Both knew how to mobilise mobs. Both knew how to get the police to turn the other way. Both knew how to fix criminal cases. Both knew what language to speak, even if one set of leaders spoke of a ‘big tree falling' and the other paraphrased Newton. Both had the luxury of not being asked difficult questions by criminal investigators. Until now.

There is one school of thought that Mr. Modi's summons and interrogation have come eight years too late. There is a lot of merit in that point of view. But the reality is that the call for a leader to render account for mass crimes committed on his watch comes 18 years too late. Veteran journalist Tavleen Singh said recently that if Rajiv Gandhi had been interrogated in 1984 about what happened to the Sikhs, Gujarat would not have happened. She is right. Had the courts and the entire edifice of the Indian state not failed the victims of 1984, many, many politicians, police officers and officials would have gone behind bars. Had that happened then, every leader would have been forced to think a hundred times about the legal consequences of instigating mass violence or allowing mobs to go on the rampage.

The debates on Mr. Modi over the past two weeks have been so incredibly divisive because neither the Congress nor the BJP is interested in a discussion on systemic remedies. Justice is about punishing individuals, rehabilitating victims and dismantling the infrastructure of communal terrorism. But our biggest parties want nothing to do with any of that. Gujarat 2002 should go unpunished because Delhi 1984 never saw justice, says the BJP. ‘No SIT ever interrogated Rajiv Gandhi so why is Mr. Modi now being interrogated?' is the party's self-serving refrain. On its part, the Congress is unwilling to incorporate in the draft Communal Violence Bill clear-cut legal provisions that could deter politicians and policemen from again abusing their power as they did in 1984 and 2002.

One of the questions the SIT was expected to ask Mr. Modi during his interrogation on March 27 was what exactly he said when Ehsan Jaffrey called him up on February 28, 2002, asking for help. The question is important because soon after the former MP put down the telephone, he was killed by a mob along with 58 other innocent people. I have no idea whether that question was put to Mr. Modi, let alone what his answer was. But when the same question was put to Jai Narayan Vyas, official spokesman of Mr. Modi's government, in a televised debate a few days ago, the answer was atrocious. Ehsan Jaffrey had been a Congress MP, said Mr. Vyas. “So I demand to know what the Congress party did to help him.”

There was, of course, nothing the Congress could have done to save the doomed member then. The BJP was in power in both Gujarat and the Centre. But the party has a chance to do something now: Pass a law with real teeth. It's been more than a quarter-of-a-century since a big tree came crashing down upon us. It is time for the earth to stop shaking.

Tuesday, March 30, 2010

True skill

By Paulo Coelho

The yogi Raman was a true master of the art of archery. One morning, he invited his favourite disciple to watch a display of his skill. The disciple had seen this more than a hundred times before, but he nevertheless obeyed his teacher. They went into the wood beside the monastery and when they reached a magnificent oak tree, Raman took a flower which he had tucked in his collar and placed it on one of the branches.

He then opened his bag and took out three objects: his splendid bow made of precious wood, an arrow and a white handkerchief embroidered with lilacs.

The yogi positioned himself one hundred paces from the spot where he had placed the flower. Facing his target, he asked his disciple to blindfold him with the embroidered handkerchief.

The disciple did as his teacher requested.

‘How often have you seen me practise the noble and ancient sport of archery?’ Raman asked him.

‘Every day,’ replied his disciple. ‘And you have always managed to hit the rose from three hundred paces away.’

With his eyes covered by the handkerchief, the yogi Raman placed his feet firmly on the ground, drew back the bowstring with all his might – aiming at the rose placed on one of the branches of the oak tree – and then released the arrow.

The arrow whistled through the air, but it did not even hit the tree, missing the target by an embarrassingly wide margin.

‘Did I hit it?’ said Raman, removing the handkerchief from his eyes.

‘No, you missed completely,’ replied the disciple. ‘I thought you were going to demonstrate to me the power of thought and your ability to perform magic.’

‘I have just taught you the most important lesson about the power of thought,’ replied Raman. ‘When you want something, concentrate only on that: no one will ever hit a target they cannot see.’