Skip to main content

Posts

What is the difference between smalldatetime and datetime?

DateTime SmallDateTime Storage Size 8 Bytes 4 Bytes FORMAT YYYY-MM-DD hh:mm:ss.nnn YYYY-MM-DD hh:mm:ss MIN Value 1753-01-01 00:00:00 1900-01-01 00:00:00 MAX Value 9999-12-31 23:59:59.997 2079-06-06 23:59:00 Accuracy Rounded to increments of .000, .003, or .007 second It means: If time part in the date is 23:59:58.990 or 23:59:58.991, it will be stored as 23:59:58.990. 1 Minute Second’s values that are 29.998 seconds or less are rounded down to the nearest minute. And second’s values of 29.999 seconds or more are rounded up to the nearest minute. So seconds part value is always 00.

Steps to Create twitter application

Steps to Create twitter application: To use Twitter counter widget and other Twitter related widgets, you need OAuth access keys. To get Twitter Access keys, you need to create Twitter Application which is mandatory to access Twitter. Go to https://dev.twitter.com/apps/new and log in, if necessary Enter your Application Name, Description and your website address. You can leave the callback URL empty. Accept the TOS, and solve the CAPTCHA. Submit the form by clicking the Create your Twitter Application Copy the consumer key (API key) and consumer secret from the screen into your application

SQL Server, Connection String creation

Whenever we need to create a connection string for a new database or in the same database then we need to follow simple few steps listed below: Create the login in the master database using the query given in the above mentioned reference file name or see as given CREATE LOGIN [XYZ] WITH PASSWORD=N'XYZ', DEFAULT_DATABASE=[Master], DEFAULT_LANGUAGE=[us_english], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF GO NOTE- if you are using the sql server GUI to create a new login then please make sure to un check the enforce password policy otherwise there would be problem with the connection string in the near future Create the User in the concerned Database and attach the user with the particular login any failure in doing so will result an error while using the connection string. Set the default schema name with it too (default schema name is useful as all the procedures under that default schema can be accessed by the application using the procedure name only if any other schema proc...

A href open in new tab, same frame, parent frame and reuse the existing One

Open the linked document in a new window or tab: <a href = "xyz.html" target = "_blank" > Link </a> Open the linked document in the same frame as it was clicked (this is default): <a href = "xyz.html" target = "_self" > Link </a> Open the linked document in the parent frame: <a href = "xyz.html" target = "_parent" > Link </a> Open the linked document in the full body of the window: <a href = "xyz.html" target = "_top" > Link </a> Open the linked document in new tab and Reuse the existing one if already open: <a href = "xyz.html" target = "framename" > Link </a>

Install WordPress on local machine

To use WordPress you must have a server (WAMP, XAMP) installed on your machine for its working environment. Without a server you won’t be able to install WordPress. Download/Install WAMP Server: WordPress needs a web server (which could be anyone, for e.g. I have used WAMP software for installing WordPress) to work on so first you need to download and install a software called WAMP (which has prebuilt localhost server) on your machine. Activating WAMP Server: Remember, every time you turn on your machine, first you will need to activate WAMP server simply by double clicking on its icon. Download WordPress Zip: Open your browser. Go to www.wordpress.org/download/ and easily download the latest version of WordPress. Deploy the code at Wamp Directory: Open your directory where you have installed WAMP server & copy the zip folder of WordPress here and do right click on it and select “extract here”. Now make a copy of the folder and rename it, here for e.g., it is rename...

Create a copy of database and renaming it using mdf & ldf files

If You want to use the same directory for your mdf\ldf files You will have to (physically) rename them. 1. Detach files from local PC 2. Rename mdf and ldf files 3. Copy\Move the files to the server directory where the original Database is stored. (In My example I used D:\Data for mdf and E:\Logs for ldf, change the path before running the script) 4. Use this code: USE [ master ] GO CREATE DATABASE [ myNewSite_db ] ON ( FILENAME = N 'D:\Data\myNewSite_db.mdf' ), ( FILENAME = N 'E:\Logs\myNewSite_db_log.ldf' ) FOR ATTACH GO