17.07.2015 Views

Download eBook (PDF) - Red Gate Software

Download eBook (PDF) - Red Gate Software

Download eBook (PDF) - Red Gate Software

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Appendix A – Views and Functions Reference• Expression: This is the value that is to be evaluated in this systemfunction. The data type can be any type that can be implicitlyconverted to varchar or nvarchar data types.• Search_Pattern: This is the value that is being sought within theexpression to be replaced.• Replace_Pattern: This is the value that will replace the search patternwhen found.--Returns "Thwas was a string"SELECT REPLACE('This is a string','is','was');GOListing A-30: Using the REPLACE function.REPLICATE and SPACEThe REPLICATE and SPACE system functions provide the functionality ofrepeating a value for a number of iterations. These system functions arevaluable during masking processes.The REPLICATE system function returns a given value for a given number ofiterations. The data type that is returned is the same as the data type passed intothe expression argument. The maximum iterations that will be returned are8,000.The arguments for the REPLICATE system function are:• Expression: This is the value that is to be evaluated in this systemfunction.• Iteration_Count: This is the number of iterations to which theexpression is to be repeated.The SPACE system function returns a space (" ") for a given number ofiterations. The data type that is returned is char. The maximum iterations thatwill be returned are 8,000. If the resulting value is to be concatenated tounicode values, the REPLICATE system function should be used instead of theSPACE system function.The arguments for the SPACE system function are:• Iteration_Count: This is the number of iterations to which a spaceis to be repeated.224

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!