Thursday, July 23, 2009

TRIGGER - After / Before / deleted / inserted - MS SQL

 

TRIGGER

            There are

                        BEFORE (trigger)

                        AFTER (trigger)

 

In BEFORE Trigger .

            There is no keyword in MS sql. Instead it defines for.

It is a default trigger

 

In AFTER Trigger.

            There is a keyword in MS sql.i,e After.

 

 

We can get rows which are stored in temporary table by trigger.

            Insert / update

                        Get values from inserted. ( select * from inserted) (copy of a row(s) effected).

            Delete

                        Get values from deleted .  ( select * from deleted) (copy of a row(s) effected).

 

 

During UPDATE

            On Before trigger – we can get row which is not effected by a update in deleted table.

                                                Basically we get rows from deleted table when we are maintaining log/history table.

 

            On After trigger – we can get row which is effected by a update in inserted table.

 

 

Note : there is no updated temporary table.

 

Friday, July 3, 2009

Service Unavailable


Service Unavailable

Then the first solution to the above error is http://support.microsoft.com/default.aspx?id=823552 but if this does not solve the problem try doing the following stuff.

Open the IIS Manager, right click Web Sites and select properties:

http://www.go4expert.com/images/PostImages/IISMan.jpg

Switch to the Service Tab

http://www.go4expert.com/images/PostImages/WebProp.jpg

Check "Run WWW Service in IIS 5.0 Isolation Mode".

You will be asked for Restart of IIS. Click yes to restart IIS. If you are not asked just restart IIS.




This message (including any attachments) contains confidential information intended for a specific individual and purpose and is protected by law. If you are not the intended recipient, you should delete this Message. Any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited.



Wednesday, July 1, 2009

Different Ways to Lock Windows XP


http://pubs.logicalexpressions.com/pub0009/images/dot_transp.gif

Different Ways to Lock Windows XP

http://pubs.logicalexpressions.com/pub0009/images/dot_transp.gif

There are several ways to lock your Windows XP computer, but all of them use the same command line. The method you choose is a matter of personal preference.

  1. via the keyboard
    The easiest way to lock Windows XP is by simply pressing the Windows logo key and the letter L (for Lock) on a Microsoft Natural Keyboard or any other compatible keyboard that includes the Window key. Doing so will pop up the Unlock Computer Password box.
  2. via a Shortcut.
    If you don't have a keyboard with a Window key or simply don't like the keyboard method, then here's how you can make a desktop shortcut to lock your computer.

    Right
    click an empty area of your desktop, choose New/Shortcut and enter this line as the command line:

    rundll32.exe user32.dll, LockWorkStation

    Click Next. Name the shortcut whatever you prefer and click Finish. That's it.

    If you'd like to change the icon, just right click the shortcut and go to Properties/Shortcut/Change Icon.
  3. via the command line
    The above command line can also be used at a DOS prompt to lock your computer. One simple way you can do it would be by clicking Start/Run, typing CMD and then entering the command and pressing Enter.
  4. via a bat file
    This is similar to a Windows shortcut method. But it's a DOS version. If you've never created a bat (batch) file, but would like to try this method, simply open a new text file (such as with Notepad) and type the following commands:

    @echo off
    rundll32.exe user32.dll, LockWorkStation
    cls


    Save the file with a .bat extension, such as Lock.bat, and you're done. Double click to make the file run.

Those are the basic methods to lock XP, but there are some other relating factors of which you should be aware.

Password
It should go without saying that if you don't use a password to log on to your computer, then anyone can access your computer and unlock it. If you want to use the lock feature, then set a password by going to User Accounts in the Control Panel and then click Create Password.

Fast User Switching
Fast User Switching allows multiple login sessions at the same time. Whether you have this feature enabled or disabled will make a big difference in how your locked computer can be accessed and on the behavior of your shortcuts when executed.

If enabled, executing any of the above locking methods will bring up the Welcome screen and other users will be able to log on to the computer, as is the norm for Fast User Switching. So, you really don't get much security at all this way, if your intention is to lock your machine. With Fast User Switching, only your profile is locked, not the ability for other users to log into your system. Any other user can just log on to your computer and use it.

If Fast User Switching is disabled, you will have to enter a password to unlock the computer. Double clicking your shortcut will bring up the Unlock Computer password dialog box. This is the same lock method that Windows NT and 2000 uses.

If you're not sure whether or not you have Fast User Switching enabled or disabled, go to User Accounts in the Control Panel and click the Change the way users log on or off tab. There you will see your status for Fast User Switching.

Welcome Screen
Whether the Welcome screen is enabled or disabled also has an effect on the way your computer can be locked.

If the Welcome screen is enabled, you can also lock your computer in Task Manager (Ctrl+Alt+Delete) by clicking the Lock Computer option in the Shutdown menu list. This option will only appear if the Welcome screen is enabled—without Fast User Switching being enabled.

Note! In order to use Fast User Switching, the Welcome screen must be enabled. You cannot select Fast User Switching if the Welcome screen option is unchecked.

If the Welcome screen is disabled, you can lock the computer by pressing Ctrl+Alt+Delete and then clicking the Lock Computer tab in the Windows Security dialog box that comes up.

Get Server and Machine Name in SQL

 

 

To Get Server name in Microsoft Sql .

select @@SERVERNAME

 

To Get Machine name in Microsoft Sql .

select host_name()

 

Code Formater

Paste Here Your Source Code
Source Code Formatting Options
1) Convert Tab into Space :
2) Need Line Code Numbering :
3) Remove blank lines :
4) Embeded styles / Stylesheet :
5) Code Block Width :
6) Code Block Height :
7) Alternative Background :
Copy Formatted Source Code
 
Preview Of Formatted Code