Posts

Difference between Stuff and Replace

What is STUFF and Replace. Differece between them. Stuff :: The STUFF function inserts a string into another string. It deletes a specified length of characters in the first string at the start position and then inserts the second string into the first string at the start position. Syntax : STUFF (character_expression , start , length ,character_expression ) Usage in Real life Example : SELECT STUFF('abcdef', 2, 3, 'ijklmn'); GO Output :: ---------------------------------------------------------------------------------------- aijklmnef (1 row(s) affected) Command Highlights : Arguments --------------------------------------------------------------------------------

Automate the Generation of Stored Procedures for Your Database

Level of Difficulty 1 2 3 SUMMARY Design-time automation makes coding faster and ensures that all the procedures generated use the same naming conventions and structure. In an effort to improve their coding efficiency in a large SQL project, the authors wrote a set of design-time stored procedures that generate run-time stored procedures, and have used them in project after project ever since. Recently, the authors updated their procedures to make use of SQL Server 2000 features, including user-defined functions.

Sql Assistant

Removing Most Recently Used (MRU) Server Names from the Connection Dialog The Server name drop-down list box in the Connection dialog stores the 10 most recently used (MRU) server names (see Figure 4-25 ). The Connection dialog stores the server name after it has successfully connected to the server. Although this is a convenient feature, there are situations in which you may want to remove the dormant servers from this list or remove all the entries for security reasons. You may also want to copy the list to another workstation or share it with another user. Figure 4-25 Making a DAC connection from Management Studio. The server name MRU list is distinct for each user on a computer. The list is stored in a file named mru.dat under the Application Data directory for each user: C:\Documents and Settings\ \Application DataMicrosoft\Microsoft SQL Server\90\Tools\Shell\mru.dat Importing Registered Servers from Enterprise Manager SQL Server 2005 provides the functionality to keep your SQL