"Sybase::BCP" is based on "Sybase::CTlib" whereas "Sybase::BLK" on "Sybase::DBlib" though both serves as a simplified front end for Sybase's Bulk Copy library.
This blog provides some ready-made tips, tricks, tweaks & interview questions-answers on C, C++, Perl, Shell Scripting and UNIX Commands.
Wednesday, August 1, 2012
What is the maximum number of Index per table in MS SQL Server?
For SQL Server 2005:
1 Clustered Index + 249 Nonclustered Index = 250 Index
For SQL Server 2008:
1 Clustered Index + 999 Nonclustered Index = 1000 Index
1 Clustered Index + 249 Nonclustered Index = 250 Index
For SQL Server 2008:
1 Clustered Index + 999 Nonclustered Index = 1000 Index
What is the generic or full syntax of SELECT statement?
SELECT select_list
[ INTO new_table ]
FROM table_source
[ WHERE search_condition ]
[ GROUP BY group_by_expression ]
[ HAVING search_condition ]
[ ORDER BY order_expression [ ASC | DESC ] ]
[ INTO new_table ]
FROM table_source
[ WHERE search_condition ]
[ GROUP BY group_by_expression ]
[ HAVING search_condition ]
[ ORDER BY order_expression [ ASC | DESC ] ]
What is the difference between Clustered and Non-Clustered Index?
Clustered Index
- describes the order wherein the records are physically stored
- only one per table
- faster to read as data is physically stored in index order
- to enhance insert & update, clustered indexes should be set on a field that is normally incremental i.e. Id or Timestamp
Non Clustered Index
- defines a logical order that does not match the physical order on disk
- can be used many times per table
- quicker for insert and update operations than a clustered index
- describes the order wherein the records are physically stored
- only one per table
- faster to read as data is physically stored in index order
- to enhance insert & update, clustered indexes should be set on a field that is normally incremental i.e. Id or Timestamp
Non Clustered Index
- defines a logical order that does not match the physical order on disk
- can be used many times per table
- quicker for insert and update operations than a clustered index
Can we have a Virtual Constructor?
A constructor assigns value to variables at compile time and the virtual table is created on the fly.
So it is impossible to a have a virtual constructor since the time a constructor is invoked the vtable won't be available in memory;
So it is impossible to a have a virtual constructor since the time a constructor is invoked the vtable won't be available in memory;
When does a Copy Constructor get invoked?
The following cases give rise to call a copy constructor:
1. When an object is returned by value
2. When an object is passed (to a function) by value as an argument
3. When an object is thrown
4 .When an object is caught
5 .When an object is placed in a brace-enclosed initializer list
1. When an object is returned by value
2. When an object is passed (to a function) by value as an argument
3. When an object is thrown
4 .When an object is caught
5 .When an object is placed in a brace-enclosed initializer list
How do you debug specific block of code in shell scripting?
You can mention the block of code within "set -x" and "set +x" command. For example :
#!/usr/bin/sh
echo "Welcome"
set -x
echo "Rabindra!"
echo "Nayak"
set +x
echo " to the world!"
#!/usr/bin/sh
echo "Welcome"
set -x
echo "Rabindra!"
echo "Nayak"
set +x
echo " to the world!"
What and why are the operators that can't be overloaded?
We can't overload the 'sizeof', ':?', '::', '.' and '.*' operators in C++ since they take name as their argument whereas all other operators take value as argument.
Tuesday, July 31, 2012
How do you flip bits on and off?
Use xor to flip between 1 and 0.
x = x ^ 1; // or x ^= 1;This will change x alternately between 0 and 1.
How do you divide a number by 2 without division?
Just right shift the number by 1.
main()
{
int x=6;
printf("%d\n", y>>1); /* Divide by 2 */
printf("%d\n", y>>2); /* Divide by 4 */
}
Output:
3
1
main()
{
int x=6;
printf("%d\n", y>>1); /* Divide by 2 */
printf("%d\n", y>>2); /* Divide by 4 */
}
Output:
3
1
Subscribe to:
Posts
(
Atom
)