.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Interview Question >> Sql Server >> Post New Question Subscribe to Interview Questions

To find a particular column name where it exists in a database?

Posted By :Naresh     Posted Date :March 01, 2010    Points :10   Category :Sql Server 
The Query to find the particular column name in a databse is,

SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME = 'User_name'

You can also find related Interview Question to To find a particular column name where it exists in a database?  below: 

How to find total number of tables in a database?

  

SELECT COUNT(*) AS [table count]
FROM [sys].[tables]

We can get the total number of tables using this query. (More...)

How to find the path of datafiles for specified database?

  

Use the following query,

Select * from sysfiles
or
sp_helpdb 'database name' (More...)

How to find the last backup time and date for particular database

  
step1: open enterprise manager

step2: select the particular database -->properties-->Now we are able to see last full,transaction log backup time and date (More...)

how to find the table name in sql server database?

  
select * from INFORMATION_SCHEMA.tables where table_name like 'tblname%' (More...)

how to find column name from sql server table?

  
select * from INFORMATION_SCHEMA.Columns where column_name like 'colname%' (More...)

Database: State Can an Identity column be index?

  
No, Identity and GUID column do not need to be indexed. (More...)

Database: Define Identity Column?

  
Identity column is a column that automatically generates numeric values. Start and increment value are the two properties of prior importance that need to be set with respect to Identity column. Value of this column is mostly used to identify each row uniquely (More...)

Database Concurrency in Sql Server.

  
When two or more user try to update same type of data in a table then Database Concurrency helps in this situation.

There are 2 types of Database Concurrency

Pessimistic: When one user try to change the data with pessimistic concurrency then a lock is placed on the data in a table so that another user cannot change data. when one user finishes then other user can able to change.

Optimistic: When two user works on the same data in a table and one change that data first then second user cannot change that same data becasue the which he have using is allready changed so he cannot do the change becasue change apply to another data that is changed by first user. (More...)

What is a Database system?

  
The database and DBMS software together is called as Database system. (More...)

How to Rename a COLUMN Name

  
To rename a column ,in a query window execute sp_rename using the following formula:

sp_rename 'TableName.ColumnName', 'NewColumnName', 'COLUMN'


The sp_rename factor and the 'COLUMN' string are required.
The TableName factor is the name of the table that the column belongs to. The ColumnName is the current name of the column. The NewColumnName is the desired name you want to give to the column.

eg:
sp_rename 'Emp.Employeename','Ename','COLUMN'
(More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.


Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend