<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Siddharth Gandhi on Medium]]></title>
        <description><![CDATA[Stories by Siddharth Gandhi on Medium]]></description>
        <link>https://medium.com/@siddharthhgandhi?source=rss-1d5bd9e46828------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*RpiZ7pocA1OdhfZM</url>
            <title>Stories by Siddharth Gandhi on Medium</title>
            <link>https://medium.com/@siddharthhgandhi?source=rss-1d5bd9e46828------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 01:39:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@siddharthhgandhi/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Finding Stored Procedures That Reference a Specific Table in SQL Server]]></title>
            <link>https://medium.com/@siddharthhgandhi/finding-stored-procedures-that-reference-a-specific-table-in-sql-server-6f2abf0ab7d4?source=rss-1d5bd9e46828------2</link>
            <guid isPermaLink="false">https://medium.com/p/6f2abf0ab7d4</guid>
            <dc:creator><![CDATA[Siddharth Gandhi]]></dc:creator>
            <pubDate>Sat, 06 Jun 2026 04:42:59 GMT</pubDate>
            <atom:updated>2026-06-06T04:42:59.130Z</atom:updated>
            <content:encoded><![CDATA[<p>While working on database maintenance, impact analysis, or schema changes, it’s often necessary to identify all stored procedures that reference a particular table.</p><p>The following query helps locate stored procedures containing a specific table name in their definition:</p><pre>SELECT Name<br>FROM sys.procedures<br>WHERE OBJECT_DEFINITION(OBJECT_ID) LIKE &#39;%TableName%&#39;</pre><h3>How It Works</h3><h3>1. sys.procedures</h3><p>This is a system catalog view in SQL Server that contains information about all stored procedures in the current database.</p><pre>SELECT *<br>FROM sys.procedures</pre><p>It returns details such as</p><ul><li>Procedure name</li><li>Object ID</li><li>Creation date</li><li>Modification date</li></ul><h3>2. OBJECT_DEFINITION(OBJECT_ID)</h3><p>This function retrieves the T-SQL source code of a database object using its Object ID.</p><p>For example:</p><pre>SELECT OBJECT_DEFINITION(OBJECT_ID(&#39;dbo.usp_GetCustomerDetails&#39;))</pre><p>This returns the complete stored procedure definition.</p><h3>3. LIKE &#39;%TableName%&#39;</h3><p>The LIKE operator searches the procedure definition for a specific text pattern.</p><pre>LIKE &#39;%Customer%&#39;</pre><p>This finds any stored procedure where the word “Customer” appears anywhere in the code.</p><h3>Practical Example</h3><p>Suppose you want to find all stored procedures that reference the Orders table:</p><pre>SELECT Name<br>FROM sys.procedures<br>WHERE OBJECT_DEFINITION(OBJECT_ID) LIKE &#39;%Orders%&#39;</pre><p>Result:</p><p>Procedure Nameusp_GetOrdersusp_UpdateOrdersusp_DeleteOrders</p><h3>Enhanced Version</h3><p>To view both the procedure name and its definition:</p><pre>SELECT<br>    p.Name,<br>    OBJECT_DEFINITION(p.OBJECT_ID) AS ProcedureDefinition<br>FROM sys.procedures p<br>WHERE OBJECT_DEFINITION(p.OBJECT_ID) LIKE &#39;%Orders%&#39;</pre><h3>Common Use Cases</h3><ul><li>Impact analysis before altering or dropping a table.</li><li>Identifying dependencies during database refactoring.</li><li>Understanding legacy database code.</li><li>Auditing object usage across a database.</li><li>Supporting data archival and migration activities.</li></ul><h3>Important Considerations</h3><ul><li>The search is text-based and may return false positives if the table name appears in comments or variable names.</li><li>Encrypted stored procedures won’t return their definitions.</li><li>Dynamic SQL references may not always be detected accurately.</li></ul><h3>Conclusion</h3><p>Using sys.procedures together with OBJECT_DEFINITION() is a quick and effective way to discover stored procedures that reference a specific table. It&#39;s a valuable technique for DBAs and developers when performing impact analysis, troubleshooting, or database modernization projects.</p><p><strong>Pro Tip:</strong> Before making changes to a table, always run a dependency search like this to understand which stored procedures might be affected.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6f2abf0ab7d4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is USING in PostgreSQL?]]></title>
            <link>https://medium.com/@siddharthhgandhi/what-is-using-in-postgresql-0175eb063a6e?source=rss-1d5bd9e46828------2</link>
            <guid isPermaLink="false">https://medium.com/p/0175eb063a6e</guid>
            <dc:creator><![CDATA[Siddharth Gandhi]]></dc:creator>
            <pubDate>Tue, 28 Apr 2026 02:22:24 GMT</pubDate>
            <atom:updated>2026-04-28T02:22:24.443Z</atom:updated>
            <content:encoded><![CDATA[<p>The USING clause is used in JOIN operations when both tables share a column with the same name.</p><p>Instead of writing a full join condition, you can simplify your query.</p><h3>🔹 When Should You Use USING?</h3><p>Use it when:</p><ul><li>Both tables have the <strong>same column name</strong></li><li>You want <strong>simpler, more readable queries</strong></li><li>You want to <strong>avoid duplicate columns in output</strong></li></ul><h3>🔹 When NOT to Use USING?</h3><p>Avoid it when:</p><ul><li>Column names are different</li><li>You need custom join conditions</li><li>You want full control over output columns</li></ul><h3>🔹 Internal Behavior (Good to Know)</h3><p>Under the hood:</p><ul><li>PostgreSQL converts USING into an ON condition</li><li>It automatically matches columns with the same name</li><li>It merges the joined column into a single output column</li></ul><h3>🔹 Key Advantage: No Duplicate Columns</h3><p>One of the biggest benefits of USING is how it handles output columns.</p><h3>With ON:</h3><p>You’ll get:</p><ul><li>orders.customer_id</li><li>customers.customer_id</li></ul><h3>With USING:</h3><p>You’ll get:</p><ul><li>customer_id (only once)</li></ul><p>This makes your result set cleaner and avoids redundancy.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0175eb063a6e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[7 Easy steps to push code using Git Bash]]></title>
            <link>https://medium.com/@siddharthhgandhi/7-easy-steps-to-push-code-using-git-bash-34ac4332c570?source=rss-1d5bd9e46828------2</link>
            <guid isPermaLink="false">https://medium.com/p/34ac4332c570</guid>
            <dc:creator><![CDATA[Siddharth Gandhi]]></dc:creator>
            <pubDate>Tue, 10 Mar 2026 15:27:59 GMT</pubDate>
            <atom:updated>2026-03-10T15:27:59.774Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Prerequisite:</strong></p><p><em>Download Git Bash: </em><a href="https://git-scm.com/downloads"><em>https://git-scm.com/downloads</em></a></p><p>Step 1:</p><ul><li>Open <strong>File Explorer</strong> and navigate to your project folder.</li><li>Right-click inside the folder (not on a file).</li><li>Select <strong>“Git Bash Here”</strong> from the context menu.</li><li>Git Bash will open with the current directory set to your project folder.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/441/1*1p5kERgPvyIDyHnrjL3N9Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/995/1*dGT3mtELKRFKhAqHSbTqcg.png" /></figure><p>Step 2: Check existing branches</p><ul><li>git branch -a</li></ul><figure><img alt="(This shows all local and remote branches.)" src="https://cdn-images-1.medium.com/max/920/1*59LylOaqNPfIIrzdsQ6l2A.png" /><figcaption>(This shows all local and remote branches.)</figcaption></figure><p>Step 3: Create a new branch</p><ul><li>git checkout -b &lt;branch_name&gt;</li><li>git checkout -b feature-branch</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/891/1*FXiQlsOp8dC2lWDk-fgFsw.png" /><figcaption>(This creates a new branch and switches to it.)</figcaption></figure><p>Step 4: Make changes in your code and stage the changes</p><ul><li>git status</li></ul><p>Step 5: To add all changes:</p><ul><li>git add .</li></ul><p>Step 6 : Commit the changes</p><ul><li>git commit -m “Your commit message”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/1*9h04QY3oSHt37FZ7GP-YKQ.png" /></figure><p>Step 7: Push the new branch to the remote repository</p><ul><li>git push origin &lt;branch_name&gt;</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/955/1*UZrT1WUVPRPN-tbk8xExng.png" /></figure><p>Step 8: Merge to main</p><ul><li>git merge &lt;branch_name&gt;</li><li>git push origin main</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1003/1*hrxxCWlbawAo6Rr9fwLPag.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=34ac4332c570" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LIKE vs ILIKE in PostgreSQL: Understanding Case-Sensitive and Case-Insensitive Search]]></title>
            <link>https://medium.com/@siddharthhgandhi/like-vs-ilike-in-postgresql-understanding-case-sensitive-and-case-insensitive-search-ee2137b446ca?source=rss-1d5bd9e46828------2</link>
            <guid isPermaLink="false">https://medium.com/p/ee2137b446ca</guid>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[postgresql]]></category>
            <dc:creator><![CDATA[Siddharth Gandhi]]></dc:creator>
            <pubDate>Fri, 06 Mar 2026 08:13:34 GMT</pubDate>
            <atom:updated>2026-03-06T08:13:34.334Z</atom:updated>
            <content:encoded><![CDATA[<p>When working with text data in PostgreSQL, searching for patterns is a common requirement. PostgreSQL provides two operators for pattern matching: <strong>LIKE</strong> and <strong>ILIKE</strong>.</p><p>At first glance, they look similar, but there is an important difference between them — <strong>case sensitivity</strong>.</p><p>In this blog, we will understand how both operators work and when you should use each of them.</p><h3>1. What is LIKE in PostgreSQL?</h3><p>The <strong>LIKE</strong> operator is used for pattern matching in SQL queries. It is <strong>case-sensitive</strong>, which means it differentiates between uppercase and lowercase letters.</p><h3>Example</h3><pre>SELECT * <br>FROM employees<br>WHERE name LIKE &#39;Siddharth%&#39;;</pre><p>This query will match:</p><ul><li>Siddharth</li><li>Siddhartha</li></ul><p>But it will <strong>NOT match</strong>:</p><ul><li>siddharth</li><li>SIDDHARTH</li></ul><p>Because LIKE respects the exact case of the characters.</p><h3>2. Wildcards Used with LIKE</h3><p>LIKE works with special wildcard characters.</p><p>Wildcard Meaning % Matches any sequence of characters_Matches exactly one character</p><h3>Example</h3><pre>SELECT * <br>FROM employees<br>WHERE name LIKE &#39;J_n%&#39;;</pre><p>Possible matches:</p><ul><li>Jan</li><li>Jon</li><li>John</li></ul><h3>3. What is ILIKE in PostgreSQL?</h3><p>The <strong>ILIKE</strong> operator works exactly like LIKE, but it performs <strong>case-insensitive pattern matching</strong>.</p><p>That means PostgreSQL will ignore uppercase and lowercase differences.</p><h3>Example</h3><pre>SELECT *<br>FROM employees<br>WHERE name ILIKE &#39;siddharth%&#39;;</pre><p>This query will match:</p><ul><li>Siddharth</li><li>siddharth</li><li>SIDDHARTH</li><li>Siddhartha</li></ul><h3>4. Practical Example</h3><p>Let’s assume you have a <strong>users</strong> table.</p><pre>SELECT * <br>FROM users<br>WHERE email LIKE &#39;%gmail.com&#39;;</pre><p>This will only match if the case is exactly the same.</p><p>To perform a case-insensitive search:</p><pre>SELECT * <br>FROM users<br>WHERE email ILIKE &#39;%gmail.com&#39;;</pre><p>Now it will match:</p><ul><li><a href="/service/mailto:user@gmail.com">user@gmail.com</a></li><li><a href="/service/mailto:USER@gmail.com">USER@gmail.com</a></li><li><a href="/service/mailto:User@Gmail.com">User@Gmail.com</a></li></ul><h3>Conclusion</h3><p>Both <strong>LIKE</strong> and <strong>ILIKE</strong> are useful for pattern matching in PostgreSQL, but the key difference lies in <strong>case sensitivity</strong>.</p><ul><li>Use <strong>LIKE</strong> when you want <strong>case-sensitive matching</strong>.</li><li>Use <strong>ILIKE</strong> when you want <strong>case-insensitive matching</strong>.</li></ul><p>Understanding this small difference can help you write more accurate queries and avoid unexpected results when working with text data.</p><p>If you found this helpful, feel free to share it with other developers and follow for more posts on <strong>PostgreSQL, SQL optimization, and backend development</strong>.</p><p>email: reach@siddharthgandhi.in</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ee2137b446ca" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>