Skip to main content

Posts

Showing posts from August, 2011

Google translator for entire site,Translate An Entire Website

Add Google's website translator to your webpages, and offer instant access to automatic translation of the pages. Adding the website translator is quick and easy <head>    <script language="Javascript" src="eit.js"></script> </head> add this line between <head> tag. <a href='javascript:translator("en|ja")' target=""> <img src="country/ja.jpg" width=30 border=0 height=20 title="View in Japanese"></a>&nbsp;&nbsp;&nbsp; <a href='javascript:translator("en|de")' target=""><img src="country/de.jpg" width=30 border=0 height=20 title="View in German"></a>&nbsp;&nbsp;&nbsp; <a href='javascript:translator("en|fr")' target=""><img src="country/fr.jpg" width=30 border=0 height=20 title="View in French"></a>&nb

SQL SERVER : How to Get All Tables from Each Sql Database on Data Server

Using sys.objects master table we can get the names of tables,views,stored procedures and all other objects in sql server database. Here is the query. select name from sys.objects where type='U' order by name It will displays list of tables in the one Database.  Also you can use built in functionality that SQL Server provides and use one line of code to get all tables in all databases on database server. sp_msforeachdb "SELECT '?' DatabaseName, Name FROM ?.sys.Tables or use this query to find tables similar to the given name. sp_msforeachdb "SELECT '?' DatabaseName, Name FROM ?.sys.Tables WHERE Name LIKE '%agent%'" this query will return all tables those names contains "agent"  with their Database name.  this query will returned result set , contain all dependencies, like which other tables, views, stored procedure depend on this table Exec sp_depends 'table_name'

SQL SERVER : How to get Trigger's Name on Tables

1. You can use query to get the list of triggers in the database. select name from sys.Triggers 2. You can use this query to get the table on which the given trigger has been written. sp_depends "triggername" 3. You can  use this query to get list of triggers and associated tables: select name, object_name(parent_id) from sys.triggers select name,OBJECT_NAME(parent_obj) from sysobjects where xtype = 'TR'

C#.Net : Create a Class

This is how we can define a Class in C#.Net Here we code to create a class named Student has three member variables,one constructor and properties such as Name,Age. Public Class Student     {         private string name;         private string id;         private int age;         public Student( string name, string id, int age)         {             this.name = name;             this.id = id;             this.age = age;         }         public string Name         {             get { return name; }         }             public string Id         {             get { return id; }         }         public int Age         {             get { return age; }         }     }