|
| |
| |
| |
|
Statistics |
| Unique Visitors: 0 |
| Total Unique Visitors: 1514 |
| Visitors Out: 0 |
| Total Visitors Out: 0 |
|
|
|
| |
|
|
| |
|
|
| What is SQL server agent? |
| 2008-05-10 04:26:48 |
Server">SQL Server agent plays an important role in the day-to-day tasks of a database administrator (DBA). Itis often overlooked as one of the main tools for SQL Server management. Its purpose is to ease theimplementation of tasks for the DBA, with its full-function scheduling engine, which allows you toschedule your own jobs and scripts....
|
| |
|
| Can a stored procedure call itself or recursive stored procedure? How many level SP nesting |
| 2008-05-10 04:26:32 |
Can a stored procedure call itself or recursive stored procedure? How many level SP nestingpossible?Ans:Yes. Because Transact-SQL supports recursion, you can write stored procedures that call themselves.Recursion can be defined as a method of problem solving wherein the solution is arrived at byrepetitively applying it to subsets of the problem. A common application of recursive logic is to performnumeric computations that lend themselves to repetitive evaluation by the same processing steps.Stored procedures are nested when one stored procedure calls another or executes managed code byreferencing a CLR routine, type, or aggregate. You can nest stored procedures and managed codereferences up to 32 levels....
|
| |
|
| What is @@ERROR? |
| 2008-05-10 04:26:08 |
The @@ERROR automatic variable returns the error code of the last Transact-SQL statement. If therewas no error, @@ERROR returns zero. Because @@ERROR is reset after each Transact-SQL statement,it must be saved to a variable if it is needed to process it further after checking it....
|
| |
|
| What is Raiseerror? |
| 2008-05-10 04:25:47 |
Stored procedures report errors to client applications via the RAISERROR command. RAISERRORdoesn't change the flow of a procedure; it merely displays an error message, sets the @@ERRORautomatic variable, and optionally writes the message to the SQL Server error log and the NTapplication event log....
|
| |
|
| What is log shipping? |
| 2008-05-10 04:25:29 |
Log shipping is the process of automating the backup of database and transaction log files on aproduction SQL server, and then restoring them onto a standby server. Enterprise Editions onlysupports log shipping. In log shipping the transactional log file from one server is automatically updatedinto the backup database on the other server. If one server fails, the other server will have the same dbcan be used this as the Disaster Recovery plan. The key feature of log shipping is that is willautomatically backup transaction logs throughout the day and automatically restore them on thestandby server at defined interval....
|
| |
|
| What is the difference between a local and a global variable? |
| 2008-05-10 04:25:10 |
A local temporary table exists only for the duration of a connection or, if defined inside a compoundstatement, for the duration of the compound statement.A global temporary table remains in the database permanently, but the rows exist only within a givenconnection. When connection are closed, the data in the global temporary table disappears. However,the table definition remains with the database for access when database is opened next time....
|
| |
|
| What command do we use to rename a db? |
| 2008-05-10 04:24:50 |
sp_renamedb ‘oldname’ , ‘newname’If someone is using db it will not accept sp_renmaedb. In that case first bring db to single user usingsp_dboptions. Use sp_renamedb to rename database. Use sp_dboptions to bring database to multi usermode....
|
| |
|
| What is sp_configure commands and set commands? |
| 2008-05-10 04:24:32 |
Use sp_configure to display or change server-level settings. To change database-level settings, useALTER DATABASE. To change settings that affect only the current user session, use the SET statement....
|
| |
|
| What are the different types of replication? Explain. |
| 2008-05-10 04:24:06 |
The SQL Server 2000-supported replication types are as follows:· Transactional· Snapshot· MergeSnapshot replication distributes data exactly as it appears at a specific moment in time and does notmonitor for updates to the data. Snapshot replication is best used as a method for replicating data thatchanges infrequently or where the most up-to-date values (low latency) are not a requirement. Whensynchronization occurs, the entire snapshot is generated and sent to Subscribers.Transactional replication, an initial snapshot of data is applied at Subscribers, and then when datamodifications are made at the Publisher, the individual transactions are captured and propagated toSubscribers.Merge replication is the process of distributing data from Publisher to Subscribers, allowing thePublisher ...
|
| |
|
|
| What is the STUFF function and how does it differ from the REPLACE function? |
| 2008-05-10 04:22:15 |
STUFF function to overwrite existing characters. Using this syntax, STUFF(string_expression, start,length, replacement_characters), string_expression is the string that will have characters substituted,start is the starting position, length is the number of characters in the string that are substituted, andreplacement_characters are the new characters interjected into the string.REPLACE function to replace existing characters of all occurance. Using this syntaxREPLACE(string_expression, search_string, replacement_string), where every incidence ofsearch_string found in the string_expression will be replaced with replacement_string....
|
| |
|
|
| How to rebuild Master Database? |
| 2008-05-10 04:21:29 |
Shutdown Microsoft SQL Server 2000, and then run Rebuildm.exe. This is located in the ProgramFiles\Microsoft SQL Server\80\Tools\Binn directory.In the Rebuild Master dialog box, click Browse.In the Browse for Folder dialog box, select the \Data folder on the SQL Server 2000 compact disc or inthe shared network directory from which SQL Server 2000 was installed, and then click OK.Click Settings. In the Collation Settings dialog box, verify or change settings used for the masterdatabase and all other databases.Initially, the default collation settings are shown, but these may not match the collation selected duringsetup. You can select the same settings used during setup or select new collation settings. When done,click O...
|
| |
|
| What is the basic functions for master, msdb, model, tempdb databases? |
| 2008-05-10 04:20:57 |
The Master database holds information for all databases located on the SQL Server instance and is theglue that holds the engine together. Because SQL Server cannot start without a functioning masterdatabase, you must administer this database with care.The msdb database stores information regarding database backups, SQL Agent information, DTSpackages, SQL Server jobs, and some replication information such as for log shipping.The tempdb holds temporary objects such as global and local temporary tables and stored procedures.The model is essentially a template database used in the creation of any new user database created inthe instance....
|
| |
|
| What are primary keys and foreign keys? |
| 2008-05-10 04:20:35 |
Primary keys are the unique identifiers for each row. They must contain unique values and cannot benull. Due to their importance in relational databases, Primary keys are the most fundamental of all keysand constraints. A table can have only one Primary key.Foreign keys are both a method of ensuring data integrity and a manifestation of the relationshipbetween tables....
|
| |
|
| What is data integrity? Explain constraints? |
| 2008-05-10 04:20:04 |
Data integrity is an important feature in SQL Server. When used properly, it ensures that data isaccurate, correct, and valid. It also acts as a trap for otherwise undetectable bugs within applications.A PRIMARY KEY constraint is a unique identifier for a row within a database table. Every table shouldhave a primary key constraint to uniquely identify each row and only one primary key constraint can becreated for each table. The primary key constraints are used to enforce entity integrity.A UNIQUE constraint enforces the uniqueness of the values in a set of columns, so no duplicate valuesare entered. The unique key constraints are used to enforce entity integrity as the primary keyconstraints.A FOREIGN KEY constraint pr...
|
| |
|
|
| What is De-normalization? |
| 2008-04-18 06:08:34 |
De-normalization is the process of attempting to optimize the performance of a database by addingredundant data. It is sometimes necessary because current DBMSs implement the relational modelpoorly. A true relational DBMS would allow for a fully normalized database at the logical level, whileproviding physical storage of data that is tuned for high performance. De-normalization is a techniqueto move from higher to lower normal forms of database modeling in order to speed up database access....
|
| |
|
| How to get @@error and @@rowcount at the same time? |
| 2008-04-18 06:07:56 |
If @@Rowcount is checked after Error checking statement then it will have 0 as the value of@@Recordcount as it would have been reset.And if @@Recordcount is checked before the error-checking statement then @@Error would get reset.To get @@error and @@rowcount at the same time do both in same statement and store them in localvariable. SELECT @RC = @@ROWCOUNT, @ER = @@ERROR...
|
| |
|
| What is Identity? |
| 2008-04-18 06:07:39 |
Identity (or AutoNumber) is a column that automatically generates numeric values. A start andincrement value can be set, but most DBA leave these at 1. A GUID column also generates numbers,the value of this cannot be controled. Identity/GUID columns do not need to be indexed....
|
| |
|
| What is a Scheduled Jobs or What is a Scheduled Tasks? |
| 2008-04-18 06:07:26 |
Scheduled tasks let user automate processes that run on regular or predictable cycles. User canschedule administrative tasks, such as cube processing, to run during times of slow business activity.User can also determine the order in which tasks run by creating job steps within a SQL Server Agentjob. E.g. Back up database, Update Stats of Tables. Job steps give user control over flow of execution.If one job fails, user can configure SQL Server Agent to continue to run the remaining tasks or to stopexecution....
|
| |
|
| What is a table called, if it does not have neither Cluster nor Non-cluster Index? What is it |
| 2008-04-18 06:07:09 |
What is a table called, if it does not have neither Cluster nor Non-cluster Index? What is itused for?Ans:Unindexed table or Heap. Microsoft Press Books and Book On Line (BOL) refers it as Heap.A heap is a table that does not have a clustered index and, therefore, the pages are not linked bypointers. The IAM pages are the only structures that link the pages in a table together.Unindexed tables are good for fast storing of data. Many times it is better to drop all indexes from tableand than do bulk of inserts and to restore those indexes after that....
|
| |
|
| |
 |