You are responsible for managing a SQL Server 2005 database that stores sales information. Many values in nchar columns in the database tables contain preceding or trailing spaces. You need to implement a mechanism that selects the data from the tables without leading and trailing spaces. Your solution must be available for reuse in Transact-SQL statements and views. What should you do?()A、Create DML triggers that query the inserted and deleted tables.B、Create a stored procedure that calls the LTRIM and RTRIM built-in functions.C、Create a Transact-SQL function that calls the LTRIM and RTRIM built-in functions.D、Call the TRIM built-in function.

You are responsible for managing a SQL Server 2005 database that stores sales information. Many values in nchar columns in the database tables contain preceding or trailing spaces. You need to implement a mechanism that selects the data from the tables without leading and trailing spaces. Your solution must be available for reuse in Transact-SQL statements and views. What should you do?()

  • A、Create DML triggers that query the inserted and deleted tables.
  • B、Create a stored procedure that calls the LTRIM and RTRIM built-in functions.
  • C、Create a Transact-SQL function that calls the LTRIM and RTRIM built-in functions.
  • D、Call the TRIM built-in function.

相关考题:

You are the database administrator for a retail company. The company owns 270 stores. Every month, each store submits approximately 2,000 sales records, which are loaded into a SQL Server 2000 database at the corporate headquarters.A Data Transformation Services (DTS) package transforms the sales records, as they are loaded. The package writes the transformed sales records to the Sales table, which has a column for integer primary key values. The IDENTITY property automatically assigns a key value to each transformed sales record.After loading this month's sales data, you discover that a portion of the data contains errors. You stop loading data, identify the problem records, and delete those records from the database.You want to reuse the key values that were assigned to the records that you deleted. You want to assign the deleted key values to the next sales records you load. You also want to disrupt users' work as little as possible.What should you do?A.Export all records from the Sales table to a temporary table. Truncate the Sales table, and then reload the records from the temporary table.B.Export all records from the Sales table to a text file. Drop the Sales table, and then reload the records from the text file.C.Use the DBCC CHECKIDENT statement to reseed the Sales table's IDENTITY property.D.Set the Sales table's IDENTITY_INSERT property to ON. Add new sales records that have the desired key values.

You are the administrator of a SQL Server 2000 computer in your company's personnel department. Employee data is stored in a SQL Server 2000 database. A portion of the database schema is shown in the exhibit.You want to create a text file that lists these data columns in the following format title, FirstName, LastName, WorkPhone, PositionName, DepartmentName.You want to create the text file as quickly as possible. You do not expect to re-create this file, and you want to avoid creating new database objects if possible.What should you do?A.Use the bcp utility to export data from each table to a separate text file. Use format files to select the appropriate columns. Merge the data from each text file into a single text file.B.Create a view that joins data from all three tables include only the columns you want to appear in the text file. Use the bcp utility to export data from the view.C.Create a SELECT query that joins the data from the appropriate columns in the three tables. Add an INTO clause to the query to create a local temporary table. Use the bcp utility to export data from the local temporary table to a text file.D.Create a SELECT query that joins the data from the appropriate columns in the three tables. Add an INTO clause to the query to create a global temporary table. Use the bcp utility to export data from the global temporary table to a text file.

You are the administrator of a SQL Server 2000 computer. The server contains a database that stores financial data. You want to use Data Transformation Services packages to import numeric data from other SQL server computers. The precision and scale values of this data are not defined consistently on the other servers.You want to prevent any loss of data during the import operations. What should you do?A.Use the ALTER COLUMN clause of the ALTER TABLE statement to change data types in the source tables. Change the data types so that they will use the lowest precision and scale values of the data that will be transferred.B.Use the ALTER COLUMN clause of the ALTER TABLE statement to change data types in the destination tables. Change the data types to reflect the highest precision and scale values involved in data transfer.C.Set a flag on each DTS transformation to require an exact match between source and destination columns.D.Set the maximum error count for each DTS transformation task equal to the number of rows of data you are importing. Use an exception file to store any rows of data that generate errors.E.Write Microsoft ActiveX script. for each DTS transformation. Use the script. to recast data types to the destinations precision and scale values.

You are the administrator of a SQL Server 2000 computer. Your company purchased an accounting application from a vendor. The application stores its data in a database named Accounting on the server. The tables in this database contain columns that function as primary keys, but PRIMARY KEY and FOREIGN KEY constraints are not used.You need to replicate data from this database to another SQL Server computer. This server will use the replicated data to generate reports. Most reports will run each month, but the accounting department needs to have the ability to run reports at any time. Reports should be accurate through the last full working day.You cannot make any changes to the database, but you need to implement replication. Which two actions should you take? (Each correct answer presents part of the solution. Choose two)A.Implement merge replication.B.Implement snapshot replication.C.Implement transactional replication.D.Schedule replication to run continuously.E.Schedule replication to run during off-peak hours.

You are the administrator of a database that contains 64 lookup tables. These tables store static data that should not change. However, users report that some of this data is being changed. You need to prevent users from modifying the data.You want to minimize changes to your security model and to your database applications. How should you modify the database?A.Create a filegroup named LOOKUP. Move the lookup tables to this filegroup. Select the read only check box for the filegroup.B.Create a database role named datamodifier. Grant SELECT permissions to the datamodifier role. Add all users to the role.C.Deny INSERT, UPDATE, and DELETE permissions for all users. Create stored procedures that modify data in all tables except lookup tables. Require users to modify data through these stored procedures.D.Create a view of the lookup tables. Use the view to allow users access to the lookup tables.

A data file became corrupted in your database due to bad sectors on the disk. Because of corruption, you lost all the important tables in that data file. Which method would you use for recovery?()A、flash back all the tables in the data file, one by oneB、restore the data file to a new location and perform a media recoveryC、flash back the database; there is no need to restore the data fileD、restore the data file from the most recent backup and flash back the database

You work in Dublin at the main office of TestKing.com. You are responsible for managing a SQL Server 2005 database. The sales department wants a report that compares customer activity in the previous quarter between the main office in Dublin and the branch office in Buenos Aires. They want the data sorted by surname and first name.You restore a recent backup of the Buenos Aires database onto your server. You write queries to build the report, ordering the data by the Surname and FirstName columns. You review the data and notice that the customer list from the Buenos Aires database is sorted differently. The sales department needs the revised data within 15 minutes for a presentation.  You need to implement the fastest possible solution that ensures that the data from both databases is sorted identically. What should you do?()A、Use the Copy Database Wizard to copy the data in the Buenos Aires database to a new database with the same collation as the Dublin database.B、Use the SQL Server Import and Export Wizard to copy the data from the Buenos Airesdatabase into new tables, specifying the same collation as the Dublin database.C、Modify the format file to specify the same collation as the Dublin database. Import the table again.D、Modify the query on the Buenos Aires database to use the COLLATE setting in the ORDER BY clause. In the query, specify the same collation as the Dublin database.

You need to migrate the DeliveryVans, AirlinePreferences, and SeasonalContractors databases into the data center. What should you do?()A、Install a separate instance of SQL Server 2005 for each of the databases on a single server.B、Create a SQL Server database for each of the databases in a single instance of SQL Server 2005.C、Import the data from each of the databases into a single database in an instance of SQL Server 2005.D、Install a default instance of SQL Server 2005 on three separate servers. Use one server for each of the databases.

You need to ensure that the stored procedure that inserts new loan requests can access data in tables that are stored in another database on the same SQL Server instance. Which two actions should you perform?()A、Ensure that the stored procedure and the tables are owned by users that are associated with the same SQL Server login.B、Ensure that the stored procedure and the tables are owned by the same database user.C、Ensure that the stored procedure and the tables use the same database schema.D、Configure the multiuser database option on both databases.E、Configure the cross-database ownership chaining option on both databases.

You are responsible for maintaining a SQL Server 2005 database. Business analysts in the company routinely use a view named v CustomerSales to join the Customers and Sales tables in the database. They use the view to aggregate total sales by customer by month. You need to increase the performance of the view. What should you do?()A、Update the view to use an outer join between the Customers and Sales tables.B、Create a clustered index on the v CustomerSales view.C、Create two separate views that do not contain any joinsone view named Customers for the Customers table and another one named v Sales for the Sales table.D、Create a stored procedure for the business analysts that uses the v CustomerSales view.

In your production database, data manipulation language (DML) operations are executed on the SALES table.You have noticed some dubious values in the SALES table during the last few days. You are able to track users, actions taken, and the time of the action for this particular period but the changes in data are not tracked.You decide to keep track of both the old data and new data in the table along with the user information.  Whataction would you take to achieve this task()A、Apply fine-grained auditing.B、Implement value-based auditing.C、Impose standard database auditing to audit object privileges.D、Impose standard database auditing to audit SQL statements.

A data file become corrupted in your database due to bad sectors on the disk. Because of corruption, you lost all the important tables in that data file. Which method would you use for recovery?()A、 Flash back all the tables in the data file, one by one.B、 Restore the data file to a new location and perform a media recovery.C、 Flash back the database, there is no need to restore the data file.D、 Restore the data file from the most recent backup and flash the database.

You are a database administrator for your company. The company uses a vendor company’s application that is based on a proprietary database. You query data from the application database and import the data into a SQL Server 2005 database. The application vendor provides you with a new OLE DB driver to be used when querying the application database. Company policy prohibits connections between the SQL Server database and the application database, except when querying this data. You need to provide a way to query data from the application database. What should you?()A、Configure a Linked Server connection to the application database.B、Write a query that uses an OPENDATASOURCE command.C、Write a query that uses an OPENQUERY command.D、Configure a Remote Server connection to the application database.

You are a database administrator for your company. You are responsible for a SQL Server 2005 database that has several indexes. You need to write a stored procedure that checks the indexes for fragmentation. Which Transact-SQL statement should you use?()A、DBCC DBREINDEXB、SELECT * FROM sys.dm_db_index_physical_statsC、DBCC INDEXDEFRAGD、SELECT * FROM sys.indexes

You are designing a strategy for synchronizing a SQL Azure database and multiple remote Microsoft SQL Server 2008 databases.  The SQL Azure database contains many tables that have circular foreign key relationships.  You need to recommend an approach for ensuring that all changes in the remote databases synchronize with the SQL Azure database.  What should you recommend?()A、 Use SQLAzure Data Sync Service.B、 Use SQL Server replication.C、 Use SQL Server backup and restore.D、 Use SQL Server database snapshots.

You design a Business Intelligence (BI) solution by using SQL Server 2008. The solution includes a SQL Server 2008 Analysis Services (SSAS) database. The database contains a data mining structure that uses a SQL Server 2008 table as a data source. A table named OrderDetails contains detailed information on product sales. The OrderDetails table includes a column named Markup. You build a data mining model by using the Microsoft Decision Trees algorithm. You classify Markup as discretized content.  The algorithm produces a large number of branches for Markup and results in low confidence ratings on predictable columns. You need to verify whether the Markup values include inaccurate data. What should you do? ()A、 Modify the content type of Markup as Continuous.B、 Create a data mining dimension in the SSAS database from OrderDetails.C、 Create a data profile by using SQL Server 2008 Integration Services (SSIS).D、 Create a cube in SSAS. Use OrderDetails as a measure group. Recreate the data mining structure and mining model from the cube data.

You are a professional level SQL Server 2005 database administrator in an international corporation named Wiikigo. You are experienced in implementing high-availability solutions, monitoring the database server, and design deployment. In the company, you major job is the deployment, maintenance and support of Microsoft SQL Server 2005. You work as a database administrator for your company. You utilize the SP:Recompile event class to run SQL Server Profiler. You find that a great amount of recompiles occurring. The possible causes of the large number of recompiles should be identified.  From the flowing four options, which one is the most possible cause of the problem?()A、The sp_executesql batches are not being recovered from the procedure cache.B、A database administrator executed UPDATE STATISTICS statements on all tables, and the most common stored procedures reference all the tables.C、One new stored procedure is created by a database administrator.D、Ad hoc batches are not being recovered from the procedure cache.

You are creating a view to join the Customers and Orders tables in a SQL Server 2005 database. You need to ensure that the view cannot be affected by modifications to underlying table schemas. You want to accomplish this goal by using the least possible amount of overhead. What should you do?()A、Create CHECK constraints on the tables. B、Create a DDL trigger to roll back any changes to the tables if the changes affect the columns in the view. C、Create the view, specifying the WITH SCHEMABINDING option. D、Create the view, specifying the WITH CHECK option.

You are responsible for importing data into SQL Server 2005 databases.Your department is starting to receive text files that contain sales transactions from stores across the country. Columns in the data are separated by semicolons.You need to import the files into the sales database. What should you do?()A、Create a custom format file, specifying a semicolon as the row terminator.B、Use the bcp command, specifying a semicolon as the field terminator.C、Use the bcp command with the default arguments.D、Use the BULK INSERT statement with the default arguments.

You are planning the migration of a Microsoft SQL Server 2008 database to SQL Azure.   You need to recommend an approach for ensuring that database connectivity does not degrade.   Which two actions should you recommend?()A、 Implement transactions for database queries.B、 Close database connections in the application.C、 Use Microsoft ADO.NET in the data access layer.D、 Implement a retry policy in the data access layer.

You are a professional level SQL Server 2005 database administrator in an international corporation named Wiikigo. You are experienced in implementing high-availability solutions, monitoring the database server, and design deployment. In the company, you major job is the deployment, maintenance and support of Microsoft SQL Server 2005. You work as the administrator of a SQL Server 2005 computer, and the computer is called SQL1. There are two databases on the SQL1, and the two databases are respectively named Production and DW. A new database named Staging is created. When the data are moving from the Production database into the DW database, the Staging database is utilized temporarily to store and manipulate data. Since you are the database administrator, you are required to make sure the points listed below. First, the tables should not be removed from the Staging database. Second, any attempts to have tables migrated should be logged. Third, your solution should not impact on other databases.  Which action should be performed to achieve the goal?()A、To achieve the goal, a DML trigger on each table should be created to prevent deletion of data.B、To achieve the goal, a DDL trigger should be created, and that the ON DATABASE parameter is utilized by DDL trigger for the Staging database.C、To achieve the goal, an event notification should be created to fire when the TRUNCATE TABLE Transact-SQL statement is submitted to the Staging database.D、To achieve the goal, a DDL trigger should be created, and the ON ALL SERVER parameter is utilized by the DDL trigger.

A Windows Azure application retrieves data from SQL Azure.   You need to recommend an approach for improving application query performance.  What should you recommend?()A、 Create a database view to retrieve the data.B、 Use a clustered index on the SQL Azure database tables.C、 Open a new database connection when an operation times out.D、 Create SQL Azure database table indexes basedon application queries

Your SQL Server 2005 database contains a table that has 500 million rows of data. Some of the data is historical and some is current. You need to partition the data on a single server to increase performance and optimize maintenance. What should you do?()A、Implement horizontal partitioning.B、Implement vertical partitioning.C、Implement a raw partition.D、Implement distributed partitioning.

单选题You are designing a strategy for synchronizing a SQL Azure database and multiple remote Microsoft SQL Server 2008 databases.  The SQL Azure database contains many tables that have circular foreign key relationships.  You need to recommend an approach for ensuring that all changes in the remote databases synchronize with the SQL Azure database.  What should you recommend?()A Use SQLAzure Data Sync Service.B Use SQL Server replication.C Use SQL Server backup and restore.D Use SQL Server database snapshots.

单选题A Windows Azure application retrieves data from SQL Azure.   You need to recommend an approach for improving application query performance.  What should you recommend?()A Create a database view to retrieve the data.B Use a clustered index on the SQL Azure database tables.C Open a new database connection when an operation times out.D Create SQL Azure database table indexes basedon application queries

单选题You design a Business Intelligence (BI) solution by using SQL Server 2008. The solution includes a SQL Server 2008 Analysis Services (SSAS) database. The database contains a data mining structure that uses a SQL Server 2008 table as a data source. A table named OrderDetails contains detailed information on product sales. The OrderDetails table includes a column named Markup. You build a data mining model by using the Microsoft Decision Trees algorithm. You classify Markup as discretized content.  The algorithm produces a large number of branches for Markup and results in low confidence ratings on predictable columns. You need to verify whether the Markup values include inaccurate data. What should you do? ()A Modify the content type of Markup as Continuous.B Create a data mining dimension in the SSAS database from OrderDetails.C Create a data profile by using SQL Server 2008 Integration Services (SSIS).D Create a cube in SSAS. Use OrderDetails as a measure group. Recreate the data mining structure and mining model from the cube data.

单选题You are a professional level SQL Server 2005 database administrator in an international corporation named Wiikigo. You are experienced in implementing high-availability solutions, monitoring the database server, and design deployment. In the company, you major job is the deployment, maintenance and support of Microsoft SQL Server 2005. You work as a database administrator for your company. You utilize the SP:Recompile event class to run SQL Server Profiler. You find that a great amount of recompiles occurring. The possible causes of the large number of recompiles should be identified.  From the flowing four options, which one is the most possible cause of the problem?()AThe sp_executesql batches are not being recovered from the procedure cache.BA database administrator executed UPDATE STATISTICS statements on all tables, and the most common stored procedures reference all the tables.COne new stored procedure is created by a database administrator.DAd hoc batches are not being recovered from the procedure cache.