snipt

Ctrl+h for KB shortcuts

SQL

Casting a Datetime to Date Sqlserver 2008

cast(getdate() As Date)
https://snipt.net/embed/842fae8370d256c3ff55a2a5a1656f88/
/raw/842fae8370d256c3ff55a2a5a1656f88/
842fae8370d256c3ff55a2a5a1656f88
sql
SQL
1
2019-07-13T00:18:12
True
False
False
Feb 13, 2014 at 02:52 PM
/api/public/snipt/113504/
casting-a-datetime-to-date-sqlserver-2008
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="k">cast</span><span class="p">(</span><span class="n">getdate</span><span class="p">()</span> <span class="k">As</span> <span class="nb">Date</span><span class="p">)</span> </span></pre></div> </td></tr></table>
casting, date, datetime, sqlserver

SQL

SQLSERVER FINDING TEXT IN ALL STORED PROCEDURES

1
2
3
SELECT Name
FROM sys.procedures
WHERE OBJECT_DEFINITION(OBJECT_ID) LIKE 'TEXTLOKINGFOR'
https://snipt.net/embed/04c38ed6cc1cbc0790aef13ac66ab322/
/raw/04c38ed6cc1cbc0790aef13ac66ab322/
04c38ed6cc1cbc0790aef13ac66ab322
sql
SQL
3
2019-07-16T10:11:13
True
False
False
Feb 07, 2014 at 03:49 PM
/api/public/snipt/111832/
sqlserver-finding-text-in-all-stored-procedures
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="k">SELECT</span> <span class="n">Name</span> </span><span id="L-2"><a name="L-2"></a><span class="k">FROM</span> <span class="n">sys</span><span class="p">.</span><span class="n">procedures</span> </span><span id="L-3"><a name="L-3"></a><span class="k">WHERE</span> <span class="n">OBJECT_DEFINITION</span><span class="p">(</span><span class="n">OBJECT_ID</span><span class="p">)</span> <span class="k">LIKE</span> <span class="s1">&#39;TEXTLOKINGFOR&#39;</span> </span></pre></div> </td></tr></table>
"FINDING TEXT", "STORED PROCEDURE", SP, SQLSERVER