You can get the data types of columns in a given table daynamically using system tables as given below: Assume 'CurrentStatus' is the table name.
The column name and the data type will be diplayed as result.
Wednesday, February 15, 2012
Tuesday, February 14, 2012
How to find a particular text in the database?
Ex: If you want to find all the places where a particular function is used,
More info on sys_comments
More info on sys_comments
Monday, February 13, 2012
JOIN vs IN vs EXISTS in sql
Difference between IN and EXISTS
- IN will ignore null values where as EXISTS will considers null values as the result.
- JOIN also, will consider null values.
- IN does not consider duplicate values where as JOIN consider duplicates. (To avoid duplicate values, use DISTINCT)
- EXISTS also does not consider duplicate values.
Wednesday, February 8, 2012
Why/ Why not use "WITH RECOMPILE" option?
Once the sproc does not have any syntax errors, it will create entries in sysobjects, sysdepends and syscomments tables. But, it will not compile the query until you execute that.
At the time you execute the proc, SQL Server will create an execution plan and save that in procedure cache for future use.
When the proc executes again, it will re-use the same execution plan, unless otherwise statistics are being changed.
So, if you want to use a new execution plan for each individual execution, use WITH RECOMPILE option in your proc.
Why?
- Optimal use of indexes on columns in a case by case scenario
Why not?
- Improves performance
At the time you execute the proc, SQL Server will create an execution plan and save that in procedure cache for future use.
When the proc executes again, it will re-use the same execution plan, unless otherwise statistics are being changed.
So, if you want to use a new execution plan for each individual execution, use WITH RECOMPILE option in your proc.
Why?
- Optimal use of indexes on columns in a case by case scenario
Why not?
- Improves performance
Add an alias to connect database server using SSMS in MSSQL
- All Programs > SQL Server Configuration Manager
- Expand SQL Native Client 10.0 Configuration
- Aliases
- New Alias
Wednesday, February 1, 2012
Linux Kernal Headers
Linux kernal headers provide APIs to interact between modules in kernal level as well as modules between user space and kernal space.
If you want to do any kernal level operations in Linux, you need to use above APIs with C language.
It is located at /usr/src/linux-headers-x.x. See below:
If you want to do any kernal level operations in Linux, you need to use above APIs with C language.
It is located at /usr/src/linux-headers-x.x. See below:
How to fix "The program 'gcc' can be found in following packages' issue
GCC is the compiler environment for Linux. Once you type "gcc" in cmd, you will get the following error if gcc is not installed.
To fix this issue, run following command:
sudo apt-get install build-essential
To fix this issue, run following command:
sudo apt-get install build-essential
How to get system information in Linux?
Subscribe to:
Posts (Atom)