Thursday, February 02, 2012

How to: change DB owner name using T-SQL

Here is how you can do it using SQL Statement.

Method 1:

Using this method first we’ll get all the db objects and update with new db owner name.

DECLARE tabcurs CURSOR
FOR
SELECT 'olddbowner.' + [name]
FROM sysobjects
WHERE xtype = 'u'

OPEN tabcurs
DECLARE @tname NVARCHAR(517)
FETCH NEXT FROM tabcurs INTO @tname

WHILE @@fetch_status = 0
BEGIN

EXEC sp_changeobjectowner @tname, 'dbo'

FETCH NEXT FROM tabcurs INTO @tname
END
CLOSE tabcurs
DEALLOCATE tabcurs



Method 2:


This approach is simple and straight forward. Using this we will build the statements and you can copy them from the result window and execute


declare @OldOwner varchar(100) declare @NewOwner varchar(100) 
set @OldOwner = '353446_eda_db'
set @NewOwner = 'dbo'


SELECT 'sp_changeobjectowner ''[' + s.name + '].[' + p.name + ']'', ''' + @NewOwner + '''
GO'

FROm sys.Procedures p INNER JOIN
sys.Schemas s on p.schema_id = s.schema_id WHERE s.Name = @OldOwner
union
select 'sp_changeobjectowner ''[' + table_schema + '].[' + table_name + ']'', ''' + @NewOwner + '''
GO'

from information_schema.tables where Table_schema = @OldOwner


Hope this helps.

Tuesday, January 31, 2012

Microsoft Silverlight 4 Books

Here are some e books related to Silverlight 4.

http://libproject.net/programming/microsoft-silverlight-4-and-sharepoint-2010-integration.html

http://libproject.net/programming/microsoft-silverlight-business-application-development-beginners-guide.html

http://libproject.net/programming/pro-silverlight-in-vb.html

http://libproject.net/programming/microsoft-silverlight-business-application-development-beginners-guide.html

http://libproject.net/programming/pro-silverlight-in-c-2.html

http://libproject.net/programming/professional-silverlight.html

http://libproject.net/programming/foundation-expression-blend-with-silverlight.html

http://libproject.net/programming/microsoft-silverlight-data-and-services-cookbook.html

Hope these are useful. Good luck Thumbs up

How to add MIME types in Web.config on hosted Servers, Go Daddy, IIS 7 etc.

Ever wanted to add a custom mime type to your Web server?  I ran into this issue the other day when I tried to serve up .otf files related to fonts on my Web server and  I got this error: 404.3 error - mime type missing!

Thankfully, adding mime types is easier than ever thanks to the all-new distributed configuration option, which allows for IIS7 configuration to be stored in web.config files, along with asp.net configuration, to be deployed with your content. 

I'll show how easy it is to add mime types to your Web server.  This method will work on any IIS7 web server, and it will be ignored on all non-IIS7 web servers, so it should be safe to do no matter the type of application or content.  Since the <staticContent> section is delegated by default, the configuration snippets below should 'just work' on all IIS7 Web sites. 

  1. Open or edit the web.config in your site home directory.
  2. Add the following section in configuration section under web server.
<system.webServer>   
    <staticContent>
      <mimeMap fileExtension=".otf" mimeType="font/otf" />
    </staticContent>
</system.webServer>

This works even on Go Daddy hosted server also. You can add as many file times you want allow in this static content section.  For example these few MIME types you can add if you want on your Web server

<mimeMap fileExtension=".m4v" mimeType="video/m4v" />
<mimeMap fileExtension=".ogg" mimeType="audio/ogg" />
<mimeMap fileExtension=".oga" mimeType="audio/ogg" />
<mimeMap fileExtension=".ogv" mimeType="video/ogg" />
<mimeMap fileExtension=".webm" mimeType="video/webm"/>
<!-- For silverlight applicaitons -->
<mimeMap fileExtension=".xaml" mimeType="application/xaml+xml" />
<mimeMap fileExtension=".xap" mimeType="application/x-silverlight-app" />
<mimeMap fileExtension=".xbap" mimeType="application/x-ms-xbap" />

Hope this helps Thumbs up

How To Configure “BSNL” Nokia Siemens Router 1600 For Always ON with a secured WIFI Network

Recently I have configured my BSNL connection to always on for a secured WIFI network. In process I have learn that if you set "Network Authentication" to "Open" & "Enable" the "WEP Encryption" you can set a password to prevent unauthorized access. Both WPA - PSK, WPA2 - PSK are considered to be better than WPA & WPA2 encryptions as they were created to overcome the loop holes in WEP Encryption but, be advised that even they can be hacked in a matter of minutes.

To avoid entering user id & password on a Nokia Siemens Residential Router 1600 every time you connect do the following steps.

  1. Open the browser and type http://192.168.1.1 in the address bar, on being asked type both user id & password as admin, by default it will be admin/admin
  2. Now click on ADSL >> WAN
  3. In the 35_1 line (usually the first line) click on Edit
  4. Click on next, leave default
  5. Select PPP over Ethernet (PPPoE) & then click on Next
  6. In the page that appears next provide the user id & password you use to connect to the internet
    PPP Username: ((Type your user id in this field))
    PPP Password: ((Type your password in this field))
    leave the other options at default settings.
  7. Click on Next
  8. Ensure that Enable NAT & Enable Firewall are checked.
  9. Click on Next
  10. Click on Save


Hopefully this should do the trick Smile

Tuesday, January 17, 2012

IRCTC–MOBILE

IRCTC launches a smarter way to book tickets. Now book your rail ticket -ANYWHERE ANYTIME through your Mobile Phones.
IRCTC brings to you the mobile website https://www.irctc.co.in/mobile with just a few clicks you can book your tickets using your Mobile Phones. IRCTC mobile website is convenient and easy to use, can be accessed from any browser enabled mobile having basic GPRS activated on phone.
The following features are available:
Book Ticket/ Enquiry - Book tickets by providing source and destination.
Booked History - Tickets whose Date of Journey is due will be visible.
Cancel Ticket - Cancel any of the tickets whose date of journey is due.
Browse the URL using your mobile and book tickets using any of your credit/debit card for payment.