Dynamically set src to iframe using javascript

Hi people, there are particular cases when you set the src of iframe dynamically using javascript. You might have tried using


document.getElementById('myiframe').src = "http://www.mysite.com";


Above code might throw the following javascript error


Differences between stored procedures and functions in sql server

We come across this question many times in interviews, people ask when to use functions and when to use stored procedures. The basic differences between stored procedures and functions are


Stored Procedures Functions
Can return more than one table data at a time. Can return either a scalar value or data from only a single table.
Transactions can be used. Transactions cannot be used.
Cannot be used with select statement. We have to use EXEC or EXECUTE to run them. Can be used within select statements.
Can have input and output parameters. Can have only input parameters.
Cannot be joined in a select statement. Can be joined in a select statement.
Can be used to change server configurations. Cannot be used to change server configurations.
May or may not return values. Has to return a value.
Temporary table can be created. Temporary tables cannot be created.
Exception handling can be done using TRY CATCH blocks. TRY CATCH block cannot be used with inside the functions. But we can use the raiseerror.
Dynamic sql can be executed using sp_executesql. Dynamic sql cannot be executed.


There will be few more difference between stored procedures and functions. Any ways thanks for reading.

Setting default value for date time in sql server 2005

Lets us suppose you have a table with some columns which includes a date column. Now you want to put a default date and time value for that field. That means we don't need to insert value into that field, SQL Server should automatically insert the date and time then follow the steps below.


Steps :

Failed to access IIS metabase problem


Possible Cause
If you are getting the following error while running your applications





This happens only when you install IIS AFTER .NET 2.0 framework, the rights of the ASPNET user had not been set correctly.

Solution

Creating authentications in sql server 2005

In order to create authentications in sql server 2005, follow the steps mentioned below

Steps:
1. Open "Microsoft Sql Server Management Studio Express Edition".
2. In "Connection to Server" window, select "Authentication" as "Windows Authentication" and click on "Connect" as shown below.



3. In order to create authentications, first enable "SQL Authentication / Server Authentication".

Enabling SQL Authentication / Server Authentication in SQL Server 2005

Follow the steps mentioned below

1. Open "SQL Server 2005" as shown below.




2. In order to enable "Server authentication" go to "View" menu, select "Object Explorer".

Restarting SQL Server

Follow the steps below to restart SQL Server without restarting your computer

1. Go to "Start -> All Programs -> Microsoft SQL Server 2005 -> Configuration Tools -> SQL Server Surface Area Configuration and the following screen is displayed.





2. In "SQL Server 2005 Surface Area Configuration" window, select "Surface Area Configuration for Services and Connections" and the following screen is displayed.