<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/"><channel><title>sql on Neolisk's Tech Blog</title><link>/tags/sql/</link><description>Recent content in sql on Neolisk's Tech Blog</description><generator>Hugo -- gohugo.io</generator><language>en</language><managingEditor>neolisk@gmail.com (Victor Zakharov)</managingEditor><webMaster>neolisk@gmail.com (Victor Zakharov)</webMaster><copyright>©2020-2024 Victor Zakharov. All Rights Reserved</copyright><lastBuildDate>Sun, 24 Sep 2017 00:00:00 +0000</lastBuildDate><atom:link href="/tags/sql/index.xml" rel="self" type="application/rss+xml"/><item><title>TSQL - Get Index By Table Name + Column Name</title><link>/posts/2017-09-24-tsql-get-index-by-table-name/</link><pubDate>Sun, 24 Sep 2017 00:00:00 +0000</pubDate><author>neolisk@gmail.com (Victor Zakharov)</author><atom:modified>Sat, 05 Jun 2021 11:36:56 -0400</atom:modified><guid>/posts/2017-09-24-tsql-get-index-by-table-name/</guid><description>Below SQL code will find an index name that corresponds to the given table name and column name pair, and only include those indices with one column (exclude composite indices). Indices can be changed / added / removed by a DBA without impact to the application (part of DB tuning), so it&amp;rsquo;s best not to assume their naming in an application deployment script. This can be useful to remove / replace certain indices without relying on index name.</description><dc:creator>Victor Zakharov</dc:creator><category>sql</category><category>tsql</category></item><item><title>How many tables do I have in a database (MS SQL)</title><link>/posts/2012-08-16-mssql-count-db-tables/</link><pubDate>Thu, 16 Aug 2012 00:00:00 +0000</pubDate><author>neolisk@gmail.com (Victor Zakharov)</author><atom:modified>Sat, 05 Jun 2021 11:36:56 -0400</atom:modified><guid>/posts/2012-08-16-mssql-count-db-tables/</guid><description>Here is a one-liner:
1 SELECT COUNT(*) FROM (SELECT DISTINCT table_name FROM INFORMATION_SCHEMA.TABLES) a</description><dc:creator>Victor Zakharov</dc:creator><category>sql</category></item><item><title>Cannot open .SQL file in Visual Studio 2010</title><link>/posts/2012-02-29-cannot-open-sql-file-vs-2010/</link><pubDate>Wed, 29 Feb 2012 00:00:00 +0000</pubDate><author>neolisk@gmail.com (Victor Zakharov)</author><atom:modified>Sat, 29 Feb 2020 15:34:59 -0500</atom:modified><guid>/posts/2012-02-29-cannot-open-sql-file-vs-2010/</guid><description>Environment hangs, completely at times, or just for several seconds. If it resumes after hanging, you are able to close the tab where this .SQL file would show up.
In any case, you cannot see or edit anything in there, seeing this Visual Studio 2010 branded blue background all over the contents area.
The solution, which worked for me - get the DVD with Visual Studio installation files and install from WCU\DAC\DACProjectSystemSetup_enu.</description><dc:creator>Victor Zakharov</dc:creator><category>devops</category><category>sql</category></item><item><title>MS SQL Server 2008 R2 error log growing rapidly</title><link>/posts/2011-10-11-sql-2008-error-log-growing-rapidly/</link><pubDate>Tue, 11 Oct 2011 00:00:00 +0000</pubDate><author>neolisk@gmail.com (Victor Zakharov)</author><atom:modified>Sun, 01 Mar 2020 15:41:11 -0500</atom:modified><guid>/posts/2011-10-11-sql-2008-error-log-growing-rapidly/</guid><description>MS SQL server 2008 R2 was spamming the error log with the following two messages (got around 50GB of them in 4 days):
Message A.
An exception occurred while enqueueing a message in the target queue. Error: 15517, State: 1. Cannot execute as the database principal because the principal &amp;ldquo;dbo&amp;rdquo; does not exist, this type of principal cannot be impersonated, or you do not have permission.
Message B.
The activated proc &amp;lsquo;[dbo].</description><dc:creator>Victor Zakharov</dc:creator><category>devops</category><category>software</category><category>sql</category></item><item><title>MS SQL drop column with default constraint</title><link>/posts/2011-10-04-sql-drop-column-with-default-constraint/</link><pubDate>Tue, 04 Oct 2011 00:00:00 +0000</pubDate><author>neolisk@gmail.com (Victor Zakharov)</author><atom:modified>Sun, 01 Mar 2020 15:43:55 -0500</atom:modified><guid>/posts/2011-10-04-sql-drop-column-with-default-constraint/</guid><description>The following MS SQL script will generate MS SQL statements to drop a list of columns with default constraint for a certain table.
Need to change table_name and list of columns, as applicable. Statements will be generated only if required.
To make things clear:
If column does not exist within specified table, no drop will be generated. If column does not have a default constraint, no drop for this constraint will be generated.</description><dc:creator>Victor Zakharov</dc:creator><category>devops</category><category>software</category><category>sql</category></item><item><title>Oracle ALTER SEQUENCE - START WITH not working?</title><link>/posts/2011-02-17-oracle-alter-sequence-start-with-not-working/</link><pubDate>Thu, 17 Feb 2011 00:00:00 +0000</pubDate><author>neolisk@gmail.com (Victor Zakharov)</author><atom:modified>Sun, 29 Mar 2020 19:23:55 -0400</atom:modified><guid>/posts/2011-02-17-oracle-alter-sequence-start-with-not-working/</guid><description>I googled over many websites explaining the error code and suggesting you do not change it. What if you really need to?
One approach is to call NEXTVAL as many times to shift the sequence, so that it starts with your START WITH number (&amp;lt;SW&amp;gt;). A better one is to change INCREMENT BY to a certain value instead, then do NEXTVAL and revert INCREMENT BY.
For example, suppose you currently have an increment = &amp;lt;I&amp;gt;, your current sequence value is &amp;lt;C&amp;gt;.</description><dc:creator>Victor Zakharov</dc:creator><category>oracle</category><category>sql</category></item><item><title>SQL Reporting Services - Fix Border Thickness</title><link>/posts/2010-03-12-sql-reporting-services-fix-border-thickness/</link><pubDate>Fri, 12 Mar 2010 00:00:00 +0000</pubDate><author>neolisk@gmail.com (Victor Zakharov)</author><atom:modified>Mon, 12 Oct 2020 11:15:23 -0400</atom:modified><guid>/posts/2010-03-12-sql-reporting-services-fix-border-thickness/</guid><description>When the report is rendered on the screen in preview mode, it looks okay. However, when it is saved to PDF and/or printed, table borders might have slightly different thickness depending on relative location on the sheet. I believe this issue is related to DPI scaling.
Anyway, there is a solution. At least, if you are not after any fancy behavior. To create solid border of the same thickness:
Assign BorderStyle to Solid.</description><dc:creator>Victor Zakharov</dc:creator><category>sql</category></item></channel></rss>