0% found this document useful (0 votes)
33 views3 pages

SQL

s

Uploaded by

ninthseven
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views3 pages

SQL

s

Uploaded by

ninthseven
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

By configure service broker with the create service option -- configure service broker to handle messaging in the inventory

database By using a severity level of 16 -- Pass control to your CATCH block when an erro r is raised The statement displays each employee's manager -Rebuild the table's index decreasing the fill factor -- table wit one clustered index experiencing many page splits By creating a DDL trigger which utilizes ROLLBACK -- prevent queries and functi ons from resulting in tables being dropped one row per customer is inserted into the customerOrders table -on update cascade -- when creating the foreign key constraint Profiler trace files, Transact-Sql scripts and XML files -- Database Engine Tun ing Advisor can analyze which type of load By creating a Transact SQL statement utilizing the DELETE FROM salesRep -- to re move the records of sales table when two tables are related by a foreign key wit h Cascade delete option By making use of the Export Session Results function of the DTA -- save results from the DTA By making use of the SET SHOWPLAN_XML ON; statement -- to save the execution pla n in SQL Server Management studio By making use of the XACT_ABORT option -- to roll back changes if the transactio n that modifies a lot of existing data is unsuccessful RPC:Completed, SQL:BatchCOmpleted and SP:STmtCompleted -- to create a trace file for using the DETA to optimize indexes By making use of the SNAPSHOT transaction isolation level -- to reduce blocking whilst preventing dirty reads By making use of Change Data Capture tracking -- for a table to track all change s made to inventory database By making use of the SET SHOWPLAN_XML ON: statement -- to create the execution p lan using SQL server Management Studio By making use of the datetimeoffset data type -- alter the table to store a cust omers local time as well as specifying the difference between the customer's loc al and UTC time By using an INSTEAD OF INSERT trigger -- inserting data into the TotalSales tabl e By making use of the FAST 100 query hint -- returning first 25 rows quickly By making use of switch offset function -- to ensure that Recorded column stores data relative to the time offset By saving the graphical execution plan as a .sqlplan file -- save the execution plan in SQL server Management Studio

By making use of CREATEBROKER PRIORITY statement -- to ensure that messages sent by website are processed first By using Scalar-values functions -- to determine if a given year is a leap year columns are permanently deleted from the table -- ALTER TABLE name DROP COLUMN c ol1,col2 By implementing the code CREATE PROCEDURE GetSalesRep(@StaffID int) -- to create a stored procedure GetSalesRep using input data passed by a parameter named sta ffid By assigning the VIEW SERVER STATE permissions to the user -- to ensure the user is not granted too much permissions Make use of the Stoplist component -- to ignore certain words in search results By making use of the CREATE XML SCHEMA COLLECTION XML Valid statement -- a store d procedure inserts and updates XML data. An XML schema is created to ensure tha t XML data is valid. How to ensure that the XML schema is used By running the DENY DELETE ON tablename TO username transact sql stmt -- config ure to revoke USER'S SELECT permissions to a table without disrupting other perm issions to the database By making use of the database engine tuning advisor -- utility to run on a datab ase to optimize the indexing of the database for stored procedures Evaluate utilization of existing PDS only and Do not keep any existing PDS -- tw o tuning options By making use of the sys.column_xml_schema_collection_usages catalog view -- to check if any of the XML schemas are no longer required By making use of the ALTER DATABASE method and SWITCH method -- to archive a par tition of table 1 to table 2 RAISERROR('Invalid ID number', 10, 1); -- only to notify the user and do not nee d a permanent record of the event, use the statement By using the WITH CHECK((Purchases=0 AND Discount = 0) OR ( Purchase > 0 AND Dis count = 0.15)) constraint -- to have customers who have made purchases before gr anted 15% discount By making use of a Foreign key constraint -- to ensure changes listed in the Ite mSold table corresponds to records in the Stock table By making use of the Deadlock Graph event -- to capture information about the de adlocks to an XML file DELETE FROM ArchivedOrders OUTPUT DELETED OrderNum,DELETED OrderDate INTO @var WHERE OrderDate<@dte; Ones that use the WITH ENCRYPTION option -- which stored procedures can be modif ied to utilize the WITHCOMPILE option You should consider making use of the WITH SCHEMABINDING option -- to ensure tha

t your function does not cause the Stock table to be dropped By specifying the geography data type -- alter the Address column to enable user s to query the column based on geography location By making use of the SP_SEND_DBMAIL stoed procedure for sending e-mail without a MAPI client -- to implement stored proc that sends alerts by email a disk bottleneck -- high wait_time_ms value for the IO_COMPLETION wait type By creating a partition function with a partition scheme before creating the Wee kSales table -- create a WeekSales table that stores last week's data from the I temsSOld table By utilizing the query hint(MAXDOP 1) to ensure no other queries are impacted -to ensure that the query only uses a single processor core By making use of the sp_xml_removedocument stored procedure -- to clear XML hand les from memory after stored procedures insert data By making use of the SYSDATETIME system function with the DEFAULT option -- Stor e the current time with a precision of up to storing ten microseconds The UNSAFE permission set -- To configure a CLR assembly on a database that acce ss an external database. Assembly does not use managed [Link] permission set should you assign to the assembly On columns of the varchar(max) data type -- to collate numerous tables with simi lar data into a single table by using SPARSE option. Use an UPDATE statement that calls the modify method in the SET clause -- to upd ate the description value in PartDetail column for a partid with least amount of effort. REPEATABLE READ -- isolation level to configure the flight application to lock t he seats during a ticket reservation by customers By making use of the ROW_NUMBER option -- create a query utilizing ranking funct ions to display the sequential number of rows within a partition. By making use of the ALTER DATABASE inventory SET NEW_BROKER statement -- Databa se que does not resume messaging after restoring from a catastrophic failure On nvarchar(50) NULL or nvarchar(50) NOT NULL columns -- which columns unique co nstraints can be created create an inline table-valued function that includes the WITH SCHEMA BINDING cla use -- to ensure tables are not dropped or modified in a way that would cause us er's queries to fail By making use of the sys.sql_expression_dependencies catalog view -- to determin e which tables are referred by the stored procedures that do not use dynamic sql Create a plan guide that has the USE PLAN hint -- to improve the performance of a mission critical query when an app is migrated from sql 2005 to 2008. DENSE_RANK -- to produce a report that displays employees grouped by department

You might also like