<?xml version="1.0" encoding="UTF-8" standalone="no"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:gd="http://schemas.google.com/g/2005" xmlns:georss="http://www.georss.org/georss" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-1799474711497514132</atom:id><lastBuildDate>Mon, 16 Sep 2024 19:20:50 +0000</lastBuildDate><category>mysql</category><category>SQL</category><category>database</category><category>Microsoft SQL Server</category><category>Sql Server</category><category>Data Manipulation Language</category><category>Logical Operators</category><category>Stored Procedure</category><category>opensource</category><category>sql database</category><category>database design</category><category>db2</category><category>ms sql server</category><category>sql programming</category><category>sql server 2000</category><category>structured query language sql</category><category>Cursor Functions</category><category>Microsoft</category><category>RDBMS</category><category>SQL Server 2005</category><category>SQL Server 2008</category><category>System Functions</category><category>Triggers</category><category>sql commands</category><category>sql join</category><category>sql queries</category><category>ALIAS NAMES</category><category>ALTER the Database</category><category>ALTER the Table</category><category>AND Operator</category><category>ASCII EDITOR</category><category>ASP.NET</category><category>Adding constraints for the existing table with constraint names</category><category>Adding constraints for the existing table without any constraint names</category><category>Analysis Services</category><category>BATCH STATEMENTS</category><category>CASE Expression</category><category>CURSOR_ROWS function in Sql Server</category><category>Check Constraint</category><category>Column Level Constraints</category><category>Cross Join</category><category>Crystal Reports</category><category>Cursors</category><category>DB</category><category>DDL Commands</category><category>DELETE Statement</category><category>DROP Database</category><category>DYNAMIC CURSOR</category><category>Data Base System models</category><category>Data Control Language</category><category>Data Types</category><category>Database Engine</category><category>Database files and File groups</category><category>Database management system</category><category>Default Constraint</category><category>Directories</category><category>Dropping The Constraints</category><category>Each database file has five properties</category><category>Error Handling In PL/SQL</category><category>Exception Handler</category><category>Exception handling</category><category>FETCH_STATUS function in sql server</category><category>FILE_ID Function</category><category>FORWARD_ONLY CURSOR</category><category>First Normal Form</category><category>Foreign Key Constraint</category><category>Functions</category><category>How To Use Structured Query Language (SQL)</category><category>INDEXES</category><category>INSERT Statement</category><category>Inner Join</category><category>Integration Services</category><category>Joins</category><category>KEYSET CURSOR</category><category>Link Exchange</category><category>MySQL Database</category><category>NOT Operator</category><category>NOt null Constraint</category><category>NULLIF Function</category><category>Normalization</category><category>OR Operator</category><category>ORDER BY Clause</category><category>Operating system</category><category>Outer Join</category><category>PHP</category><category>Pattern Matching</category><category>PostgreSQL</category><category>Pre-determined Internal PL/SQL exceptions</category><category>Primary Key Constraint</category><category>Programming</category><category>Programming constructs in Batch statement</category><category>REPLICATE Function</category><category>Range Searching</category><category>Reporting Services</category><category>Rules and Defaults</category><category>Running the SQL file using SQL Prompt</category><category>SELECT Statement</category><category>SET OPERATORS</category><category>SP_DATABASES</category><category>SP_HELP</category><category>SP_RENAME</category><category>SP_RENAMEDB</category><category>SP_TABLES</category><category>SQL Aggregate Functions</category><category>SQL Keys</category><category>SQL Perl/PL Overview</category><category>SQL Replication</category><category>SQL Scalar functions</category><category>SQL Server 2000 allows three types of database files</category><category>SQL Server Database Security</category><category>SQL Server Security</category><category>SQL TOP Clause</category><category>SQL Wildcards</category><category>STATIC CURSOR</category><category>Second Normal Form</category><category>Service Broker</category><category>Stored Procudure</category><category>TOP Clause</category><category>Table Level Constraints</category><category>Table Valued function in Batch Statement</category><category>Things to observe on SQL</category><category>Third Normal Form</category><category>Transactions Control Language</category><category>Types of Constraints</category><category>Types of DBMS</category><category>Types of SQL</category><category>UPDATE Statement</category><category>USER DEFINED FUNCTIONS in Batch Statement</category><category>Unique Constraint</category><category>User-Named Exception Handlers</category><category>VIEWS</category><category>create a TABLE</category><category>data integrity</category><category>sql injecton</category><category>sql like</category><title>SQL</title><description>SQL is a standard interactive and programming language for querying and modifying data and managing databases</description><link>http://sqlserver-guide.blogspot.com/</link><managingEditor>noreply@blogger.com (Anonymous)</managingEditor><generator>Blogger</generator><openSearch:totalResults>118</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><xhtml:meta content="noindex" name="robots" xmlns:xhtml="http://www.w3.org/1999/xhtml"/><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1799474711497514132.post-7351297918464321625</guid><pubDate>Mon, 04 Mar 2013 11:29:00 +0000</pubDate><atom:updated>2013-03-04T03:29:25.923-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Cursor Functions</category><category domain="http://www.blogger.com/atom/ns#">FETCH_STATUS function in sql server</category><category domain="http://www.blogger.com/atom/ns#">mysql</category><category domain="http://www.blogger.com/atom/ns#">SQL</category><category domain="http://www.blogger.com/atom/ns#">sql commands</category><category domain="http://www.blogger.com/atom/ns#">sql injecton</category><category domain="http://www.blogger.com/atom/ns#">sql join</category><category domain="http://www.blogger.com/atom/ns#">sql queries</category><category domain="http://www.blogger.com/atom/ns#">Sql Server</category><title>FETCH_STATUS function in sql server</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
@@FETCH_STATUS function determines whether FETCH keyword has successfully retrieved a row from the current cursor. The value of @@FETCH_STATUS is undefined before any fetches have occurred on the connection.

&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;This function can have one of the three values&lt;/b&gt;:&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTCHnCZGTFrgG8CFJl8zwEOCIgCUH6M0cQZqmUAwCh6k6QSdXghebqoaDHZMInr9kaPlQNuEk3uSlh0z0RIF9pa14DcwcetA16Qyv82_sFMNooakOPXJeRQ3JVHSjC-5Td84vbWNemAdtC/s1600/FETCH_STATUS+function+in+sql+server.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="93" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTCHnCZGTFrgG8CFJl8zwEOCIgCUH6M0cQZqmUAwCh6k6QSdXghebqoaDHZMInr9kaPlQNuEk3uSlh0z0RIF9pa14DcwcetA16Qyv82_sFMNooakOPXJeRQ3JVHSjC-5Td84vbWNemAdtC/s320/FETCH_STATUS+function+in+sql+server.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Syntax of @@FETCH_STATUS Function :&lt;br /&gt;
&lt;br /&gt;
@@FETCH_STATUS&lt;br /&gt;
&lt;br /&gt;
Return type of @@FETCH_STATUS function is integer.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Examples of @@FETCH_STATUS Function&lt;/b&gt; :&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Example 1 : Use of @@FETCH_STATUS function&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
DECLARE Customer_Cursor CURSOR FOR&lt;br /&gt;
SELECT ContactName FROM Customers&lt;br /&gt;
OPEN Customer_Cursor&lt;br /&gt;
&lt;span style="color: orange;"&gt;FETCH NEXT FROM Customer_Cursor&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: orange;"&gt;WHILE @@FETCH_STATUS = 0&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
BEGIN&lt;br /&gt;
&lt;b&gt;&amp;nbsp;&lt;/b&gt;FETCH NEXT FROM Customer_Cursor&lt;br /&gt;
END&lt;br /&gt;
CLOSE Customer_Cursor&lt;br /&gt;
DEALLOCATE Customer_Cursor&lt;br /&gt;
&lt;br /&gt;
Above cursor displays each customer name one by one.  


&lt;/div&gt;
</description><link>http://sqlserver-guide.blogspot.com/2013/03/fetchstatus-function-in-sql-server.html</link><author>noreply@blogger.com (Anonymous)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTCHnCZGTFrgG8CFJl8zwEOCIgCUH6M0cQZqmUAwCh6k6QSdXghebqoaDHZMInr9kaPlQNuEk3uSlh0z0RIF9pa14DcwcetA16Qyv82_sFMNooakOPXJeRQ3JVHSjC-5Td84vbWNemAdtC/s72-c/FETCH_STATUS+function+in+sql+server.png" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1799474711497514132.post-4694547731440769378</guid><pubDate>Mon, 04 Mar 2013 11:02:00 +0000</pubDate><atom:updated>2013-03-04T03:02:28.283-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Cursor Functions</category><category domain="http://www.blogger.com/atom/ns#">CURSOR_ROWS function in Sql Server</category><category domain="http://www.blogger.com/atom/ns#">mysql</category><category domain="http://www.blogger.com/atom/ns#">sql commands</category><category domain="http://www.blogger.com/atom/ns#">sql join</category><category domain="http://www.blogger.com/atom/ns#">sql like</category><category domain="http://www.blogger.com/atom/ns#">sql queries</category><category domain="http://www.blogger.com/atom/ns#">Sql Server</category><title>CURSOR_ROWS function in Sql Server</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
@@CURSOR_ROWS function returns number of rows currently in the last opened cursor. The number returned by @@CURSOR_ROWS is negative if the last cursor was opened asynchronously. Keyset-driver or static cursors are opened asynchronously if the value for sp_configurecursor threshold is greater than 0, and the number of rows in the cursor result set is greater than the cursor threshold.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Below is table that describes cursor status based on return type&lt;/b&gt;.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisPL4W-QUqmI_c-q8qWTEacJVX8pHtMzRipk2u2D_Fy80aPNERx48lpdIkfOVzqBug6UgczDE1yltphlnQlaaiCkxfRyv4Mm_wADg8J6VER5-V-DRG1-GUaHtnDg0sFe5APaDxziYW-rOB/s1600/CURSOR_ROWS+function+in+sql+server.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="155" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisPL4W-QUqmI_c-q8qWTEacJVX8pHtMzRipk2u2D_Fy80aPNERx48lpdIkfOVzqBug6UgczDE1yltphlnQlaaiCkxfRyv4Mm_wADg8J6VER5-V-DRG1-GUaHtnDg0sFe5APaDxziYW-rOB/s320/CURSOR_ROWS+function+in+sql+server.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Syntax of @@CURSOR_ROWS Function&lt;/b&gt; :&lt;br /&gt;
&lt;br /&gt;
@@CURSOR_ROWS&lt;br /&gt;
&lt;br /&gt;
Return type of @@CURSOR_ROWS function is integer.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Examples of @@CURSOR_ROWS Function&lt;/b&gt; :&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Example 1 : Use of @@CURSOR_ROWS function in select clause&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
SELECT @@CURSOR_ROWS&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Output&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;0&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Above example returns 0 means currently cursor is not opened.&lt;br /&gt;
Now we will execute @@CURSOR_ROWS after cursor is opened.&lt;br /&gt;
&lt;br /&gt;
Below is the code to create, open and execute cursor.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;DECLARE Product_Cursor CURSOR FOR&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;SELECT ProductName FROM Products&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;OPEN Product_Cursor&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;FETCH NEXT FROM Product_Cursor&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Output
ProductName&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Tea&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Above example returns output of executed cursor.&lt;br /&gt;
&lt;br /&gt;
Below is the code to execute @@CURSOR_ROWS after cursor is executed. After that cursor is closed and deallocated.&lt;br /&gt;
&lt;br /&gt;
SELECT @@CURSOR_ROWS&lt;br /&gt;
CLOSE Product_Cursor&lt;br /&gt;
&lt;span id="ctl00_ctl00_CC_CM_lblExample"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;span style="color: black;"&gt;DEALLOCATE&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;Product_Cursor&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Output&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;-1

Now&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
@@CURSOR_ROWS function returns -1 i.e. cursor is dynamic.
&lt;/div&gt;
</description><link>http://sqlserver-guide.blogspot.com/2013/03/cursorrows-function-in-sql-server.html</link><author>noreply@blogger.com (Anonymous)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisPL4W-QUqmI_c-q8qWTEacJVX8pHtMzRipk2u2D_Fy80aPNERx48lpdIkfOVzqBug6UgczDE1yltphlnQlaaiCkxfRyv4Mm_wADg8J6VER5-V-DRG1-GUaHtnDg0sFe5APaDxziYW-rOB/s72-c/CURSOR_ROWS+function+in+sql+server.png" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1799474711497514132.post-2097535153790931083</guid><pubDate>Thu, 09 Aug 2012 03:36:00 +0000</pubDate><atom:updated>2012-08-08T20:36:36.002-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">REPLICATE Function</category><category domain="http://www.blogger.com/atom/ns#">Sql Server</category><category domain="http://www.blogger.com/atom/ns#">System Functions</category><title>REPLICATE Function</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;

&lt;br /&gt;
&lt;div style="font-family: Verdana,sans-serif;"&gt;
&lt;span style="font-size: small;"&gt;&lt;b&gt;&lt;span&gt;REPLICATE
function of sql server with examples.&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-family: Verdana,sans-serif;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="font-family: Verdana,sans-serif;"&gt;
&lt;span style="font-size: small;"&gt;REPLICATE&amp;nbsp;is used to repeat a string with specified
number of times.&amp;nbsp;&lt;span style="line-height: 115%;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;h3 style="font-family: Verdana,sans-serif;"&gt;
&lt;span style="font-size: small;"&gt;Syntax of REPLICATE Function :&lt;/span&gt;&lt;/h3&gt;
&lt;div class="MsoNormal" style="color: red; font-family: Verdana,sans-serif;"&gt;
&lt;span style="font-size: small;"&gt;REPLICATE ( &lt;i&gt;character_expression
,integer_expression &lt;/i&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="color: red; font-family: Verdana,sans-serif;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="font-family: Verdana,sans-serif;"&gt;
&lt;span style="font-size: small;"&gt;&lt;i&gt;character_expression&lt;/i&gt;&amp;nbsp;is a string to
repeat.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="font-family: Verdana,sans-serif;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="font-family: Verdana,sans-serif;"&gt;
&lt;span style="font-size: small;"&gt;&lt;span class="apple-style-span"&gt;&lt;i&gt;integer_expression&amp;nbsp;&lt;/i&gt;is
number of times the &lt;/span&gt;&lt;i&gt;character_expression&lt;/i&gt;&lt;span class="apple-style-span"&gt; to be repeated.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="font-family: Verdana,sans-serif;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="font-family: Verdana,sans-serif;"&gt;
&lt;span style="font-size: small;"&gt;&lt;i&gt;Return type&lt;/i&gt; of REPLICATE function is varchar data
type. &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;h3 style="font-family: Verdana,sans-serif;"&gt;
&lt;span style="font-size: small;"&gt;Examples of REPLICATE Function :&lt;/span&gt;&lt;/h3&gt;
&lt;h3 style="font-family: Verdana,sans-serif;"&gt;
&lt;span style="font-size: small;"&gt;Example 1 : Use of REPLICATE function in select clause&lt;/span&gt;&lt;/h3&gt;
&lt;div class="MsoNormal" style="font-family: Verdana,sans-serif;"&gt;
&lt;span style="font-size: small;"&gt;SELECT &lt;span style="color: red;"&gt;REPLICATE('Syntax-Example',
3)&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="font-family: Verdana,sans-serif;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="font-family: Verdana,sans-serif;"&gt;
&lt;span style="font-size: small;"&gt;&lt;b&gt;Output&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="color: red; font-family: Verdana,sans-serif;"&gt;
&lt;span style="font-size: small;"&gt;Syntax-ExampleSyntax-ExampleSyntax-Example&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="font-family: Verdana,sans-serif;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="font-family: Verdana,sans-serif;"&gt;
&lt;span style="font-size: small;"&gt;Above example returns repeated string 3 times by specified
string.&lt;/span&gt;&lt;/div&gt;
&lt;h3 style="font-family: Verdana,sans-serif;"&gt;
&lt;span style="font-size: small;"&gt;Example 2 : Use of REPLICATE function to display field value of table in a
select clause&lt;/span&gt;&lt;/h3&gt;
&lt;div class="MsoNormal" style="font-family: Verdana,sans-serif;"&gt;
&lt;span style="font-size: small;"&gt;SELECT ContactName, &lt;span style="color: red;"&gt;REPLICATE(ContactName,2)
'Repeated Name'&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="font-family: Verdana,sans-serif;"&gt;
&lt;span style="font-size: small;"&gt;FROM &amp;nbsp; &amp;nbsp;Customers&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="font-family: Verdana,sans-serif;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="font-family: Verdana,sans-serif;"&gt;
&lt;span style="font-size: small;"&gt;&lt;b&gt;Output&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="color: black; font-family: Verdana,sans-serif;"&gt;
&lt;span style="font-size: small;"&gt;ContactName &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
Repeated Name&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="color: black; font-family: Verdana,sans-serif;"&gt;
&lt;span style="font-size: small;"&gt;Clickson Andrew&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; Clickson Andrew Clickson
Andrew&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="color: black; font-family: Verdana,sans-serif;"&gt;
&lt;span style="font-size: small;"&gt;Adie Addison &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; Adie AddisonAdie Addison&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="color: black; font-family: Verdana,sans-serif;"&gt;
&lt;span style="font-size: small;"&gt;Christopher Cole &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Christopher ColeChristopher Cole&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="font-family: Verdana,sans-serif;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="font-family: Verdana,sans-serif;"&gt;
&lt;span style="font-size: small;"&gt;Above example repeats customers name 2 times from customers
table.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</description><link>http://sqlserver-guide.blogspot.com/2012/08/replicate-function.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1799474711497514132.post-8473637791556897500</guid><pubDate>Thu, 09 Aug 2012 03:27:00 +0000</pubDate><atom:updated>2012-08-08T20:32:05.208-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">NULLIF Function</category><category domain="http://www.blogger.com/atom/ns#">Sql Server</category><category domain="http://www.blogger.com/atom/ns#">System Functions</category><title>NULLIF Function</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;br /&gt;
&lt;div style="mso-outline-level: 4;"&gt;
&lt;b&gt;&lt;span style="font-size: 13.5pt;"&gt;NULLIF
function in sql server with examples.&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style="mso-outline-level: 4;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
NULLIF&amp;nbsp;function returns null value if the two specified
expressions are equivalent.&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;span style="font-size: 12.0pt; line-height: 115%;"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
NULLIF is equivalent to a searched CASE function in which
the two expressions are equal and the resulting expression is NULL.&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
NULLIF returns the first expression if the two expressions
are not equivalent. If the expressions are equivalent, NULLIF returns a null
value of the type of the first expression.&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;/div&gt;
&lt;h3&gt;
Syntax of NULLIF Function :&lt;/h3&gt;
&lt;div class="MsoNormal" style="color: red;"&gt;
NULLIF (&lt;i&gt;expression1, expression2&lt;/i&gt;)&lt;/div&gt;
&lt;div class="MsoNormal" style="color: red;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="color: red;"&gt;
&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;i&gt;expression1 and expression2 are&lt;/i&gt;&lt;span class="apple-style-span"&gt;&amp;nbsp;any valid sql server expression. It can be
constant, column name, function, subquery, or any combination of arithmetic,
bitwise, and string operators.&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;i&gt;Return type&lt;/i&gt;&lt;span class="apple-style-span"&gt;&amp;nbsp;of
NULLIF function is same as expression1.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span class="apple-style-span"&gt;Examples of NULLIF Function :&lt;/span&gt;&lt;/h3&gt;
&lt;h3&gt;
Example 1 : Use of NULLIF function in select clause&amp;nbsp;&lt;/h3&gt;
&lt;div class="MsoNormal"&gt;
SELECT ProductName, &lt;span style="color: red;"&gt;NULLIF(UnitsInStock,ReorderLevel)
AS Stock&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
FROM &amp;nbsp; Products&amp;nbsp;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="MsoNormal"&gt;
&lt;b&gt;Output&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="MsoNormal"&gt;
ProductName &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Stock&lt;/div&gt;
&lt;div class="MsoNormal" style="color: black;"&gt;
Rogide soild &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp; NULL&lt;/div&gt;
&lt;div class="MsoNormal" style="color: black;"&gt;
Speagesild &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp;95&lt;/div&gt;
&lt;div class="MsoNormal" style="color: black;"&gt;
Zanse koeken &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 36&lt;/div&gt;
&lt;div class="MsoNormal" style="color: black;"&gt;
Cho colade &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; 15&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;div style="color: black;"&gt;
Scottish &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NULL&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="MsoNormal"&gt;
Above example displays Null where both columns UnitsInStock
and ReorderLevel values are same otherwise it displays value of UnitsInStock
column.&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="color: red;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</description><link>http://sqlserver-guide.blogspot.com/2012/08/nullif-function.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1799474711497514132.post-1192445481887742608</guid><pubDate>Tue, 07 Aug 2012 09:21:00 +0000</pubDate><atom:updated>2012-08-07T02:26:08.500-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">CASE Expression</category><category domain="http://www.blogger.com/atom/ns#">Sql Server</category><title>CASE Expression</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;b&gt;&lt;span style="font-size: 13.5pt;"&gt;CASE
expression in sql server with examples.&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="MsoNormal"&gt;
&lt;span id="ctl00_ctl00_CC_CM_lblExample"&gt;CASE expression
enables many forms of conditional processing to be placed into a SQL statement.
By using CASE, more logic can be placed into SQL statements instead of being
expressed in a host language or 4GL program.&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;span id="ctl00_ctl00_CC_CM_lblExample"&gt;&lt;span style="font-size: 12.0pt; line-height: 115%;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
CASE is a deterministic&amp;nbsp;i.e They return same value
every time they are called with a specific set of values.&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
CASE expression has 2 formates as listed below.&lt;/div&gt;
&lt;ul type="disc"&gt;
&lt;li class="MsoNormal" style="line-height: normal; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;"&gt;Simple
     CASE function compares &amp;nbsp;an expression to a set of simple expressions.&lt;/li&gt;
&lt;li class="MsoNormal" style="line-height: normal;"&gt;Searched
     CASE function evaluates a set of boolean expression .&amp;nbsp;&amp;nbsp; &lt;/li&gt;
&lt;/ul&gt;
Syntax of Simple CASE Expression :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="MsoNormal" style="color: red;"&gt;
CASE input_expression&amp;nbsp;&lt;/div&gt;
&lt;div class="MsoNormal" style="color: red;"&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;WHEN when_expression
THEN result_expression&amp;nbsp;&lt;/div&gt;
&lt;div class="MsoNormal" style="color: red;"&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; [ ...n ]&amp;nbsp;&lt;/div&gt;
&lt;div class="MsoNormal" style="color: red;"&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; [&amp;nbsp;&lt;/div&gt;
&lt;div class="MsoNormal" style="color: red;"&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp;ELSE else_result_expression&amp;nbsp;&lt;/div&gt;
&lt;div class="MsoNormal" style="color: red;"&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; ]&amp;nbsp;&lt;/div&gt;
&lt;div class="MsoNormal" style="color: red;"&gt;
END&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="MsoNormal"&gt;
&lt;i&gt;input_expression&amp;nbsp;&lt;/i&gt;&lt;span class="apple-style-span"&gt;is
any valid sql server expression evaluated when using the simple .&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;i&gt;WHEN Boolean_expression i&lt;/i&gt;&lt;span class="apple-style-span"&gt;s a Boolean expression evaluated when using the searched
CASE format. Boolean_expression is any valid Boolean expression.&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;i&gt;n&lt;/i&gt;&amp;nbsp;is a placeholder indicating that multiple WHEN
when_expression THEN result_expression clauses, or multiple WHEN
Boolean_expression THEN result_expression clauses can be used.&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;i&gt;THEN result_expression&lt;/i&gt;&amp;nbsp;is a expression returned
when input_expression equals when_expression evaluates to TRUE, or
Boolean_expression evaluates to TRUE. result expression is any valid SQL Server
expression.&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;i&gt;ELSE else_result_expression&lt;/i&gt;&amp;nbsp;is a expression
returned if no comparison operation evaluates to TRUE. If this argument is
omitted and no comparison operation evaluates to TRUE, CASE returns NULL.&amp;nbsp;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
else_result_expression is any valid SQL Server expression. The data types of
else_result_expression and any result_expression must be the same or must be an
implicit conversion.&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;/div&gt;
&lt;h3&gt;
&lt;span class="apple-style-span"&gt;Examples of CASE Expression :&lt;/span&gt;&lt;/h3&gt;
&lt;h3&gt;
Example 1 : Use of simple CASE expression function in select clause&amp;nbsp;&lt;/h3&gt;
&lt;div class="MsoNormal"&gt;
SELECT&amp;nbsp;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="color: red;"&gt;
&amp;nbsp;&amp;nbsp; CASE SUBSTRING('Sintax-Example',1,2)&lt;/div&gt;
&lt;div class="MsoNormal" style="color: red;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="color: red;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHEN 'Si' THEN 'Please
correct your spelling. Don''t use si instead of sy. It is Syntax- &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
Example.'&lt;/div&gt;
&lt;div class="MsoNormal" style="color: red;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHEN 'Se' THEN 'Please
correct your spelling. Don''t use se instead of sy. It is Syntax- &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Example.'&lt;/div&gt;
&lt;div class="MsoNormal" style="color: red;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ELSE 'Syntax-Example'&lt;/div&gt;
&lt;div class="MsoNormal" style="color: red;"&gt;
&lt;span class="apple-style-span"&gt;&lt;/span&gt;&amp;nbsp; END&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;span class="apple-style-span"&gt;&lt;b&gt;Output&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;span class="apple-style-span"&gt;Please correct your spelling.
Don't use si instead of sy. It is Syntax-Example.&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;span class="apple-style-span"&gt;Above example compares first
2&amp;nbsp;characters specified string and displays output based on comparision
expression evaluates to true.&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;/div&gt;
&lt;h3&gt;
&lt;span class="apple-style-span"&gt;Example 2 : Use of searched CASE expression
function in select clause&lt;/span&gt;&lt;/h3&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="MsoNormal"&gt;
&lt;span class="apple-style-span"&gt;SELECT&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;span class="apple-style-span"&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: red;"&gt;CASE&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="color: red;"&gt;
&lt;span class="apple-style-span"&gt;&amp;nbsp;&amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;WHEN
SUBSTRING('Sintax-Example',1,2) = 'Si' THEN 'Please correct your spelling.
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Don''t use
si instead of sy. It is Syntax-Example.'&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="color: red;"&gt;
&lt;span class="apple-style-span"&gt;&amp;nbsp;&amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;WHEN
SUBSTRING('Sintax-Example',1,2) = 'Se' THEN 'Please correct your spelling.
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Don''t use
se instead of sy. It is Syntax-Example.'&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="color: red;"&gt;
&lt;span class="apple-style-span"&gt;&amp;nbsp;&amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ELSE
'Syntax-Example'&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="color: red;"&gt;
&lt;span class="apple-style-span"&gt;&amp;nbsp;&amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; END&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;span class="apple-style-span"&gt;&lt;b&gt;Output&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;span class="apple-style-span"&gt;Please correct your spelling.
Don't use si instead of sy. It is Syntax-Example.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="MsoNormal"&gt;
&lt;span class="apple-style-span"&gt;Above example compares first 2
characters specified string and displays output based on comparision expression
evaluates to true. &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</description><link>http://sqlserver-guide.blogspot.com/2012/08/case-expression.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1799474711497514132.post-3685114011333242405</guid><pubDate>Tue, 07 Aug 2012 09:05:00 +0000</pubDate><atom:updated>2012-08-07T02:05:14.462-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">FILE_ID Function</category><category domain="http://www.blogger.com/atom/ns#">Sql Server</category><title>FILE_ID Function</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;

&lt;br /&gt;
&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; mso-outline-level: 1;"&gt;
&lt;b&gt;&lt;span style="font-size: 13.5pt;"&gt;FILE_ID
function in sql server with examples.&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 24.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-kerning: 18.0pt;"&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
FILE_ID function is used to get file identification number
for logical file name in the current database.&lt;span style="font-size: 12.0pt; line-height: 115%;"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;h3&gt;
Syntax of FILE_ID Function :&lt;/h3&gt;
&lt;div class="MsoNormal" style="color: red;"&gt;
FILE_ID ( '&lt;i&gt;file_name&lt;/i&gt;' )&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;i&gt;file_name&amp;nbsp;&lt;/i&gt;is a name of the file for which to
return the file ID. It corresponds to the name column in sysfiles. It is of
type nchar(128).&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;i&gt;Return type&lt;/i&gt;&amp;nbsp;of FILE_ID function is smallint.&lt;/div&gt;
&lt;h3&gt;
Examples of FILE_ID Function :&lt;/h3&gt;
&lt;h3&gt;
Example 1 : Use of FILE_ID function in select clause&lt;/h3&gt;
&lt;div class="MsoNormal"&gt;
SELECT&amp;nbsp;&lt;span style="color: red;"&gt;FILE_ID('Southwind')&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;b&gt;Output&lt;/b&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="color: red;"&gt;
1&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
Above example returns id for &lt;span style="font-size: 12.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;"&gt;Soundwind&lt;/span&gt; file.&lt;/div&gt;
&lt;/div&gt;</description><link>http://sqlserver-guide.blogspot.com/2012/08/fileid-function.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1799474711497514132.post-5753931072947235430</guid><pubDate>Wed, 13 Jun 2012 16:43:00 +0000</pubDate><atom:updated>2012-06-13T09:47:14.666-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">SQL Wildcards</category><title>SQL Wildcards</title><description>&amp;nbsp;

&lt;br /&gt;
SQL wildcards can substitute for one or more characters when searching for
data in a database.&lt;br /&gt;
&lt;br /&gt;
SQL wildcards must be used with the SQL LIKE operator.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="MsoNormal"&gt;
With SQL, the following wildcards can be use Wildcard are :&amp;nbsp;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
%,_,[^charlist] or [!charlist]&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
% : A substitute for zero or more characters&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
_ : A substitute for exactly one character&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
[^charlist] or [!charlist] : Any single character not in
charlist&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;/div&gt;
&lt;h2&gt;

SQL Wildcard Examples&lt;/h2&gt;
We have the following "Persons" table:&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWtaO_8KCD98o9IGMoYYK712ZUm_5wJLSPoNt_9cITwLnIGmjgaMwpfebRq0eYPNbRQV_90H9AXe-3yBLVJgWkLueYp9fbAinkkt_ygNSDuZ_q65csRkYBtOIRE3faPdooe3cX1aUlP9vU/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="38" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWtaO_8KCD98o9IGMoYYK712ZUm_5wJLSPoNt_9cITwLnIGmjgaMwpfebRq0eYPNbRQV_90H9AXe-3yBLVJgWkLueYp9fbAinkkt_ygNSDuZ_q65csRkYBtOIRE3faPdooe3cX1aUlP9vU/s320/1.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&amp;nbsp;

&lt;/div&gt;
&lt;h2&gt;

Using the % Wildcard&lt;/h2&gt;
Now we want to select the persons living in a city that starts with
"sa" from the "Persons" table.&lt;br /&gt;
&lt;br /&gt;
We use the following SELECT statement:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="MsoNormal"&gt;
SELECT * FROM Persons&lt;br /&gt;
WHERE City LIKE 'Chi%'&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
The result-set will look like this:&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglGpK-Q5XW04Hsc6x7X8mzrRa9fU2ZG_wx2LgD6e7sqEmjtgUAP5vIR0wpAEDjKjUgwJjPIfqxNPAKC7ZKlOzDq4VA_WD7ZHJFrliO6N6euDkEV6NN7kkqXgeIxXUaLoUlkNJ2jRdvmvr0/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="28" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglGpK-Q5XW04Hsc6x7X8mzrRa9fU2ZG_wx2LgD6e7sqEmjtgUAP5vIR0wpAEDjKjUgwJjPIfqxNPAKC7ZKlOzDq4VA_WD7ZHJFrliO6N6euDkEV6NN7kkqXgeIxXUaLoUlkNJ2jRdvmvr0/s320/2.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&amp;nbsp;

&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;
&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;Next, we want to select the persons
living in a city that contains the pattern "nes" from the
"Persons" table.&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;
&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;We use the following SELECT
statement:&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;
&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;SELECT * FROM Persons&lt;br /&gt;
WHERE City LIKE '%ago%'&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;
The result-set will look like this:&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9Z2kzyZTbG3XkxgVbLvOW_EGgt4sO7kBhyphenhyphenzCGLRJSEZfwKqgxCdSgWOZMxSRAKXmLAJDScyUYPl7DKq7KBl-tRYeWmntiP95JGidkUaclO2qCu6ELlO7fT_JCTX7MjhhSmjxj-dKrFbZQ/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="30" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9Z2kzyZTbG3XkxgVbLvOW_EGgt4sO7kBhyphenhyphenzCGLRJSEZfwKqgxCdSgWOZMxSRAKXmLAJDScyUYPl7DKq7KBl-tRYeWmntiP95JGidkUaclO2qCu6ELlO7fT_JCTX7MjhhSmjxj-dKrFbZQ/s320/3.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;
&lt;b&gt;Using the _ Wildcard&lt;/b&gt;&lt;br /&gt;
&lt;/div&gt;
Now we want to select the persons with a first name that starts with any
character, followed by "la" from the "Persons" table.&lt;br /&gt;
&lt;br /&gt;
We use the following SELECT statement:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="MsoNormal"&gt;
SELECT * FROM Persons&lt;br /&gt;
WHERE FirstName LIKE '_om'&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
The result-set will look like this:&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQHzFlU6Y0sAwSX8zYz8PN5VY-2991WjKyrGtXzx-qA-9XxROILRUQ7DICH5DgOxnMEkHTm3U6ZUPTVRwnrq5uCZ36pVyqTnjdmv0Sh4i1CiuURy-DBJ90pUT-XmVXZbkr5QoIcgwO0DSR/s1600/4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="18" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQHzFlU6Y0sAwSX8zYz8PN5VY-2991WjKyrGtXzx-qA-9XxROILRUQ7DICH5DgOxnMEkHTm3U6ZUPTVRwnrq5uCZ36pVyqTnjdmv0Sh4i1CiuURy-DBJ90pUT-XmVXZbkr5QoIcgwO0DSR/s320/4.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class="MsoNormal"&gt;
&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;Next, we want to select the persons
with a last name that starts with "S", followed by any character,
followed by "end", followed by any character, followed by
"on" from the "Persons" table.&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;
&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;We use the following SELECT
statement:&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;
&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;SELECT * FROM Persons&lt;br /&gt;
WHERE LastName LIKE 'K_end_en'&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;
&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;The result-set will look like this:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1G5l7IoXcKfGIkxEYqwtOkO5rcJU02_bVj1lX5nU-hI56kxS6krufx2HCdpaYe_qN-avl3N6lWrQxSS3vtwX0_arUdyJiZYa35P2S4wi-OsWuCmPwMrQ8dCRiIf0JEmB6JZMuooYUwUjR/s1600/5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="18" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1G5l7IoXcKfGIkxEYqwtOkO5rcJU02_bVj1lX5nU-hI56kxS6krufx2HCdpaYe_qN-avl3N6lWrQxSS3vtwX0_arUdyJiZYa35P2S4wi-OsWuCmPwMrQ8dCRiIf0JEmB6JZMuooYUwUjR/s320/5.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;b&gt;Using the [charlist] Wildcard&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Now we want to select the persons with a last name that starts with "a"
or "k"&amp;nbsp; from the
"Persons" table.&lt;br /&gt;
&lt;br /&gt;
We use the following SELECT statement:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="MsoNormal"&gt;
SELECT * FROM Persons&lt;br /&gt;
WHERE LastName LIKE '[ak]%'&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
The result-set will look like this:&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-ulVcc7rnV_jXksRPrYpafyQ-PJm9t1SMYGBjS95OeqS7qKbEeXCL-BV9-hzIJmmH59r3RlToVWzR475c8ckjfRBUXIh_RZCNWznu-naT8WydmQawGtGlrG32lehFp8JAndQAv5PQXZQp/s1600/6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="37" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-ulVcc7rnV_jXksRPrYpafyQ-PJm9t1SMYGBjS95OeqS7qKbEeXCL-BV9-hzIJmmH59r3RlToVWzR475c8ckjfRBUXIh_RZCNWznu-naT8WydmQawGtGlrG32lehFp8JAndQAv5PQXZQp/s320/6.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;Next, we want to select the persons
with a last name that do not start with "a" or "k" from the
"Persons" table.&lt;/span&gt;&lt;br /&gt;
&lt;div class="MsoNormal" style="line-height: normal;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;
&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;We use the following SELECT
statement:&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;
&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;SELECT * FROM Persons&lt;br /&gt;
WHERE LastName LIKE '[!ak]%'&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;
&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;The result-set will look like this:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizh_-aEzov_9gjYnhEblTz2aIfwtM-nXF-VbrVyugVJ3le7G2ffM5u822JggMZhzVcx1zasPBz6xvkwHfpcFpRPcg038bJXF6l-oWZOyias_XArOlcjkQN27SEeSR9Gox-m1xhLWckmGah/s1600/7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="30" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizh_-aEzov_9gjYnhEblTz2aIfwtM-nXF-VbrVyugVJ3le7G2ffM5u822JggMZhzVcx1zasPBz6xvkwHfpcFpRPcg038bJXF6l-oWZOyias_XArOlcjkQN27SEeSR9Gox-m1xhLWckmGah/s320/7.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;
&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;
&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;&lt;/span&gt;&lt;/div&gt;</description><link>http://sqlserver-guide.blogspot.com/2012/06/sql-wildcards.html</link><author>noreply@blogger.com (Anonymous)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWtaO_8KCD98o9IGMoYYK712ZUm_5wJLSPoNt_9cITwLnIGmjgaMwpfebRq0eYPNbRQV_90H9AXe-3yBLVJgWkLueYp9fbAinkkt_ygNSDuZ_q65csRkYBtOIRE3faPdooe3cX1aUlP9vU/s72-c/1.png" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1799474711497514132.post-2734979668371367285</guid><pubDate>Fri, 02 Mar 2012 05:37:00 +0000</pubDate><atom:updated>2012-03-28T06:39:17.155-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">SQL</category><category domain="http://www.blogger.com/atom/ns#">SQL TOP Clause</category><category domain="http://www.blogger.com/atom/ns#">TOP Clause</category><title>SQL TOP Clause</title><description>&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;m:smallfrac m:val="off"&gt;
   &lt;m:dispdef&gt;
   &lt;m:lmargin m:val="0"&gt;
   &lt;m:rmargin m:val="0"&gt;
   &lt;m:defjc m:val="centerGroup"&gt;
   &lt;m:wrapindent m:val="1440"&gt;
   &lt;m:intlim m:val="subSup"&gt;
   &lt;m:narylim m:val="undOvr"&gt;
  &lt;/m:narylim&gt;&lt;/m:intlim&gt;
&lt;/m:wrapindent&gt;

&lt;/m:defjc&gt;&lt;/m:rmargin&gt;&lt;/m:lmargin&gt;&lt;/m:dispdef&gt;&lt;/m:smallfrac&gt;&lt;br /&gt;
The TOP clause is used to specify the number of records to return.The TOP clause can be very useful on large tables with thousands of records.
Returning a large number of records can impact on performance.&lt;br /&gt;
&lt;h3&gt;

SQL Server Syntax&lt;/h3&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
SELECT TOP number|percent column_name(s)&lt;br /&gt;
FROM table_name&lt;/div&gt;
&lt;h2&gt;

SQL SELECT TOP Equivalent in MySQL and Oracle&lt;/h2&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h3&gt;

MySQL Syntax&lt;/h3&gt;
&lt;div class="MsoNormal"&gt;
SELECT column_name(s)&lt;br /&gt;
FROM table_name&lt;br /&gt;
LIMIT number&lt;/div&gt;
&lt;h3&gt;

Example&lt;/h3&gt;
&lt;div class="MsoNormal"&gt;
SELECT *&lt;br /&gt;
FROM Persons&lt;br /&gt;
LIMIT 6&lt;/div&gt;
&lt;h3&gt;

Oracle Syntax&lt;/h3&gt;
&lt;div class="MsoNormal"&gt;
SELECT column_name(s)&lt;br /&gt;
FROM table_name&lt;br /&gt;
WHERE ROWNUM &amp;lt;= number&lt;/div&gt;
&lt;h3&gt;

Example&lt;/h3&gt;
&lt;div class="MsoNormal"&gt;
SELECT *&lt;br /&gt;
FROM Persons&lt;br /&gt;
WHERE ROWNUM &amp;lt;=6&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h2&gt;

SQL TOP Example&lt;/h2&gt;
The "Persons" table:&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIg2LiEOUK49vdKUEvMyT9pkKW1INM4YXIARu2XvU5VNM0IO88oohLHMtYNdc6lnDpXTAf_p8LPzARG69jd_B_53AByxtdhUyG1768RPGqDYHvf287GyzeYlN8zMducA_kqVTcB5jgOIB1/s1600/sql+top+clause.png" imageanchor="1" rel="nofollow" style="margin-left: 1em; margin-right: 1em;" target="_blank"&gt;&lt;img border="0" height="56" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIg2LiEOUK49vdKUEvMyT9pkKW1INM4YXIARu2XvU5VNM0IO88oohLHMtYNdc6lnDpXTAf_p8LPzARG69jd_B_53AByxtdhUyG1768RPGqDYHvf287GyzeYlN8zMducA_kqVTcB5jgOIB1/s320/sql+top+clause.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&amp;nbsp;
   &lt;m:smallfrac m:val="off"&gt;
   &lt;m:dispdef&gt;
   &lt;m:lmargin m:val="0"&gt;
   &lt;m:rmargin m:val="0"&gt;
   &lt;m:defjc m:val="centerGroup"&gt;
   &lt;m:wrapindent m:val="1440"&gt;
   &lt;m:intlim m:val="subSup"&gt;
   &lt;m:narylim m:val="undOvr"&gt;
  &lt;/m:narylim&gt;&lt;/m:intlim&gt;
&lt;/m:wrapindent&gt;

&lt;/m:defjc&gt;&lt;/m:rmargin&gt;&lt;/m:lmargin&gt;&lt;/m:dispdef&gt;&lt;/m:smallfrac&gt;&lt;br /&gt;
&lt;div class="MsoNormal" style="line-height: normal;"&gt;
&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;Now we want to select only the two
first records in the table above.&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal;"&gt;
&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;We use the following SELECT
statement:&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;
&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;SELECT TOP 2 * FROM Persons&lt;/span&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidm54nuT5U539RPoYKYrAGk7TZZR09Ejy50GmtonOqsvF1OaAA8UW4BJLXF7Hqr4Lwc_sJeZWUbtdh7l58Gi1XxobKHMOV5FrLGTLhk4U2oU2QDijLVIDdn0DWpJCa3WBNrzDN2SQHZOrc/s1600/sql+top+clause1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;" target="_blank"&gt;&lt;img border="0" height="27" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidm54nuT5U539RPoYKYrAGk7TZZR09Ejy50GmtonOqsvF1OaAA8UW4BJLXF7Hqr4Lwc_sJeZWUbtdh7l58Gi1XxobKHMOV5FrLGTLhk4U2oU2QDijLVIDdn0DWpJCa3WBNrzDN2SQHZOrc/s320/sql+top+clause1.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;
&lt;m:smallfrac m:val="off"&gt;
   &lt;m:dispdef&gt;
   &lt;m:lmargin m:val="0"&gt;
   &lt;m:rmargin m:val="0"&gt;
   &lt;m:defjc m:val="centerGroup"&gt;
   &lt;m:wrapindent m:val="1440"&gt;
   &lt;m:intlim m:val="subSup"&gt;
   &lt;m:narylim m:val="undOvr"&gt;
  &lt;/m:narylim&gt;&lt;/m:intlim&gt;
&lt;/m:wrapindent&gt;

&lt;/m:defjc&gt;&lt;/m:rmargin&gt;&lt;/m:lmargin&gt;&lt;/m:dispdef&gt;&lt;/m:smallfrac&gt;&lt;/div&gt;
&lt;h2&gt;

SQL TOP PERCENT Example&lt;/h2&gt;
The "Persons" table:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlPicbmdHRGsdQzV8XGGUbXR8rOLS5bzeXfLq0CPjog44QBcd1eTd_LqjP2LDWjR_VKJc6MCrSbhfsEwW_WBxgsa_zPn6tuAKQvtrqfeYSGdTKaUuBGo_5MeyZdWoWclMT683iXFv764Zx/s1600/sql+top+clause2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;" target="_blank"&gt;&lt;img border="0" height="56" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlPicbmdHRGsdQzV8XGGUbXR8rOLS5bzeXfLq0CPjog44QBcd1eTd_LqjP2LDWjR_VKJc6MCrSbhfsEwW_WBxgsa_zPn6tuAKQvtrqfeYSGdTKaUuBGo_5MeyZdWoWclMT683iXFv764Zx/s320/sql+top+clause2.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;
&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;&amp;nbsp;&lt;/span&gt;
   &lt;m:smallfrac m:val="off"&gt;
   &lt;m:dispdef&gt;
   &lt;m:lmargin m:val="0"&gt;
   &lt;m:rmargin m:val="0"&gt;
   &lt;m:defjc m:val="centerGroup"&gt;
   &lt;m:wrapindent m:val="1440"&gt;
   &lt;m:intlim m:val="subSup"&gt;
   &lt;m:narylim m:val="undOvr"&gt;
  &lt;/m:narylim&gt;&lt;/m:intlim&gt;
&lt;/m:wrapindent&gt;

&lt;/m:defjc&gt;&lt;/m:rmargin&gt;&lt;/m:lmargin&gt;&lt;/m:dispdef&gt;&lt;/m:smallfrac&gt;&lt;/div&gt;
Now we want to select only 50% of the records in the table above.&lt;br /&gt;
&lt;div class="MsoNormal" style="line-height: normal;"&gt;
&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;We use the following SELECT
statement:&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"&gt;
&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;"&gt;SELECT TOP 50 PERCENT * FROM Persons&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
The result-set will look like this:&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibFe_WxUWLsQvw7-QTrVONUe5NLEH4PwP02Hlgd-O9PZshVcRZEhebxSMTt8jv35c2MXMIVNTNyaJPJaiL0uYAb3RCtjSAQ8k1S-PqCgeVAuJWotZ9tMVDA0eDdyGLcUQmnElnHByI9Leq/s1600/sql+top+clause3.png" imageanchor="1" rel="nofollow" style="margin-left: 1em; margin-right: 1em;" target="_blank"&gt;&lt;img border="0" height="29" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibFe_WxUWLsQvw7-QTrVONUe5NLEH4PwP02Hlgd-O9PZshVcRZEhebxSMTt8jv35c2MXMIVNTNyaJPJaiL0uYAb3RCtjSAQ8k1S-PqCgeVAuJWotZ9tMVDA0eDdyGLcUQmnElnHByI9Leq/s320/sql+top+clause3.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="MsoNormal"&gt;
&lt;m:smallfrac m:val="off"&gt;
   &lt;m:dispdef&gt;
   &lt;m:lmargin m:val="0"&gt;
   &lt;m:rmargin m:val="0"&gt;
   &lt;m:defjc m:val="centerGroup"&gt;
   &lt;m:wrapindent m:val="1440"&gt;
   &lt;m:intlim m:val="subSup"&gt;
   &lt;m:narylim m:val="undOvr"&gt;
  &lt;/m:narylim&gt;&lt;/m:intlim&gt;
&lt;/m:wrapindent&gt;

&lt;/m:defjc&gt;&lt;/m:rmargin&gt;&lt;/m:lmargin&gt;&lt;/m:dispdef&gt;&lt;/m:smallfrac&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Note:&lt;/b&gt; Not all database systems support the TOP clause.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;m:smallfrac m:val="off"&gt;
   &lt;m:dispdef&gt;
   &lt;m:lmargin m:val="0"&gt;
   &lt;m:rmargin m:val="0"&gt;
   &lt;m:defjc m:val="centerGroup"&gt;
   &lt;m:wrapindent m:val="1440"&gt;
   &lt;m:intlim m:val="subSup"&gt;
   &lt;m:narylim m:val="undOvr"&gt;
  &lt;/m:narylim&gt;&lt;/m:intlim&gt;
&lt;/m:wrapindent&gt;

&lt;/m:defjc&gt;&lt;/m:rmargin&gt;&lt;/m:lmargin&gt;&lt;/m:dispdef&gt;&lt;/m:smallfrac&gt;</description><link>http://sqlserver-guide.blogspot.com/2012/03/sql-top-clause.html</link><author>noreply@blogger.com (Anonymous)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIg2LiEOUK49vdKUEvMyT9pkKW1INM4YXIARu2XvU5VNM0IO88oohLHMtYNdc6lnDpXTAf_p8LPzARG69jd_B_53AByxtdhUyG1768RPGqDYHvf287GyzeYlN8zMducA_kqVTcB5jgOIB1/s72-c/sql+top+clause.png" width="72"/></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1799474711497514132.post-2670983002031862736</guid><pubDate>Sat, 22 Jan 2011 04:36:00 +0000</pubDate><atom:updated>2011-02-16T08:58:37.493-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Integration Services</category><title>Integration Services</title><description>SQL Server Integration Services (SSIS) is Microsoft’s new enterprise class data Extract, Transform, and Load (ETL) tool. SSIS is a completely new product built from the ashes of SQL Server 2000’s Data Transformation Services (DTS). SSIS offers a much richer feature set and the ability to create much more powerful and flexible data transformations than its predecessor. &lt;br /&gt;
&lt;br /&gt;
This huge improvement, however, is not without a cost. SSIS is a fairly complex tool and offers a completely different design paradigm than DTS. Database administrators adept at the former tool are very often intimidated and frustrated by the new SSIS. Their biggest mistake is in thinking that Integration Services would just be an upgrade of Data Transformation Services.</description><link>http://sqlserver-guide.blogspot.com/2011/01/integration-services.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1799474711497514132.post-878297166920096230</guid><pubDate>Sat, 22 Jan 2011 04:35:00 +0000</pubDate><atom:updated>2011-01-21T20:35:36.180-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Reporting Services</category><title>Reporting Services</title><description>Reporting Services is a Web service–based solution for designing, deploying, and managing flexible, dynamic Web-based reports, as well as traditional paper reports. These reports can contain information from virtually any data source. &lt;br /&gt;
&lt;br /&gt;
Because Reporting Services is implemented as a Web service, it must be installed on a server with Internet Information Services (IIS). However, IIS does not have to be installed on a SQL Server. The Reporting Services databases are hosted on SQL Server 2008, but the Web service itself can be configured on a separate server.</description><link>http://sqlserver-guide.blogspot.com/2011/01/reporting-services.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1799474711497514132.post-8080475433241382721</guid><pubDate>Sat, 22 Jan 2011 04:35:00 +0000</pubDate><atom:updated>2011-01-21T20:35:10.082-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Analysis Services</category><title>Analysis Services</title><description>Analysis Services delivers Online Analytical Processing (OLAP) and Data Mining functionality for business intelligence applications. As its name suggests, Analysis Services provides a very robust environment for the detailed analysis of data. &lt;br /&gt;
&lt;br /&gt;
It does this through user-created, multidimensional data structures that contain de-normalized and aggregated data from diverse data sources (such as relational databases, spreadsheets, flat files, and even other multidimensional sources).</description><link>http://sqlserver-guide.blogspot.com/2011/01/analysis-services.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1799474711497514132.post-5671852991504192085</guid><pubDate>Thu, 13 Jan 2011 13:06:00 +0000</pubDate><atom:updated>2011-01-13T05:06:09.819-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Database Engine</category><category domain="http://www.blogger.com/atom/ns#">SQL Server 2008</category><title>SQL Server 2008’s Database Engine</title><description>The Database Engine is the primary component of SQL Server 2008. It is the Online Transaction Processing (OLTP) engine for SQL Server, and has been improved and enhanced tremendously in this version. The Database Engine is a high-performance component responsible for the efficient storage, retrieval, and manipulation of relational and Extensible Markup Language (XML) formatted data.&lt;br /&gt;
&lt;br /&gt;
SQL Server 2008’s Database Engine is highly optimized for transaction processing, but offers exceptional performance in complex data retrieval operations. The Database Engine is also responsible for the controlled access and modification of data through its security subsystem. SQL Server 2008’s Database Engine has many major improvements to support scalability, availability, and advanced (and secure) programming objects.</description><link>http://sqlserver-guide.blogspot.com/2011/01/sql-server-2008s-database-engine.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1799474711497514132.post-881611875060848175</guid><pubDate>Thu, 13 Jan 2011 13:05:00 +0000</pubDate><atom:updated>2011-01-13T05:05:00.769-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">database</category><category domain="http://www.blogger.com/atom/ns#">Microsoft SQL Server</category><category domain="http://www.blogger.com/atom/ns#">RDBMS</category><category domain="http://www.blogger.com/atom/ns#">SQL</category><category domain="http://www.blogger.com/atom/ns#">SQL Server 2008</category><title>What is SQL Server 2008/RDBMS?</title><description>&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:WordDocument&gt;   &lt;w:View&gt;Normal&lt;/w:View&gt;   &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:TrackMoves/&gt;   &lt;w:TrackFormatting/&gt;   &lt;w:PunctuationKerning/&gt;   &lt;w:ValidateAgainstSchemas/&gt;   &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:DoNotPromoteQF/&gt;   &lt;w:LidThemeOther&gt;EN-US&lt;/w:LidThemeOther&gt;   &lt;w:LidThemeAsian&gt;X-NONE&lt;/w:LidThemeAsian&gt;   &lt;w:LidThemeComplexScript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;   &lt;w:Compatibility&gt;    &lt;w:BreakWrappedTables/&gt;    &lt;w:SnapToGridInCell/&gt;    &lt;w:WrapTextWithPunct/&gt;    &lt;w:UseAsianBreakRules/&gt;    &lt;w:DontGrowAutofit/&gt;    &lt;w:SplitPgBreakAndParaMark/&gt;    &lt;w:DontVertAlignCellWithSp/&gt;    &lt;w:DontBreakConstrainedForcedTables/&gt;    &lt;w:DontVertAlignInTxbx/&gt;    &lt;w:Word11KerningPairs/&gt;    &lt;w:CachedColBalance/&gt;   &lt;/w:Compatibility&gt;   &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;   &lt;m:mathPr&gt;    &lt;m:mathFont m:val="Cambria Math"/&gt;    &lt;m:brkBin m:val="before"/&gt;    &lt;m:brkBinSub m:val="--&gt;    &lt;m:smallfrac m:val="off"&gt;    &lt;m:dispdef&gt;    &lt;m:lmargin m:val="0"&gt;    &lt;m:rmargin m:val="0"&gt;    &lt;m:defjc m:val="centerGroup"&gt;    &lt;m:wrapindent m:val="1440"&gt;    &lt;m:intlim m:val="subSup"&gt;    &lt;m:narylim m:val="undOvr"&gt;   &lt;/m:narylim&gt;&lt;/m:intlim&gt; &lt;/m:wrapindent&gt;&lt;!--[endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
  DefSemiHidden="true" DefQFormat="false" DefPriority="99"
  LatentStyleCount="267"&gt;   &lt;w:LsdException Locked="false" Priority="0" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Normal"/&gt;   &lt;w:LsdException Locked="false" Priority="9" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="heading 1"/&gt;   &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/&gt;   &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/&gt;   &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/&gt;   &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/&gt;   &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/&gt;   &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/&gt;   &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/&gt;   &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/&gt;   &lt;w:LsdException Locked="false" Priority="39" Name="toc 1"/&gt;   &lt;w:LsdException Locked="false" Priority="39" Name="toc 2"/&gt;   &lt;w:LsdException Locked="false" Priority="39" Name="toc 3"/&gt;   &lt;w:LsdException Locked="false" Priority="39" Name="toc 4"/&gt;   &lt;w:LsdException Locked="false" Priority="39" Name="toc 5"/&gt;   &lt;w:LsdException Locked="false" Priority="39" Name="toc 6"/&gt;   &lt;w:LsdException Locked="false" Priority="39" Name="toc 7"/&gt;   &lt;w:LsdException Locked="false" Priority="39" Name="toc 8"/&gt;   &lt;w:LsdException Locked="false" Priority="39" Name="toc 9"/&gt;   &lt;w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/&gt;   &lt;w:LsdException Locked="false" Priority="10" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Title"/&gt;   &lt;w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/&gt;   &lt;w:LsdException Locked="false" Priority="11" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/&gt;   &lt;w:LsdException Locked="false" Priority="22" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Strong"/&gt;   &lt;w:LsdException Locked="false" Priority="20" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/&gt;   &lt;w:LsdException Locked="false" Priority="59" SemiHidden="false"
   UnhideWhenUsed="false" Name="Table Grid"/&gt;   &lt;w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/&gt;   &lt;w:LsdException Locked="false" Priority="1" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/&gt;   &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading"/&gt;   &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List"/&gt;   &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid"/&gt;   &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1"/&gt;   &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2"/&gt;   &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1"/&gt;   &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2"/&gt;   &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1"/&gt;   &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2"/&gt;   &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3"/&gt;   &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List"/&gt;   &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading"/&gt;   &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List"/&gt;   &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid"/&gt;   &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 1"/&gt;   &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 1"/&gt;   &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 1"/&gt;   &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/&gt;   &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/&gt;   &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/&gt;   &lt;w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/&gt;   &lt;w:LsdException Locked="false" Priority="34" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/&gt;   &lt;w:LsdException Locked="false" Priority="29" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Quote"/&gt;   &lt;w:LsdException Locked="false" Priority="30" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/&gt;   &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/&gt;   &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/&gt;   &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/&gt;   &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/&gt;   &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 1"/&gt;   &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/&gt;   &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 1"/&gt;   &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/&gt;   &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 2"/&gt;   &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 2"/&gt;   &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 2"/&gt;   &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/&gt;   &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/&gt;   &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/&gt;   &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/&gt;   &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/&gt;   &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/&gt;   &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/&gt;   &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 2"/&gt;   &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/&gt;   &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 2"/&gt;   &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/&gt;   &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 3"/&gt;   &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 3"/&gt;   &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 3"/&gt;   &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/&gt;   &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/&gt;   &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/&gt;   &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/&gt;   &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/&gt;   &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/&gt;   &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/&gt;   &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 3"/&gt;   &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/&gt;   &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 3"/&gt;   &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/&gt;   &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 4"/&gt;   &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 4"/&gt;   &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 4"/&gt;   &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/&gt;   &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/&gt;   &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/&gt;   &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/&gt;   &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/&gt;   &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/&gt;   &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/&gt;   &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 4"/&gt;   &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/&gt;   &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 4"/&gt;   &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/&gt;   &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 5"/&gt;   &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 5"/&gt;   &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 5"/&gt;   &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/&gt;   &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/&gt;   &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/&gt;   &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/&gt;   &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/&gt;   &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/&gt;   &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/&gt;   &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 5"/&gt;   &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/&gt;   &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 5"/&gt;   &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/&gt;   &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 6"/&gt;   &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 6"/&gt;   &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 6"/&gt;   &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/&gt;   &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/&gt;   &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/&gt;   &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/&gt;   &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/&gt;   &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/&gt;   &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/&gt;   &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 6"/&gt;   &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/&gt;   &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 6"/&gt;   &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/&gt;   &lt;w:LsdException Locked="false" Priority="19" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/&gt;   &lt;w:LsdException Locked="false" Priority="21" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/&gt;   &lt;w:LsdException Locked="false" Priority="31" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/&gt;   &lt;w:LsdException Locked="false" Priority="32" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/&gt;   &lt;w:LsdException Locked="false" Priority="33" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Book Title"/&gt;   &lt;w:LsdException Locked="false" Priority="37" Name="Bibliography"/&gt;   &lt;w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:"Table Normal";
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-priority:99;
 mso-style-qformat:yes;
 mso-style-parent:"";
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:11.0pt;
 font-family:"Calibri","sans-serif";
 mso-ascii-font-family:Calibri;
 mso-ascii-theme-font:minor-latin;
 mso-fareast-font-family:"Times New Roman";
 mso-fareast-theme-font:minor-fareast;
 mso-hansi-font-family:Calibri;
 mso-hansi-theme-font:minor-latin;
 mso-bidi-font-family:"Times New Roman";
 mso-bidi-theme-font:minor-bidi;}
&lt;/style&gt; &lt;![endif]--&gt;  &lt;/m:defjc&gt;&lt;/m:rmargin&gt;&lt;/m:lmargin&gt;&lt;/m:dispdef&gt;&lt;/m:smallfrac&gt;&lt;br /&gt;
&lt;div class="first-para"&gt;&lt;span style="font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;"&gt;As you most likely know, SQL Server 2008 is primarily thought of as a &lt;i&gt;Relational Database&lt;/i&gt; &lt;i&gt;Management System&lt;/i&gt; (&lt;i&gt;RDBMS&lt;/i&gt;). It is certainly that, but it is also much more.&lt;/span&gt;&lt;/div&gt;&lt;div class="first-para"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="para"&gt;&lt;span style="font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;"&gt;SQL Server 2008 can be more accurately described as an &lt;i&gt;Enterprise Data Platform&lt;/i&gt;. It offers many new features and even more enhanced or improved features from previous editions of the product. In addition to traditional RDBMS duty, SQL Server 2008 also provides rich reporting capabilities, powerful data analysis, and data mining, as well as features that support asynchronous data applications, data-driven event notification, and more.&lt;/span&gt;&lt;/div&gt;</description><link>http://sqlserver-guide.blogspot.com/2011/01/what-is-sql-server-2008rdbms.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1799474711497514132.post-7040471915105717869</guid><pubDate>Mon, 02 Aug 2010 08:32:00 +0000</pubDate><atom:updated>2010-08-02T01:32:04.683-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">SQL Server Security</category><title>SQL Server Security</title><description>&lt;span id="articlebody"&gt;There are several levels of security to SQL  Server. At the a base level, in order to be granted get access to a SQL  Server, a user is required to have a login account.&lt;br /&gt;
&lt;br /&gt;
There are two modes of security to SQL Server, distinguished by which  program provides the authentication. NT Authentication provides that  Windows NT (and/or its successors) verify verifies the identity of a  user logging in. In this mode, the SQL Server will ‘trust' that Windows  NT has verified that the user is who he says he is. The second method,  SQL Server authentication, it is SQL: Server that authenticates the  identity of the user. SQL Server authentication is typically used for  internet Internet connections, since not all internet Internet users  have Windows NT, and not all NT domains are trusted.&lt;br /&gt;
&lt;br /&gt;
In addition to identifying users, it is sometimes convenient to  define roles at the server level. Since within an organization, there  are groups of users with similar access needs and levels, it may be  convenient to define roles with specific levels of permissions. Once you  have defined a role, you can assign users to that role, and those users  inherit all of the privileges assigned to the role.&lt;br /&gt;
&lt;br /&gt;
There are two types of permissions assigned to individual users and  roles. Statement permissions confer the right to execute certain types  of T-SQL commands. Object permissions confer the right to access  database objects directly.&lt;br /&gt;
&lt;br /&gt;
Defining Logins Users, and Roles&lt;br /&gt;
&lt;br /&gt;
Logins can be added either through the Database Properties Window  (under Logins), or by invoking system stored procedures with appropriate  parameters. The command&lt;br /&gt;
sp_addlogin loginname, password, databasename&lt;br /&gt;
will add a SQL Server authenticated login to the list;&lt;br /&gt;
sp_grantlogin ‘domainname/username'&lt;br /&gt;
&lt;br /&gt;
will add an NT authenticated login to the list.&lt;br /&gt;
&lt;br /&gt;
After the login has been allowed, you need to allow the user access  to the database. This is done either through the Database Properties  Window (under Users for that particular database) or with the command&lt;br /&gt;
sp_grantdbaccess loginname.&lt;br /&gt;
&lt;br /&gt;
You can see the list of users using the command sp_helpuser or sp_helpuser username&lt;br /&gt;
&lt;br /&gt;
To cancel a security account for a given database, use sp_revokedbaccess username&lt;br /&gt;
&lt;br /&gt;
To remove an NT Login use sp_revokelogin ‘username' (note no domain),  and to srop stop a SQL Server authenticated login, use sp_droplogin  username .&lt;br /&gt;
&lt;br /&gt;
To add a role to a database, use sp_addrole ‘clerical', and to add  meAugust 16, 2005er ‘clerical', ‘username'. To delete a rolemember use  sp_droprolemember username.&lt;br /&gt;
&lt;br /&gt;
At the SQL Server level the rolenames are fixed, and cannot be  changed, but users can be added using sp_addsrvrolemember username,  dbcreator . To drop a rolmember, use sp_dropsrvmember username .&lt;br /&gt;
&lt;br /&gt;
Granting permissions&lt;br /&gt;
&lt;br /&gt;
The GRANT command is used to assign permissions to a security  account. Statement permissions in this way: GRANT right TO username&lt;br /&gt;
&lt;br /&gt;
where right can be any of the following:&lt;br /&gt;
CREATE DATABASE&lt;br /&gt;
CREATE DEFAULT&lt;br /&gt;
CREATE PROCEDURE&lt;br /&gt;
CREATE RULE&lt;br /&gt;
CREATE TABLE&lt;br /&gt;
CREATE VIEW&lt;br /&gt;
DUMP DATABASE&lt;br /&gt;
DUMP TRANSACTION&lt;br /&gt;
&lt;br /&gt;
For object permissions, GRANT is also the command to use, but the grammar differs slightly:&lt;br /&gt;
GRANT action ON table/view/procedure name TO username&lt;br /&gt;
&lt;br /&gt;
where action can be one of the following:&lt;br /&gt;
INSERT, DELETE, EXECUTE, SELECT or UPDATE&lt;br /&gt;
&lt;br /&gt;
One can also apply these this permission to groups or roles as well  as usernames. And it is also possible that a role can have a permission,  but a member of that role be denied permission for a task. See the next  discussion.&lt;br /&gt;
&lt;br /&gt;
In all of the above commands, you can also explicitly deny permission  using DENY in place of GRANT.&lt;br /&gt;
&lt;br /&gt;
Note however that DENY is not the  negation of GRANT . DENY explicitly excludes the user from that  capability. The REVOKE command is used to remove both the permission and  refusal.&lt;br /&gt;
Resources&lt;br /&gt;
&lt;br /&gt;
• Article: How To Identify Your SQL Server Service Pack Version and Edition&lt;br /&gt;
This is an insightful article that discusses about SQL server pack version and edition.&lt;br /&gt;
• Tutorial: Using Access or SQL Server to Write your ASP Code&lt;br /&gt;
This tutorial discusses how SQL server can be used to write the ASP code.&lt;/span&gt;</description><link>http://sqlserver-guide.blogspot.com/2010/08/sql-server-security.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1799474711497514132.post-2581289285393711912</guid><pubDate>Mon, 26 Jul 2010 04:51:00 +0000</pubDate><atom:updated>2010-07-25T21:51:32.143-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">database</category><category domain="http://www.blogger.com/atom/ns#">Microsoft</category><category domain="http://www.blogger.com/atom/ns#">Microsoft SQL Server</category><category domain="http://www.blogger.com/atom/ns#">opensource</category><title>Top 7 Free Open Source Database Server</title><description>Open Source Server based database management systems have become a common choice for organizations over the stand alone desktop databases. The server based databases or RDBMS such as MySQL, PostgreSQL, Microsoft SQL Server are designed to be used on servers and it can be easily shared by multiple users. &lt;br /&gt;
&lt;br /&gt;
Most evidently, server-based DBMS are used in nonprofit sector for Web-based databases. Some of these organizations use server based DBMS for their interactive Websites, providing content and data to their sites. Server-based DBMS also hold a purpose to underlie large shared databases, such as financial packages and client management databases.&lt;br /&gt;
&lt;br /&gt;
Now for those using Access in their organization may set up a Linux-based database and use an ODBC (Open Data Base Connectivity) connection between the desktop Access databases and the server database. This would imply that Access is used on the front end and make the back-end more robust and secure with server based database. After an extensive research we sorted out the top 7 Open Source Server based database management systems, have a look.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;1. MySQL&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
For a web based use MySQL is the top choice, as it is the most often the only DBMS available in virtual hosting accounts. It runs on several platforms. It allows users to download the server and client software as well as a MySQL ODBC diver and a bunch of other MySQL tools from this page. MySQL is simpler and smaller, and therefore generally faster than other databases servers.&lt;br /&gt;
&lt;br /&gt;
&lt;a bitly="BITLY_PROCESSED" href="http://dev.mysql.com/downloads/"&gt;Link&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;2. PostgreSQL&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
PostgreSQL is an Open Source server-based database management system that runs well on UNIX based systems such as Linux. It is much more robust, scalable, and standards compliant than MySQL, and it can handle multiple transactions easily. However, the Postgres Plus Standard Server supports the most popular environments, including Linux 32, Linux 64, Windows, and Mac OS X.&lt;br /&gt;
&lt;br /&gt;
&lt;a bitly="BITLY_PROCESSED" href="http://www.postgresql.org/"&gt;Link&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;3. Firebird&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
This is an Open Source relational database offering many ANSI SQL-92 features that runs on Linux, Windows, and several Unix platforms. It features high SQL compliance, stored procedure and other advanceddatabase features.&lt;br /&gt;
&lt;br /&gt;
&lt;a bitly="BITLY_PROCESSED" href="http://www.firebirdsql.org/"&gt;Link&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;4. GNU SQL Server&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
SQL Server is a free portable multi-user relational database management system. GNU SQL Server supports the SQL89 dialect and some extensions from SQL92. It offers multiuser access and transaction based on predictive locks. Thedatabase system runs smoothly in UNIX OS and its working language is based on C.  Moreover, it also uses RPC, shared memory and message queues.&lt;br /&gt;
&lt;br /&gt;
&lt;a bitly="BITLY_PROCESSED" href="http://panda.ispras.ru/%7Egsql/"&gt;Link&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;5. SAP MaxDB&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
It is one of the popular open source database management system developed and supported by SAP AG. It runs on Microsoft Windows, Linux and Unix, and for the other prominent hardware platforms. For those organizations undergoing SAP implementation MaxDB ensure that yourdatabase migration goes smoothly.&lt;br /&gt;
&lt;br /&gt;
&lt;a bitly="BITLY_PROCESSED" href="http://maxdb.sap.com/"&gt;Link&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;6. ScimoreDB&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
It is a free distributed RDBMS designed for high load OLTP and Terabyte OLAP warehouses. The server is build to take advantage of parallelization over multipleservers. It helps to achieve a near linear scalability for OLTP applications. It can support up to 512 PC's in a single database cluster.&lt;br /&gt;
&lt;br /&gt;
&lt;a bitly="BITLY_PROCESSED" href="http://www.scimore.com/"&gt;Link&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
7. DXstore database system&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
This is a database management system designed for Linux, FreeBSD, and other operating systems. The database system is distributed in embeddable C or C++ library and shares with them the model of a database as a collection of key/value pairs. It has an entirely new design and implementation. Moreover its functionality has been extended.&lt;br /&gt;
&lt;br /&gt;
&lt;a bitly="BITLY_PROCESSED" href="http://www.dss.bc.ca/dx/"&gt;Link&lt;/a&gt;&lt;br /&gt;
&lt;div class="zemanta-pixie" style="height: 15px; margin-top: 10px;"&gt;&lt;a bitly="BITLY_PROCESSED" class="zemanta-pixie-a" href="http://www.zemanta.com/" title="Enhanced by Zemanta"&gt;&lt;img alt="Enhanced by Zemanta" class="zemanta-pixie-img" src="http://img.zemanta.com/zemified_e.png?x-id=e2f98512-782a-48a7-b8ca-8d5e6a168639" style="border: medium none; float: right;" /&gt;&lt;/a&gt;&lt;span class="zem-script more-related pretty-attribution"&gt;&lt;script defer="defer" src="http://static.zemanta.com/readside/loader.js" type="text/javascript"&gt;
&lt;/script&gt;&lt;/span&gt;&lt;/div&gt;</description><link>http://sqlserver-guide.blogspot.com/2010/07/top-7-free-open-source-database-server.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1799474711497514132.post-7588229285906143468</guid><pubDate>Mon, 26 Jul 2010 04:20:00 +0000</pubDate><atom:updated>2010-07-25T21:21:24.174-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">database</category><category domain="http://www.blogger.com/atom/ns#">Operating system</category><category domain="http://www.blogger.com/atom/ns#">PostgreSQL</category><category domain="http://www.blogger.com/atom/ns#">Programming</category><category domain="http://www.blogger.com/atom/ns#">SQL</category><title>Top 10 PostgreSQL Performance Optimization Tips</title><description>PostgreSQL performance optimization is a widely discussed issue on the most forums. Although PostgreSQL is shipped with a solid default configuration aimed to fit most setups, it requires fair amount of performance optimization to offer the best. There are basically two major aspects of PostgreSQL database performance optimization. &lt;br /&gt;
&lt;br /&gt;
This involves enhancing the use of the hardware and configuration setting, and optimizing the performance queries sent to database. Well, it's not possible for the PostgreSQL developers to tune the default configuration for everyone. We prepared a list of top 10 PostgreSQL performance optimization tips that combines both the above aspects.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;1. Hardware and Configuration changes&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
When you are running queries you need to look at how much your CPU and memory is being taxed. To increase the speed and memory run postmaster with various flags to increase the speed and memory. Having said so much, it needs to be added that if your query plan is not feasible the hardware and configuration has nothing to do with it.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;2. Choosing the file system&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
If you are using an Operating System like Linux that has multiple file system, choose the one that will be the best from the performance point of view.  There no single opinion among PostgreSQL users about which file system is best.&lt;br /&gt;
&lt;br /&gt;
There are diverse opinion over Ext2, Ext3, ReiserFS, and XFS. Although Ext2 is said to be faster on some setups the recovery issues are a major concern. Essentially the benchmark would be a combination of file system, disk/array configuration, OS version, and database table size and distribution.&lt;br /&gt;
&lt;br /&gt;
Overtly, you must stick to the file system that is best supported by your distribution, like for instance Ext3 for Red Hat Linux, ReiserFS for SuSE Linux and don't forget XFS known for it's large file support.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;3. Magic Block&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
In order to ensure that a dynamically loaded object file is not loaded into an incompatible server, PostgreSQL whether that file includes a magic block with the appropriate contents. It allows the server to identify the incompatibilities like the code compiled for a different major version of PostgreSQL. In PostgreSQL versions like 8.2 you need to include the magic block. In order to include the magic block you need to write this in one of the module source files. Before that include the header&lt;br /&gt;
&lt;br /&gt;
fmgr.h:&lt;br /&gt;
&lt;br /&gt;
#ifdef PG_MODULE_MAGIC&lt;br /&gt;
PG_MODULE_MAGIC;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
Note: The #ifdef test can be removed if the code doesn't need to compile against pre-8.2 PostgreSQL releases.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;4. Try the Auto Vacumm daemon&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
PostgreSQL databases need periodic maintenance known as vacuuming. In the PostgreSQL 8.1  and versions above there is a separate optional server process called the auto vacuum deamon. It's automates the the execution of vacuum and analyze commands. When the auto vacuum daemon is enabled, it runs periodically and checks for tables that have had a large number of updated, inserted or deleted tuples. To use the autovacuum daemon stats_start_collector and stats_row_level should be set to true, as it checks the use of row-level statistics collection facility.  Further, when choosing the value of superuser_reserved_connections the user must allow a slot for auto vacuum process.&lt;br /&gt;
&lt;br /&gt;
Basically the process will vacuum the database when needed. This would allow not require the you to change the corn setting for vacuum frequency. Overall, it would result in better database performance by eliminating overdue vacuum issues.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;5. Partial Indices&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
In order to force use an index you need to employ the true partial index. You can assume that table2 below has no rows where field2=0. To store the clause field2&amp;lt;&amp;gt;0 in pg-index you can use the actions below. When you see the predicate it always uses the partial index. In this case, it is used as a full index to trick it.&lt;br /&gt;
&lt;br /&gt;
create index i on table2(field2) where field2 &amp;lt;&amp;gt; 0;&lt;br /&gt;
&lt;br /&gt;
select * from table2 where field2&amp;lt;&amp;gt;0;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;6. External programs&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
To improve the performance of queries in Postgresql you need to break out a query into a series of small, explicit nested loops in a C, Perl, or other client program. This would actually improve the performance, especially if you require a subset or results/tables.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;7. Monitor Query Progress&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
When doing with long queries you must be looking to monitor the progress of queries. There is an easy trick by Alan Williams that allows you to monitor the progress of long running queries. Just add to the query a sequence - (select nextval('sq_test'),…) and then use the currval('sq_test') to watch how far the query has progressed.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;8. Sort memory&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
In case you have queries with order-by or group-by clauses that requires sorting large data set increasing the sort memory can help. Using this parameter you can set maximum limits on the memory that a database connection can use to perform sorts. However, its important to take into account that this parameter is per sort, per connection. Especially, database with many users must consider the shortcomings before setting the parameter. The best approach would be to set this parameter per connection as and when required. it would be low for the simple queries and higher for the large, complex queries and data dumps.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;9. Stored Procedures&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
To control the query execution more explicitly you need to write a stored procedure. What you need to do is break out SQL into small cursors instead of a single large cursor. You might run up against the same problem.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;10. Views&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Adding a step to the query planner might impact the query speed according to the views. However, adding more clauses to the view should be avoided as it may affect the query plan in a bad way.  More queries make it confusing for the user.&lt;br /&gt;
&lt;div class="zemanta-pixie" style="height: 15px; margin-top: 10px;"&gt;&lt;a bitly="BITLY_PROCESSED" class="zemanta-pixie-a" href="http://www.zemanta.com/" title="Enhanced by Zemanta"&gt;&lt;img alt="Enhanced by Zemanta" class="zemanta-pixie-img" src="http://img.zemanta.com/zemified_e.png?x-id=a6dad8f0-afb0-453a-9d24-79a5bd4662d4" style="border: medium none; float: right;" /&gt;&lt;/a&gt;&lt;span class="zem-script more-related pretty-attribution"&gt;&lt;script defer="defer" src="http://static.zemanta.com/readside/loader.js" type="text/javascript"&gt;
&lt;/script&gt;&lt;/span&gt;&lt;/div&gt;</description><link>http://sqlserver-guide.blogspot.com/2010/07/top-10-postgresql-performance.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1799474711497514132.post-3227269087768495333</guid><pubDate>Thu, 22 Jul 2010 08:34:00 +0000</pubDate><atom:updated>2010-07-22T01:35:07.521-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">database</category><category domain="http://www.blogger.com/atom/ns#">mysql</category><category domain="http://www.blogger.com/atom/ns#">PHP</category><category domain="http://www.blogger.com/atom/ns#">SQL</category><title>How To Process MySQL Timestamp in PHP</title><description>Many of us do not realize that MySQL's Timestamp is not the timestamp which PHP date() understands. In fact if you try to use MySQL timestamp directly in php date() function then you will get totally wrong dates. There is a simple way to use MySQL timestamp data in php.&lt;br /&gt;
&lt;br /&gt;
First you need to modify the SQL query to use MySQL's UNIX_TIMESTAMP() function. So if your SQL looks like:&lt;br /&gt;
SELECT author, `when` …&lt;br /&gt;
&lt;br /&gt;
then convert it to:&lt;br /&gt;
SELECT author, UNIX_TIMESTAMP(`when`) …&lt;br /&gt;
&lt;br /&gt;
Then use PHP's date() function to convert the unix timestamp to appropriate display format like this:&lt;br /&gt;
date("F j, Y, g:i a", $row[1])&lt;br /&gt;
&lt;br /&gt;
where $row[1] contains the timestamp column value. &lt;br /&gt;
&lt;div class="zemanta-pixie" style="height: 15px; margin-top: 10px;"&gt;&lt;a bitly="BITLY_PROCESSED" class="zemanta-pixie-a" href="http://www.zemanta.com/" title="Enhanced by Zemanta"&gt;&lt;img alt="Enhanced by Zemanta" class="zemanta-pixie-img" src="http://img.zemanta.com/zemified_e.png?x-id=8714d94b-9bda-44bb-8fff-e578c6916717" style="border: medium none; float: right;" /&gt;&lt;/a&gt;&lt;span class="zem-script more-related pretty-attribution"&gt;&lt;script defer="defer" src="http://static.zemanta.com/readside/loader.js" type="text/javascript"&gt;
&lt;/script&gt;&lt;/span&gt;&lt;/div&gt;</description><link>http://sqlserver-guide.blogspot.com/2010/07/how-to-process-mysql-timestamp-in-php.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1799474711497514132.post-7788209913552658529</guid><pubDate>Wed, 14 Jul 2010 07:30:00 +0000</pubDate><atom:updated>2010-07-14T00:30:00.077-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">database</category><category domain="http://www.blogger.com/atom/ns#">Exception handling</category><category domain="http://www.blogger.com/atom/ns#">mysql</category><category domain="http://www.blogger.com/atom/ns#">SQL</category><category domain="http://www.blogger.com/atom/ns#">Stored Procedure</category><title>MySQL 5.5 Milestone 2 improves replication and stored procedures</title><description>The &lt;a bitly="BITLY_PROCESSED" class="zem_slink" href="http://www.mysql.com/" rel="homepage nofollow" title="MySQL"&gt;MySQL&lt;/a&gt; developers have released milestone 2 of MySQL 5.5, on the path to a general release in mid-2010. The new milestone release incorporates semi-synchronous replication in MySQL 5.5 based on patches to InnoDB developed by Google. This is designed to ensure that when a change is committed in the master database, at least one slave has confirmed that the data has arrived and been buffered before the commit is complete.&lt;br /&gt;
&lt;br /&gt;
Developers of SQL procedures will find the addition of SQL standard exception handling, SIGNAL and RESIGNAL, should give them the ability to make stored procedures more robust and easier to debug.&lt;br /&gt;
&lt;br /&gt;
Partitioning, which allows data within a table to be distributed over a cluster, has also been enhanced. An improved partitioning syntax lifts previous restrictions of only partitioning based on one INTEGER column, and allows for data to be partitioned based on multiple columns with dates, datetime, strings and integers.&lt;br /&gt;
&lt;br /&gt;
An overview of the changes in MySQL is available &lt;a bitly="BITLY_PROCESSED" href="http://dev.mysql.com/doc/refman/5.5/en/mysql-nutshell.html"&gt;&lt;span style="color: blue;"&gt;online&lt;/span&gt;&lt;/a&gt; along with the &lt;a bitly="BITLY_PROCESSED" href="http://dev.mysql.com/doc/refman/5.5/en/news-5-5-0.html"&gt;&lt;span style="color: blue;"&gt;change notes&lt;/span&gt;&lt;/a&gt;. MySQL 5.5 Milestone 2 is &lt;a bitly="BITLY_PROCESSED" href="http://blogs.mysql.com/kaj/2009/12/15/mysql-550-m2-a-milestone-ready-to-download/"&gt;&lt;span style="color: blue;"&gt;described&lt;/span&gt;&lt;/a&gt; as "not production ready" but "suitable for testing and feedback". It can be &lt;a bitly="BITLY_PROCESSED" href="http://dev.mysql.com/downloads/"&gt;&lt;span style="color: blue;"&gt;downloaded&lt;/span&gt;&lt;/a&gt; from the MySQL download site.&lt;br /&gt;
&lt;br /&gt;
News source: &lt;a bitly="BITLY_PROCESSED" href="http://www.h-online.com/open/news/item/MySQL-5-5-Milestone-2-improves-replication-and-stored-procedures-886742.html"&gt;h-online.com&lt;/a&gt;&lt;br /&gt;
&lt;div class="zemanta-pixie" style="height: 15px; margin-top: 10px;"&gt;&lt;a bitly="BITLY_PROCESSED" class="zemanta-pixie-a" href="http://www.zemanta.com/" title="Enhanced by Zemanta"&gt;&lt;img alt="Enhanced by Zemanta" class="zemanta-pixie-img" src="http://img.zemanta.com/zemified_e.png?x-id=5bef6bbc-8c4d-413e-b439-e0d9fe57a9bc" style="border: medium none; float: right;" /&gt;&lt;/a&gt;&lt;span class="zem-script more-related pretty-attribution"&gt;&lt;script defer="defer" src="http://static.zemanta.com/readside/loader.js" type="text/javascript"&gt;
&lt;/script&gt;&lt;/span&gt;&lt;/div&gt;</description><link>http://sqlserver-guide.blogspot.com/2010/07/mysql-55-milestone-2-improves.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1799474711497514132.post-7606966678537682059</guid><pubDate>Tue, 13 Jul 2010 07:30:00 +0000</pubDate><atom:updated>2010-07-13T00:30:00.158-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">mysql</category><title>MariaDB 5.1.44b Released</title><description>MariaDB 5.1.44b Linux and Solaris binaries, Ubuntu/Debian/CentOS packages, and source are now available for &lt;a bitly="BITLY_PROCESSED" href="http://mariadb.org/download"&gt;download&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
This is a bugfix/security release of MariaDB 5.1.44.&lt;br /&gt;
&lt;br /&gt;
From the &lt;a bitly="BITLY_PROCESSED" href="http://askmonty.org/wiki/Manual:MariaDB_5.1.44b_Release_Notes"&gt;MariaDB 5.1.44b Release Notes&lt;/a&gt;:&lt;br /&gt;
&lt;br /&gt;
MariaDB 5.1.44b fixes a buffer overflow that might potentially allow an authenticated user to run arbitrary code inside the server. It also has a fix for MySQL Bug #53371: “Security hole with bypassing grants using special path in db/table names.” In all other respects, it is the same as MariaDB 5.1.44.&lt;br /&gt;
&lt;br /&gt;
See the &lt;a bitly="BITLY_PROCESSED" href="http://askmonty.org/wiki/Manual:MariaDB_5.1.44_Release_Notes"&gt;MariaDB 5.1.44 Release Notes&lt;/a&gt; for a summary of the differences between MariaDB 5.1.42 and MariaDB 5.1.44.&lt;br /&gt;
A Windows binary is coming soon.&lt;br /&gt;
&lt;br /&gt;
News source: &lt;a bitly="BITLY_PROCESSED" href="http://askmonty.org/blog/mariadb-5-1-44b-released/"&gt;askmonty.org/blog/mariadb-5-1-44b-released/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="zemanta-pixie" style="height: 15px; margin-top: 10px;"&gt;&lt;a bitly="BITLY_PROCESSED" class="zemanta-pixie-a" href="http://www.zemanta.com/" title="Enhanced by Zemanta"&gt;&lt;img alt="Enhanced by Zemanta" class="zemanta-pixie-img" src="http://img.zemanta.com/zemified_e.png?x-id=f82534c5-4bb9-4969-a37b-e0b38a076d9d" style="border: medium none; float: right;" /&gt;&lt;/a&gt;&lt;span class="zem-script more-related pretty-attribution"&gt;&lt;script defer="defer" src="http://static.zemanta.com/readside/loader.js" type="text/javascript"&gt;
&lt;/script&gt;&lt;/span&gt;&lt;/div&gt;</description><link>http://sqlserver-guide.blogspot.com/2010/07/mariadb-5144b-released.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1799474711497514132.post-2817763540853507309</guid><pubDate>Mon, 12 Jul 2010 07:30:00 +0000</pubDate><atom:updated>2010-07-12T00:30:00.338-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ASP.NET</category><category domain="http://www.blogger.com/atom/ns#">sql database</category><title>Microsoft links free SQL database with ASP .Net</title><description>&lt;img align="absmiddle" class="ife_marker" id="null_ife_marker_1" src="chrome://informenter/skin/marker.png" style="border: 0pt none; cursor: pointer; height: 19px; width: 14px;" title="Max field length is unknown" /&gt;&lt;img align="absmiddle" class="ife_marker" id="null_ife_marker_2" src="chrome://informenter/skin/marker.png" style="border: 0pt none; cursor: pointer; height: 19px; width: 14px;" title="Max field length is unknown" /&gt;&lt;img align="absmiddle" class="ife_marker" id="null_ife_marker_3" src="chrome://informenter/skin/marker.png" style="border: 0pt none; cursor: pointer; height: 19px; width: 14px;" title="Max field length is unknown" /&gt;Microsoft is enabling its free SQL CE (SQL Server Compact Edition) database to work within ASP.Net Web applications, thus providing a lightweight database option for ASP.Net Web development, a Microsoft official said this week.&lt;br /&gt;
&lt;br /&gt;
ASP.Net is a Web framework. SQL CE is an embedded database engine enabling easy database storage, &lt;a bitly="BITLY_PROCESSED" href="http://weblogs.asp.net/scottgu/archive/2010/06/30/new-embedded-database-support-with-asp-net.aspx" target="_blank"&gt;&lt;span style="color: blue;"&gt;said Scott Guthrie, corporate vice president in the Microsoft Developer Division, in a blog post&lt;/span&gt;&lt;/a&gt; this week.&lt;br /&gt;
&lt;br /&gt;
"We will be releasing the first public beta of SQL CE Version 4 very shortly. Version 4 has been designed and tested to work within ASP.Net Web applications," Guthrie said.&lt;br /&gt;
&lt;br /&gt;
"Applications you build can redistribute SQL CE as part of them. Just copy your Web application onto any server, and it will work," said Guthrie.&lt;br /&gt;
&lt;br /&gt;
"SQL CE 4 provides an easy, lightweight database option that you'll now be able to use with ASP.Net applications.&amp;nbsp; It will enable you to get started on projects quickly -- without having to install a full database on your local development box," Guthrie said.&lt;br /&gt;
&lt;br /&gt;
SQL CE works with .Net-based data APIs and supports a query syntax similar to SQL Server. Developers can use existing data APIs, such as ADO.Net, as well as technologies like Entity Framework with SQL CE, Guthrie said.&lt;br /&gt;
&lt;br /&gt;
SQL CE's database engine runs in-memory within an application; when an application shuts down, the database is automatically unloaded, he said. Version 4 can run in "medium trust" ASP.Net 4 Web-hosting scenarios without a hoster needed to install anything.&lt;br /&gt;
&lt;br /&gt;
Visual Studio 2010 and Visual Web Developer 2010 Express will add SQL CE 4 tooling support for ASP.Net, in a planned update, Guthrie said.&lt;br /&gt;
&lt;br /&gt;
"SQL CE does not require you to run a setup or install a database server in order to use it. You can now simply copy the SQL CE binaries into the \bin directory of your ASP.Net application, and then your Web application can run and use it as a database engine," Guthrie said. "No setup or extra security permissions are required for it to run. You do not need to have an administrator account on the machine. It just works."&lt;br /&gt;
&lt;br /&gt;
News source: &lt;a bitly="BITLY_PROCESSED" href="http://www.infoworld.com/d/developer-world/microsoft-links-free-sql-database-asp-net-189"&gt;infoworld.com&lt;/a&gt;&lt;br /&gt;
&lt;img align="absmiddle" class="ife_marker" id="null_ife_marker_4" src="chrome://informenter/skin/marker.png" style="border: 0pt none; cursor: pointer; height: 19px; width: 14px;" title="Max field length is unknown" /&gt;&lt;br /&gt;
&lt;div class="zemanta-pixie" style="height: 15px; margin-top: 10px;"&gt;&lt;a bitly="BITLY_PROCESSED" class="zemanta-pixie-a" href="http://www.zemanta.com/" title="Enhanced by Zemanta"&gt;&lt;img alt="Enhanced by Zemanta" class="zemanta-pixie-img" src="http://img.zemanta.com/zemified_e.png?x-id=1089f77c-84b2-44ea-aecb-2b001b79a14c" style="border: medium none; float: right;" /&gt;&lt;/a&gt;&lt;span class="zem-script more-related pretty-attribution"&gt;&lt;script defer="defer" src="http://static.zemanta.com/readside/loader.js" type="text/javascript"&gt;
&lt;/script&gt;&lt;/span&gt;&lt;/div&gt;</description><link>http://sqlserver-guide.blogspot.com/2010/07/microsoft-links-free-sql-database-with.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1799474711497514132.post-5120814737204956464</guid><pubDate>Sun, 11 Jul 2010 07:30:00 +0000</pubDate><atom:updated>2010-07-11T00:30:00.863-07:00</atom:updated><title>Stored Procedures in MySQL 5.0</title><description>MySQL 5.0 introduced &lt;i&gt;Stored Procedures&lt;/i&gt; which allow us to automate or program our way out of many tasks on directly on the server rather than having to write external scripts to do complex manipulation of data.&lt;br /&gt;
&lt;br /&gt;
As you get used to writing stored Procedures in MySQL 5.0, you will, as with any other programming language, want to generalize your stored procedures as much as possible. The more flexible your stored procedure is, the more tasks it can be used for -- and the less places you have to go searching for that elusive bug that just keeps giving you the wrong result. The day you end up making a copy of a stored procedure just to change a name or two is the day you need to think how tweaking the original procedure can accomplish what you want without breaking old functionality.&lt;br /&gt;
&lt;br /&gt;
Most stored procedures that you will be writing for MySQL 5.0 will undoubtedly reference static table and column names. However, sometimes it is desirable to be able to pass these details to a stored procedure as parameters.&lt;br /&gt;
&lt;br /&gt;
There is no direct support for dynamic declaration of details such as column or table names in MySQLs stored procedures. However, by utilizing user variables (which have been around for a while) and prepared statements (introduced in MySQL 4.1), we can do some trickery to get the results we want.&lt;br /&gt;
&lt;br /&gt;
What follows is a step-by step guide to demonstrate how we can build a prepared statement in the command-line client, then use the ideas gathered from these examples and build a stored procedure which can manipulate data from any table and column that we specify. The samples are by nature simplistic, but you should quickly be able to gather how you can extend these to much more complex usage.&lt;br /&gt;
&lt;br /&gt;
The examples below are shown as you would type them into the command-line client, but the input prompts have been omitted for easy cut-and-paste.&lt;br /&gt;
&lt;br /&gt;
The base tables for the examples are those found it the world database, which you can download on the MySQL &lt;a bitly="BITLY_PROCESSED" href="http://dev.mysql.com/doc/"&gt;documentation page&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
In this article, we explore how to find the average of a given column in some table. For example, we might want to find the average life expectancy in all countries:&lt;br /&gt;
&lt;pre&gt;SELECT AVG(LifeExpectancy) FROM Country;
+---------------------+
| AVG(LifeExpectancy) |
+---------------------+
| 66.48604            |
+---------------------+&lt;/pre&gt;Another example is the average population of the cities defined in the world database:&lt;br /&gt;
&lt;pre&gt;SELECT AVG(Population) FROM City;
+-----------------+
| AVG(Population) |
+-----------------+
| 350468.2236     |
+-----------------+&lt;/pre&gt;The goal is to build a stored procedure that will take a table name and a column name and display the average of the values in the column, just as the two examples above.&lt;br /&gt;
&lt;br /&gt;
The first thing we need to understand is how user variables are used and assigned values. A user variable is distinguished by having a '@' symbol in front of it, and values are assigned using the SET statement:&lt;br /&gt;
&lt;pre&gt;SET @a := 'abc';
SELECT @a;
+------+
| @a   |
+------+
| abc  |
+------+&lt;/pre&gt;We can assign the value of any expression to a user variable, so the following also works:&lt;br /&gt;
&lt;pre&gt;SET @s := CONCAT('SELECT AVG(' , 'Population' , ') FROM ' , 'City');
SELECT @s;
+----------------------------------+
| @s                               |
+----------------------------------+
| SELECT AVG(Population) FROM City |
+----------------------------------+&lt;/pre&gt;...which is exactly one of the statements we'd like our stored procedure to build on-the-fly and execute.&lt;br /&gt;
Next in line to consider is prepared statements. Prepared statements are statements (such as queries) which are sent to the server, but the processing of the statement is halted as soon as the statement has been parsed, and the parsed statement is remembered by the server. We then have the option of telling the server to execute that statement one or more times as we wish.&lt;br /&gt;
&lt;br /&gt;
We can prepare a statement from within the command-line client, and we will do much the same later on in our stored procedure:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;PREPARE stmt FROM "SELECT AVG(Population) FROM City";
EXECUTE stmt;
+-----------------+
| AVG(Population) |
+-----------------+
| 350468.2236     |
+-----------------+&lt;/pre&gt;As you can see, we prepare the statement using a simple string expression. A statement can also be prepared from a user variable:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;PREPARE stmt FROM @s;
EXECUTE stmt;
+-----------------+
| AVG(Population) |
+-----------------+
| 350468.2236     |
+-----------------+&lt;/pre&gt;Note that a literal string expression or a user variable are the &lt;i&gt;only&lt;/i&gt; ways you can specify the statement to be prepared. You &lt;i&gt;cannot&lt;/i&gt; prepare a statement using an expression (which is also the reason why we're taking the seemingly roundabout way of using user variables to complete this task).&lt;br /&gt;
&lt;br /&gt;
We're now a the stage where we can build our stored procedure &lt;i&gt;colavg&lt;/i&gt; that will take a table and column name, and return the average of the values found in the column.&lt;br /&gt;
&lt;br /&gt;
The first thing we do is to change the command-line client's command delimiter, to ensure that we can use semicolons inside the stored procedure without the client regarding them as end-of-statement. If you're using another client, you should of course skip the delimiter commands.&lt;br /&gt;
&lt;br /&gt;
The input parameters are both of CHAR(64), which is the maximum size of these identifiers in MySQL. Since we are indeed reading from tables, we specify READS SQL DATA in the procedure declaration.&lt;br /&gt;
&lt;br /&gt;
Inside the procedure, we concatenate the two static parts of the SELECT statement with the parameter values col and tbl into the user variable @s (remember, we can't use expressions in PREPARE statements). Finally, we execute the statement which will return the result to our client.&lt;br /&gt;
&lt;br /&gt;
Finally, we reset the mysql client delimiter to the well-known semicolon.&lt;br /&gt;
&lt;pre&gt;delimiter //
DROP PROCEDURE IF EXISTS colavg//
CREATE PROCEDURE colavg(IN tbl CHAR(64), IN col CHAR(64))
READS SQL DATA
COMMENT 'Selects the average of column col in table tbl'
BEGIN
SET @s = CONCAT('SELECT AVG(' , col , ') FROM ' , tbl);
PREPARE stmt FROM @s;
EXECUTE stmt;
END;
//
delimiter ;&lt;/pre&gt;We now have a stored procedure which will allow us to select the average of any column in any table:&lt;br /&gt;
&lt;pre&gt;CALL colavg('Country', 'LifeExpectancy');
+---------------------+
| AVG(LifeExpectancy) |
+---------------------+
| 66.48604            |
+---------------------+

CALL colavg('City', 'Population');
+-----------------+
| AVG(Population) |
+-----------------+
| 350468.2236     |
+-----------------+&lt;/pre&gt;One final note on compatibility with other SQL dialects: In the stored procedure, we execute simple SELECT statements which returns the output of the SELECT statement to the client. This behavior is a MySQL extention to the SQL standard, which is not likely to work in other RDBMSs. In most cases, you'll probably want to SELECT into one or more user variables, then pass the result back in an OUT or INOUT parameter.</description><link>http://sqlserver-guide.blogspot.com/2010/07/stored-procedures-in-mysql-50.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1799474711497514132.post-6173045178055592819</guid><pubDate>Sat, 10 Jul 2010 07:30:00 +0000</pubDate><atom:updated>2010-07-10T00:30:00.190-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">database</category><category domain="http://www.blogger.com/atom/ns#">mysql</category><category domain="http://www.blogger.com/atom/ns#">Triggers</category><title>MySQL 5.0 New Features: Triggers</title><description>Whenever I want to show actual code, such as something that comes directly from the screen of my mysql client program, I switch to a Courier font, which looks different from the regular text font.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;mysql&amp;gt; DROP FUNCTION f;
Query OK, 0 rows affected (0.00 sec)&lt;/pre&gt;When the example is large and I want to draw attention to a particular line or phrase, I highlight it with a double underline and a small arrow on the right of the page.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;mysql&amp;gt; CREATE PROCEDURE p ()
    -&amp;gt; BEGIN
    -&amp;gt;   /* This procedure does nothing */
    -&amp;gt; END;//
Query OK, 0 rows affected (0.00 sec)&lt;/pre&gt;Sometimes I will leave out the "mysql&amp;gt;" and "-&amp;gt;" prompts so that you can cut the examples and paste them into your copy of the mysql client program. (If you aren't reading the text of this book in a machine-readable form, try looking for the script on the mysql.com web site.)&lt;br /&gt;
&lt;br /&gt;
I tested all the examples with the publicly-available alpha version of MySQL 5.0.3 on Linux, SUSE 9.2. By the time you read this, the version number will be higher and the available operating systems will include Windows, Sparc, and HP-UX. So I'm confident that you'll be able to run every example on your computer. But if not, well, as an experienced MySQL user you know that help and support is always available.&lt;br /&gt;
&lt;h2&gt;Why Triggers&lt;/h2&gt;We are including support for triggers in MySQL 5.0 for these reasons:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Users of earlier MySQL versions kept on telling us they wanted triggers. &lt;/li&gt;
&lt;li&gt;We have a commitment to support all ANSI-standard features. &lt;/li&gt;
&lt;li&gt;You can use them to check for, and prevent, bad data entering the database. &lt;/li&gt;
&lt;li&gt;You can change or negate the &lt;code&gt;INSERT, UPDATE&lt;/code&gt;, and &lt;code&gt;DELETE&lt;/code&gt; statements. &lt;/li&gt;
&lt;li&gt;You can monitor data-change activity throughout a session. &lt;/li&gt;
&lt;/ul&gt;I assume that you have read the first book in the "MySQL New Features" series already. In that book, "MySQL Stored Procedures", you (I hope) saw how MySQL supports stored procedures and functions. That's important knowledge, because you can use the same statements in triggers as you can use in functions. Specifically:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Compound statements (&lt;code&gt;BEGIN / END&lt;/code&gt;) are legal. &lt;/li&gt;
&lt;li&gt;Flow-of-control statements (&lt;code&gt;IF, CASE, WHILE, LOOP, WHILE, REPEAT, LEAVE, ITERATE&lt;/code&gt;) are legal. &lt;/li&gt;
&lt;li&gt;Variable declaration (&lt;code&gt;DECLARE&lt;/code&gt;) and assignment (&lt;code&gt;SET&lt;/code&gt;) are legal. &lt;/li&gt;
&lt;li&gt;Condition declarations are legal. &lt;/li&gt;
&lt;li&gt;Handler declarations are legal. &lt;/li&gt;
&lt;/ul&gt;But remember that functions are subject to severe limitations: you cannot access tables from within a function. So these statements are illegal inside a function:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;ALTER 'CACHE INDEX' CALL COMMIT CREATE DELETE
  DROP 'FLUSH PRIVILEGES' GRANT INSERT KILL
  LOCK OPTIMIZE REPAIR REPLACE REVOKE
  ROLLBACK SAVEPOINT 'SELECT FROM table'
  'SET system variable' 'SET TRANSACTION'
  SHOW 'START TRANSACTION' TRUNCATE UPDATE&lt;/pre&gt;Precisely the same limitation applies for triggers.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="zemanta-pixie" style="height: 15px; margin-top: 10px;"&gt;&lt;a bitly="BITLY_PROCESSED" class="zemanta-pixie-a" href="http://www.zemanta.com/" title="Enhanced by Zemanta"&gt;&lt;img alt="Enhanced by Zemanta" class="zemanta-pixie-img" src="http://img.zemanta.com/zemified_e.png?x-id=3eae47e1-c9ac-4b2e-a848-d837eff937c8" style="border: medium none; float: right;" /&gt;&lt;/a&gt;&lt;span class="zem-script more-related pretty-attribution"&gt;&lt;script defer="defer" src="http://static.zemanta.com/readside/loader.js" type="text/javascript"&gt;
&lt;/script&gt;&lt;/span&gt;&lt;/div&gt;</description><link>http://sqlserver-guide.blogspot.com/2010/07/mysql-50-new-features-triggers.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1799474711497514132.post-6769783535763378748</guid><pubDate>Fri, 09 Jul 2010 07:30:00 +0000</pubDate><atom:updated>2010-07-09T00:30:01.586-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">database</category><category domain="http://www.blogger.com/atom/ns#">Database management system</category><category domain="http://www.blogger.com/atom/ns#">Microsoft</category><category domain="http://www.blogger.com/atom/ns#">mysql</category><category domain="http://www.blogger.com/atom/ns#">SQL</category><title>MySQL 5.0 New Features: Data Dictionary</title><description>Whenever I want to show actual code, such as something that comes directly from the screen of my mysql client program, I switch to a Courier font, which looks different from the regular text font.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;pre&gt;mysql&amp;gt; CREATE TABLE table1 (column1 INT);
Query OK, 0 rows affected (0.00 sec)&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;When the example is large and I want to draw attention to a particular line or phrase, I highlight it with a double underline and a small arrow on the right of the page.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;pre&gt;mysql&amp;gt; CREATE VIEW v AS
    -&amp;gt; SELECT column1 AS c /* view col name is c */
    -&amp;gt; FROM table1;
Query OK, 0 rows affected (0.01 sec)&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;Sometimes I will leave out the mysql&amp;gt; and -&amp;gt; prompts so that you can cut the examples and paste them into your copy of the mysql client program. (If you aren't reading the text of this book in a machine-readable form, try looking for the script on the mysql.com web site.)&lt;br /&gt;
&lt;br /&gt;
All of the examples in this book were tested with the publicly-available alpha version of MySQL 5.0.3 on the SuSE Linux operating system (version 9.1). By the time you read this, the version number will be higher and the available operating systems will include Windows, Sparc, and HP-UX. So I'm confident that you'll be able to run every example on your own computer. But if not, well, as an experienced MySQL user you know that help and support is always available.&lt;br /&gt;
&lt;h2&gt;A Definition and an Example&lt;/h2&gt;Standard SQL (SQL:2003) provides a method of accessing database metadata through a schema called INFORMATION_SCHEMA. Until now, MySQL has provided metadata only through a series of SHOW commands. SHOW, however, has two disadvantages:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;&lt;code&gt;SHOW&lt;/code&gt; commands are non-standard; they are specific to MySQL. &lt;/li&gt;
&lt;li&gt;&lt;code&gt;SHOW&lt;/code&gt; commands require that you learn an entire set of commands to be able to access the metadata you need. &lt;/li&gt;
&lt;/ol&gt;In contrast:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Use of &lt;code&gt;INFORMATION_SCHEMA&lt;/code&gt; is standard SQL; thus alleviating some problems that may occur in porting applications from one DBMS to another. For example, Microsoft SQL Server also supports &lt;code&gt;INFORMATION_SCHEMA&lt;/code&gt;, while IBM DB2 supports a similar structure, albeit with different names. &lt;/li&gt;
&lt;li&gt;The tables in &lt;code&gt;INFORMATION_SCHEMA&lt;/code&gt; can be queried via a &lt;code&gt;SELECT&lt;/code&gt; statement, just as regular tables can be queried; thus there is no need to learn a new set of commands to be able to access the metadata you need. &lt;/li&gt;
&lt;/ol&gt;So MySQL AB made the decision to implement support for the &lt;code&gt;INFORMATION_SCHEMA&lt;/code&gt;. Effective with MySQL 5.0.2, your MySQL installation will automatically contain a schema (usually called a database in MySQL parlance) called &lt;code&gt;INFORMATION_SCHEMA&lt;/code&gt;; it contains a set of views that allow you to look at (but not change) the description of your database objects just as if the descriptions are regular SQL data. Here is an example:&lt;br /&gt;
&lt;pre&gt;mysql&amp;gt; SELECT table_name, table_type, engine
    -&amp;gt; FROM INFORMATION_SCHEMA.tables
    -&amp;gt; WHERE table_schema = 'tp'
    -&amp;gt; ORDER BY table_type ASC, table_name DESC;
+------------+------------+--------+
| table_name | table_type | engine |
+------------+------------+--------+
| t2         | BASE TABLE | MyISAM |
| t1         | BASE TABLE | InnoDB |
| v1         | VIEW       | NULL   |
+------------+------------+--------+&lt;/pre&gt;&lt;h2&gt;Terminology Notes&lt;/h2&gt;Metadata refers to data about the data. For example, the name of a table and the data type of a column is metadata. There are two other terms that are often used as synonyms for metadata:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Data dictionary &lt;/li&gt;
&lt;li&gt;System catalog &lt;/li&gt;
&lt;/ol&gt;I won't be using those terms in this book.&lt;br /&gt;
&lt;h2&gt;Using INFORMATION_SCHEMA&lt;/h2&gt;MySQL now has a new "database" named &lt;code&gt;INFORMATION_SCHEMA&lt;/code&gt;. It is a virtual database only; there will never be a need to create a file by that name, and the MySQL server itself creates and populates the tables therein. It is not possible to &lt;code&gt;USE INFORMATION_SCHEMA&lt;/code&gt;; nor is it possible to &lt;code&gt;UPDATE, INSERT, DELETE&lt;/code&gt;, or even &lt;code&gt;REFERENCE&lt;/code&gt; the &lt;code&gt;INFORMATION_SCHEMA&lt;/code&gt; tables. The only action possible is &lt;code&gt;SELECT&lt;/code&gt;. &lt;br /&gt;
&lt;h3&gt;Privileges&lt;/h3&gt;Accessing the &lt;code&gt;INFORMATION_SCHEMA&lt;/code&gt; tables does not require a special privilege: the &lt;code&gt;SELECT&lt;/code&gt; privilege on each table is automatically granted to every user.&lt;br /&gt;
&lt;br /&gt;
Thus, there is no difference between the current (&lt;code&gt;SHOW&lt;/code&gt;) privilege requirement and the &lt;code&gt;SELECT&lt;/code&gt; requirement. In either case, you have to have some privilege on an object in order to see the metadata information about that object.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="zemanta-pixie" style="height: 15px; margin-top: 10px;"&gt;&lt;a bitly="BITLY_PROCESSED" class="zemanta-pixie-a" href="http://www.zemanta.com/" title="Enhanced by Zemanta"&gt;&lt;img alt="Enhanced by Zemanta" class="zemanta-pixie-img" src="http://img.zemanta.com/zemified_e.png?x-id=8fc6d4a7-22b9-48c6-8671-06b5e4a9d2d4" style="border: medium none; float: right;" /&gt;&lt;/a&gt;&lt;span class="zem-script more-related pretty-attribution"&gt;&lt;script defer="defer" src="http://static.zemanta.com/readside/loader.js" type="text/javascript"&gt;
&lt;/script&gt;&lt;/span&gt;&lt;/div&gt;</description><link>http://sqlserver-guide.blogspot.com/2010/07/mysql-50-new-features-data-dictionary.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1799474711497514132.post-6194065303733229929</guid><pubDate>Thu, 08 Jul 2010 07:30:00 +0000</pubDate><atom:updated>2010-07-08T00:30:00.238-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">mysql</category><title>MySQL 5.0 New Features</title><description>This book is for the long-time MySQL user who wants to know "what's new" in version 5. The short answer is "stored procedures, triggers, views, and information schema". The long answer is the MySQL 5.0 New Features series, and this book is the third in that series.&lt;br /&gt;
&lt;br /&gt;
What I'm hoping to do is make this look like a hands-on session where you, as if you're working it out yourself on your keyboard, can walk through the sample problems. To do this, I'll go through each little item, building up slowly. By the end, I'll be showing larger views that do something useful, as well as some things that you might have thought were tough.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="font-size: small;"&gt;Conventions and Styles:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Whenever I want to show actual code, such as something that comes directly from the screen of my mysql client program, I switch to a Courier font, which looks different from the regular text font.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;mysql&amp;gt; DROP VIEW v CASCADE;
Query OK, 0 rows affected (0.00 sec)&lt;/pre&gt;When the example is large and I want to draw attention to a particular line or phrase, I highlight it with a double underline and a small arrow on the right of the page. For example:&lt;br /&gt;
&lt;pre&gt;mysql&amp;gt; CREATE VIEW v AS
    -&amp;gt; SELECT column1 AS c /* view col name is c */
    -&amp;gt; FROM table1;
Query OK, 0 rows affected (0.01 sec)&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;Sometimes I will leave out the mysql&amp;gt; and -&amp;gt; prompts, so that you can cut the examples and paste them into your copy of the mysql client program. (If you aren't reading the text of this book in a machine-readable form, try looking for the script on the mysql.com web site.)&lt;br /&gt;
&lt;br /&gt;
All of the examples in this book were tested with the publicly-available alpha version of MySQL 5.0.3 on the SUSE Linux operating system (version 9.1). By the time you read this, the version number will be higher and the available operating systems will include Windows, Sparc, and HP-UX. So I'm confident that you'll be able to run every example on your own computer. But if not, well, as an experienced MySQL user you know that help and support is always available.&lt;br /&gt;
&lt;h2&gt;&lt;br /&gt;
&lt;/h2&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="zemanta-pixie" style="height: 15px; margin-top: 10px;"&gt;&lt;a bitly="BITLY_PROCESSED" class="zemanta-pixie-a" href="http://www.zemanta.com/" title="Enhanced by Zemanta"&gt;&lt;img alt="Enhanced by Zemanta" class="zemanta-pixie-img" src="http://img.zemanta.com/zemified_e.png?x-id=74cf40ff-c565-4786-b330-0018fd27deff" style="border: medium none; float: right;" /&gt;&lt;/a&gt;&lt;span class="zem-script more-related pretty-attribution"&gt;&lt;script defer="defer" src="http://static.zemanta.com/readside/loader.js" type="text/javascript"&gt;
&lt;/script&gt;&lt;/span&gt;&lt;/div&gt;</description><link>http://sqlserver-guide.blogspot.com/2010/07/mysql-50-new-features.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1799474711497514132.post-4265993401571645507</guid><pubDate>Sat, 26 Jun 2010 04:31:00 +0000</pubDate><atom:updated>2010-06-25T21:31:00.307-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">mysql</category><title>MySQL Tip: How To Check, Repair &amp; Optimize All Tables in All Databases</title><description>Here is a simple command to &lt;strong&gt;&lt;span class="IL_AD" id="IL_AD4"&gt;auto repair&lt;/span&gt;, check and optimize all the tables in all databases running on a MySQL server&lt;/strong&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;span id="more-2515"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;code&gt;mysqlcheck -u root -p --auto-repair --check --optimize --all-databases&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
mysqlcheck is available in MySQL 3.23.38 and later.&lt;br /&gt;
&lt;br /&gt;
mysqlcheck uses the SQL &lt;span class="IL_AD" id="IL_AD3"&gt;statements&lt;/span&gt; CHECK TABLE, REPAIR TABLE, ANALYZE TABLE, and OPTIMIZE TABLE in a convenient way for the user. It determines which statements to use for the operation you want to perform, and then sends the statements to the server to be executed. The exact operations are determined by the underlying storage engine used.&lt;br /&gt;
&lt;br /&gt;
You must execute it on running &lt;span class="IL_AD" id="IL_AD2"&gt;database&lt;/span&gt;. It is recommended that you kill other incoming queries (like from your website) before running this which makes it a lot faster. I simply stop my httpd server before running it. You may want to use a &lt;a bitly="BITLY_PROCESSED" href="http://www.taragana.com/products/free-wordpress-plugins/site-maintenance"&gt;Site Unavailable&lt;/a&gt; message instead so that the MySQL server is left alone.</description><link>http://sqlserver-guide.blogspot.com/2010/06/mysql-tip-how-to-check-repair-optimize.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item></channel></rss>