<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>row level security &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/row-level-security/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Wed, 09 Aug 2017 06:56:06 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.4</generator>
	<item>
		<title>PostgreSQL 9.5: Row Level Security by Example</title>
		<link>https://www.dbrnd.com/2016/08/postgresql-9-5-row-level-security-by-example-restrict-records-for-user/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Mon, 01 Aug 2016 19:33:53 +0000</pubDate>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[plpgsql]]></category>
		<category><![CDATA[Postgres Query]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[postgresql 9.5]]></category>
		<category><![CDATA[PostgreSQL Administrator]]></category>
		<category><![CDATA[PostgreSQL Error]]></category>
		<category><![CDATA[PostgreSQL Programming]]></category>
		<category><![CDATA[PostgreSQL Tips and Tricks]]></category>
		<category><![CDATA[row level security]]></category>
		<category><![CDATA[security]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=3433</guid>

					<description><![CDATA[Hello guys, Since last two months I have published about the SQL Server Interview Questions and Answers. During this time, I got lots of messages and requests about the PostgreSQL. In this August &#8211; 2016, I am going to post about only PostgreSQL and will try to complete all pending requests of readers. In this [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F08%2Fpostgresql-9-5-row-level-security-by-example-restrict-records-for-user%2F&amp;linkname=PostgreSQL%209.5%3A%20Row%20Level%20Security%20by%20Example" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F08%2Fpostgresql-9-5-row-level-security-by-example-restrict-records-for-user%2F&amp;linkname=PostgreSQL%209.5%3A%20Row%20Level%20Security%20by%20Example" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F08%2Fpostgresql-9-5-row-level-security-by-example-restrict-records-for-user%2F&amp;linkname=PostgreSQL%209.5%3A%20Row%20Level%20Security%20by%20Example" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F08%2Fpostgresql-9-5-row-level-security-by-example-restrict-records-for-user%2F&amp;linkname=PostgreSQL%209.5%3A%20Row%20Level%20Security%20by%20Example" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F08%2Fpostgresql-9-5-row-level-security-by-example-restrict-records-for-user%2F&amp;linkname=PostgreSQL%209.5%3A%20Row%20Level%20Security%20by%20Example" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F08%2Fpostgresql-9-5-row-level-security-by-example-restrict-records-for-user%2F&amp;linkname=PostgreSQL%209.5%3A%20Row%20Level%20Security%20by%20Example" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F08%2Fpostgresql-9-5-row-level-security-by-example-restrict-records-for-user%2F&#038;title=PostgreSQL%209.5%3A%20Row%20Level%20Security%20by%20Example" data-a2a-url="https://www.dbrnd.com/2016/08/postgresql-9-5-row-level-security-by-example-restrict-records-for-user/" data-a2a-title="PostgreSQL 9.5: Row Level Security by Example"></a></p><p><strong>Hello guys, Since last two months I have published about the SQL Server Interview Questions and Answers.<br />
During this time, I got lots of messages and requests about the PostgreSQL.</strong></p>
<p>In this August &#8211; 2016, I am going to post about only PostgreSQL and will try to complete all pending requests of readers.</p>
<blockquote><p>In this post, I am going to publish about The Row Level Security which is now a common feature of all new version of RDBMSs like SQL Server 2016, PostgreSQL 9.5.</p>
<p><img fetchpriority="high" decoding="async" class="aligncenter wp-image-3436 size-full" title="Postgre SQL Row Level Security" src="https://www.dbrnd.com/wp-content/uploads/2016/08/PostgreSQLRowLevelSecurity.png" alt="Postgre SQL Row Level Security" width="573" height="255" srcset="https://www.dbrnd.com/wp-content/uploads/2016/08/PostgreSQLRowLevelSecurity.png 573w, https://www.dbrnd.com/wp-content/uploads/2016/08/PostgreSQLRowLevelSecurity-300x134.png 300w, https://www.dbrnd.com/wp-content/uploads/2016/08/PostgreSQLRowLevelSecurity-150x67.png 150w" sizes="(max-width: 573px) 100vw, 573px" /></p></blockquote>
<blockquote><p>With the concept of Row Level Security, we can restrict the user for a particular set of records.<br />
Previously, we are doing this kind of restriction using by creating filtered VIEWS and assign related VIEWS to related Users.</p></blockquote>
<blockquote><p>PostgreSQL 9.5 has this Row Level Security feature which extends the overall security policy of the PostgreSQL.</p></blockquote>
<p><strong>Let me demonstrate this.</strong></p>
<p><strong>Execute below all steps using Postgres Super user:</strong></p>
<p><strong>First create two sample users:</strong><br />
<pre class="crayon-plain-tag">CREATE USER abc LOGIN PASSWORD '123';
CREATE USER xyz LOGIN PASSWORD '321';</pre>
<strong>Create a table with sample data:</strong><br />
<pre class="crayon-plain-tag">CREATE TABLE tbl_Employees
(
	EmpID INT
	,EmpName CHARACTER VARYING 
);
INSERT INTO tbl_Employees VALUES 
(1,'Anvesh'),(2,'Martin'),(3,'Roy')
,(4,'Jeeny'),(5,'Kavita'),(6,'Neevan');</pre>
<strong>Add one new column for row level security:</strong><br />
<pre class="crayon-plain-tag">ALTER TABLE tbl_Employees ADD pgUser CHARACTER VARYING;</pre>
<strong>Update table with specific user:</strong><br />
<pre class="crayon-plain-tag">UPDATE tbl_Employees SET pgUser = 'abc' WHERE EmpID IN (1,2,3);
UPDATE tbl_Employees SET pgUser = 'xyz' WHERE EmpID IN (4,5,6);</pre>
<strong>Give some DML grants to these users:</strong><br />
<pre class="crayon-plain-tag">GRANT SELECT,UPDATE,INSERT,DELETE ON tbl_Employees TO abc;
GRANT SELECT,UPDATE,INSERT,DELETE ON tbl_Employees TO xyz;</pre>
<strong>Create a security policy on tbl_Employee for current logged-in user only:</strong><br />
<pre class="crayon-plain-tag">CREATE POLICY policy_employee_user ON tbl_Employees FOR ALL
TO PUBLIC USING (pgUser = current_user);</pre>
<strong>Enable ROW LEVEL SECURITY on tbl_Employees:</strong><br />
<pre class="crayon-plain-tag">ALTER TABLE tbl_Employees ENABLE ROW LEVEL SECURITY;</pre>
<strong>Execute this SELECT with the different logins:</strong><br />
<pre class="crayon-plain-tag">SELECT *FROM tbl_Employees;</pre>
<strong>Result of User abc:</strong><br />
<pre class="crayon-plain-tag">empid   empname   pguser
--------------------------
 1      Anvesh     abc
 2      Martin     abc
 3      Roy        abc</pre>
<strong>Result of User xyz:</strong><br />
<pre class="crayon-plain-tag">empid   empname   pguser
--------------------------
 4      Jeeny      xyz
 5      Kavita     xyz
 6      Neevan     xyz</pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQL Server: Database Security Interview Questions and Answers  (Day-6)</title>
		<link>https://www.dbrnd.com/2016/07/sql-server-database-security-interview-questions-and-answers-row-level-security-sql-injection-data-masking-day-6/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sat, 23 Jul 2016 14:09:23 +0000</pubDate>
				<category><![CDATA[SQL Server Interview]]></category>
		<category><![CDATA[answers]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[database security]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[dynamic data masking]]></category>
		<category><![CDATA[interview]]></category>
		<category><![CDATA[questions]]></category>
		<category><![CDATA[row level security]]></category>
		<category><![CDATA[secure view column]]></category>
		<category><![CDATA[SQL Injection]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server 2016]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tunning]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=3397</guid>

					<description><![CDATA[How do you grant a SQL Server developer truncate table permission without giving them the ability to alter the table? This is accomplished by a DBA creating a stored procedure with the TRUNCATE TABLE statements and then granting execute permission on the stored procedure to those who need it. I have a table where some [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F07%2Fsql-server-database-security-interview-questions-and-answers-row-level-security-sql-injection-data-masking-day-6%2F&amp;linkname=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-6%29" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F07%2Fsql-server-database-security-interview-questions-and-answers-row-level-security-sql-injection-data-masking-day-6%2F&amp;linkname=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-6%29" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F07%2Fsql-server-database-security-interview-questions-and-answers-row-level-security-sql-injection-data-masking-day-6%2F&amp;linkname=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-6%29" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F07%2Fsql-server-database-security-interview-questions-and-answers-row-level-security-sql-injection-data-masking-day-6%2F&amp;linkname=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-6%29" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F07%2Fsql-server-database-security-interview-questions-and-answers-row-level-security-sql-injection-data-masking-day-6%2F&amp;linkname=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-6%29" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F07%2Fsql-server-database-security-interview-questions-and-answers-row-level-security-sql-injection-data-masking-day-6%2F&amp;linkname=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-6%29" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F07%2Fsql-server-database-security-interview-questions-and-answers-row-level-security-sql-injection-data-masking-day-6%2F&#038;title=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-6%29" data-a2a-url="https://www.dbrnd.com/2016/07/sql-server-database-security-interview-questions-and-answers-row-level-security-sql-injection-data-masking-day-6/" data-a2a-title="SQL Server: Database Security Interview Questions and Answers  (Day-6)"></a></p><p><strong>How do you grant a SQL Server developer truncate table permission without giving them the ability to alter the table?</strong></p>
<blockquote><p>This is accomplished by a DBA creating a stored procedure with the TRUNCATE TABLE statements and then granting execute permission on the stored procedure to those who need it.</p></blockquote>
<p><strong>I have a table where some of the columns should not be queryable by all users. How can I filter the data appropriately, so that not everyone can select the data?</strong></p>
<blockquote><p>One of the easiest ways to do this is through the use of views.</p>
<p>If we can use a view, we can successfully filter the data and grant the users access to the view, we can present just the data we want the users to have access to.</p>
<p>however, there are two requirements for this:</p>
<ul>
<li>The users do not already have the ability to select data from the table.</li>
<li>A view can be created where an ownership chain can be established with the table.</li>
</ul>
</blockquote>
<p><strong>How to grant only few columns without creating views?</strong></p>
<p>We can assign column list to table.</p><pre class="crayon-plain-tag">GRANT SELECT ON dbo.Employee (EmployeeID, FirstName, MiddleName, SurName) TO HR_Intern;</pre><p>
<strong>I can create Stored Procedure, but However, when I went to execute the stored procedure, SQL Server told me I didn&#8217;t have permission to do so. Is this a bug or did I do something wrong?</strong></p>
<blockquote><p>This is entirely possible if you have the ability to create a stored procedure in a schema you don&#8217;t own.</p>
<p>In this particular case we&#8217;ve created a role that has the ability to create stored procedures in the database and the ability to alter the dbo schema. By default, the dbo schema is owned by the database owner.</p></blockquote>
<p><strong>What do you know about the SQL Server 2016 Row Level Security?</strong></p>
<blockquote><p>SQL Server 2016 has introduced Row Level Security (RLS) which is a feature that enables fine grained control over access to rows in a table. RLS allows you to easily control which users can access which data with complete transparency to the application.This enables us to easily restrict the data based on the user identity or security context.</p>
<p>Row-Level Security enables customers to control access to rows in a database table based on the characteristics of the user executing a query.</p></blockquote>
<p><strong>Which are the different predicates support by Row Level Security?</strong></p>
<blockquote><p>RLS supports two types of security predicates.</p>
<p>Filter predicates silently filter the rows available to read operations (SELECT, UPDATE, and DELETE).</p>
<p>Block predicates explicitly block write operations (AFTER INSERT, AFTER UPDATE, BEFORE UPDATE, BEFORE DELETE) that violate the predicate.</p></blockquote>
<p><strong>What do you know about the Dynamic Data Masking?</strong></p>
<blockquote><p>Dynamic data masking limits sensitive data exposure by masking it to non-privileged users. Dynamic data masking helps prevent unauthorized access to sensitive data by enabling customers to designate how much of the sensitive data to reveal with minimal impact on the application layer. It’s a data protection feature that hides the sensitive data in the result set of a query over designated database fields, while the data in the database is not changed.</p>
<p>For example, a call center support person may identify callers by several digits of their social security number or credit card number, but those data items should not be fully exposed to the support person. A masking rule can be defined that masks all but the last four digits of any social security number or credit card number in the result set of any query.</p></blockquote>
<p>What should be the characteristics for strong password?</p>
<ul>
<li>Is at least 8 characters long.</li>
<li>Combines letters, numbers, and symbol characters within the password.</li>
<li>Is not found in a dictionary.</li>
<li>Is not the name of a command.</li>
<li>Is not the name of a person.</li>
<li>Is not the name of a user.</li>
<li>Is not the name of a computer.</li>
<li>Is changed regularly.</li>
<li>Is significantly different from previous passwords.</li>
</ul>
<p><strong>How SQL Injection Works?</strong></p>
<blockquote><p>The primary form of SQL injection consists of direct insertion of code into user-input variables that are concatenated with SQL commands and executed. A less direct attack injects malicious code into strings that are destined for storage in a table or as metadata. When the stored strings are subsequently concatenated into a dynamic SQL command, the malicious code is executed.</p>
<p>The injection process works by prematurely terminating a text string and appending a new command. Because the inserted command may have additional strings appended to it before it is executed, the malefactor terminates the injected string with a comment mark &#8220;&#8211;&#8220;. Subsequent text is ignored at execution time.</p></blockquote>
<p><strong>What are your best practices to avoid SQL Injection?</strong></p>
<ul>
<li>Validate all input.</li>
<li>Use Type-Safe SQL Parameters.</li>
<li>Use Parameterized Input with Stored Procedures.</li>
<li>Wrapping Parameters with QUOTENAME() and REPLACE().</li>
<li>Use the Parameters Collection with Dynamic SQL.</li>
</ul>
<p><strong>How Do You Determine What Data Are Confidential?</strong></p>
<ul>
<li>We should to contact our legal department (if there is one), an attorney, or law professor, if in doubt about data.</li>
<li>Ask about, What type of data should we be extra cautious about?</li>
<li>Ask government officials or look at government websites on the industry we are in.</li>
<li>We should think like a hacker.</li>
</ul>
<p><strong>Have you seen any performance hit using SQL Server Transparent Data Encryption (TDE)?</strong></p>
<blockquote><p>Given that you are performing more operations, there is some. One advantage to TDE is that the data is only encrypted in disk. So if it&#8217;s in SQL Server&#8217;s memory buffers, there&#8217;s no repeated decryption going on.</p></blockquote>
<p><strong>Any concerns about the SQL Server public database role?</strong></p>
<blockquote><p>Yes, the general recommendation is to avoid using the public role. Every database user is a member of public. As a result, any permissions assigned to it are also assigned to every database user.</p></blockquote>
<p><strong>What do you use to avoid the SQL Server fixed server roles?</strong></p>
<blockquote><p>The recommended practice is to create a role and assign explicit permissions.</p>
<p>A developer wants to execute a SQL Server stored procedure in debug mode. I believe SQL Server sysadmin level access required to use debug mode. I don&#8217;t want to give sysadmin access to the developer. Is there any I can handle this without giving sysadmin access?</p>
<p>Unfortunately, there is not. Debugging requires sysadmin role membership.</p></blockquote>
<p><strong>Is it possible to grant linked server permissions to Windows user group?</strong></p>
<blockquote><p>Yes: A Windows group is no different from any other login.</p></blockquote>
<p><strong>T-SQL Script to find mismatched between Database Login and Server Login.</strong></p><pre class="crayon-plain-tag">SELECT d.[name] AS 'DB User', s.[name] AS 'Login', s.sid AS 'SID'
FROM sys.database_principals d
 JOIN sys.server_principals s
 ON d.sid = s.sid
WHERE d.[name] &lt;&gt; s.[name];</pre><p>
<strong><br />
What is the main hierarchy of Permissions?</strong><br />
<a href="https://msdn.microsoft.com/en-us/library/ms191465.aspx" target="_blank">Please visit this Microsoft official documents:</a></p>
<p><strong>What should be your common practice for SQL Server Security?</strong></p>
<ul>
<li>SQL Server should be hardened after the installation.</li>
<li>After the installation, use the SQL Server Configuration Manager tool in order to disable unnecessary features and services.</li>
<li>Install only required components.</li>
<li>Recent service packs and critical fixes should be installed for SQL Server and Windows.</li>
<li>Windows Authentication mode is more secure than SQL Authentication.</li>
<li>If there is still a need to use SQL Authentication – enforce strong password policy.</li>
<li>Disable the SA account and rename it. Do not use this account for SQL server management.</li>
<li>Change default SQL Server ports associated with the SQL Server installation to keep hackers from port scanning the server.</li>
<li>Hide SQL Server instances or disable the SQL Server Browser service.</li>
<li>Remove BUILDIN\Administrators group from the SQL Server Logins.</li>
<li>Enable logging SQL Server login attempts (failed &amp; successful).</li>
<li>Defining Database Ownership to Increase Security.</li>
<li>Disabling certain system stored procedures.</li>
</ul>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQL Server: Database Developer (T-SQL) Interview Questions and Answers (Day-12)</title>
		<link>https://www.dbrnd.com/2016/06/sql-server-2016-database-developer-t-sql-interview-questions-and-answers-json-query-store-row-level-secuity-day-12/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Thu, 23 Jun 2016 18:41:48 +0000</pubDate>
				<category><![CDATA[SQL Server Interview]]></category>
		<category><![CDATA[answers]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[Database Developer]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[DATETIME]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[Interviews]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[questions]]></category>
		<category><![CDATA[row level security]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tunning]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[T-SQL]]></category>
		<category><![CDATA[TIMESTAMP]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=3069</guid>

					<description><![CDATA[What are the new development features of SQL Server2016? Native JSON Support Always Encrypted Query Store Live Query Statistics Row Level Security Temporal database support What does the Query Store do in SQL Server 2016? Store the history of query plans in the system. Capture the performance of each query plan over time. Identify queries [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F06%2Fsql-server-2016-database-developer-t-sql-interview-questions-and-answers-json-query-store-row-level-secuity-day-12%2F&amp;linkname=SQL%20Server%3A%20Database%20Developer%20%28T-SQL%29%20Interview%20Questions%20and%20Answers%20%28Day-12%29" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F06%2Fsql-server-2016-database-developer-t-sql-interview-questions-and-answers-json-query-store-row-level-secuity-day-12%2F&amp;linkname=SQL%20Server%3A%20Database%20Developer%20%28T-SQL%29%20Interview%20Questions%20and%20Answers%20%28Day-12%29" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F06%2Fsql-server-2016-database-developer-t-sql-interview-questions-and-answers-json-query-store-row-level-secuity-day-12%2F&amp;linkname=SQL%20Server%3A%20Database%20Developer%20%28T-SQL%29%20Interview%20Questions%20and%20Answers%20%28Day-12%29" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F06%2Fsql-server-2016-database-developer-t-sql-interview-questions-and-answers-json-query-store-row-level-secuity-day-12%2F&amp;linkname=SQL%20Server%3A%20Database%20Developer%20%28T-SQL%29%20Interview%20Questions%20and%20Answers%20%28Day-12%29" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F06%2Fsql-server-2016-database-developer-t-sql-interview-questions-and-answers-json-query-store-row-level-secuity-day-12%2F&amp;linkname=SQL%20Server%3A%20Database%20Developer%20%28T-SQL%29%20Interview%20Questions%20and%20Answers%20%28Day-12%29" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F06%2Fsql-server-2016-database-developer-t-sql-interview-questions-and-answers-json-query-store-row-level-secuity-day-12%2F&amp;linkname=SQL%20Server%3A%20Database%20Developer%20%28T-SQL%29%20Interview%20Questions%20and%20Answers%20%28Day-12%29" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F06%2Fsql-server-2016-database-developer-t-sql-interview-questions-and-answers-json-query-store-row-level-secuity-day-12%2F&#038;title=SQL%20Server%3A%20Database%20Developer%20%28T-SQL%29%20Interview%20Questions%20and%20Answers%20%28Day-12%29" data-a2a-url="https://www.dbrnd.com/2016/06/sql-server-2016-database-developer-t-sql-interview-questions-and-answers-json-query-store-row-level-secuity-day-12/" data-a2a-title="SQL Server: Database Developer (T-SQL) Interview Questions and Answers (Day-12)"></a></p><p><strong>What are the new development features of SQL Server2016?</strong></p>
<ul>
<li>Native JSON Support</li>
<li>Always Encrypted</li>
<li>Query Store</li>
<li>Live Query Statistics</li>
<li>Row Level Security</li>
<li>Temporal database support</li>
</ul>
<p><strong>What does the Query Store do in SQL Server 2016?</strong></p>
<ul>
<li>Store the history of query plans in the system.</li>
<li>Capture the performance of each query plan over time.</li>
<li>Identify queries that have &#8220;gotten slower recently&#8221;.</li>
<li>Allow you to force plans quickly.</li>
</ul>
<p><strong>What do you know about Live Query Statistics of SQL Server 2016?</strong></p>
<blockquote><p>It is a new feature of SQL Server2016 that allows you to view what is happening during the query execution.</p>
<p>It lets you view a list of active queries and associated statistics such as current CPU/Memory usage, execution time, query progress, and so on.</p></blockquote>
<p><strong>What is a good alternative of XML data type in SQL Server 2016?</strong></p>
<blockquote><p>The newly introduced JSON data type is one of the best option and alternative of XML data type.</p></blockquote>
<p><strong>Why JSON is becoming more important than XML?</strong></p>
<blockquote><p>One of the biggest reasons JSON is becoming more important than XML is that XML has to be parsed with an XML parser, while JSON can be parsed by a standard JavaSript function and it is very light-weight.</p>
<p>This makes it easier and faster than working with XML.</p></blockquote>
<p><strong>What is Row-Level Security in SQL Server 2016?</strong></p>
<blockquote><p>Row-Level Security: RLS enables developers and DBAs to control access to rows in a database table. Using RLS, you can store data for different customers, departments, or tenants in the same table, while restricting access to rows based on a query&#8217;s execution context.</p></blockquote>
<p><strong>What are the two types of character data SQL Server supports?</strong></p>
<ul>
<li>Regular and Unicode.</li>
<li>Char and Varchar is Regular character data type.</li>
<li>NChar and NVarchar is Unicode character data type.</li>
</ul>
<p><strong>How are literal strings expressed with the Unicode character column?</strong></p>
<blockquote><p>It must start with N&#8217;text&#8217;.</p></blockquote>
<p><strong>What is the difference between Datetime and Timestamp data types?</strong></p>
<blockquote><p>Datetime is a data type.</p>
<p>Timestamp is a data type that exposes automatically generated binary numbers, which are guaranteed to be unique within a database. Timestamp is used typically as a mechanism for version-stamping table rows. The storage size is 8 bytes.</p>
<p>Timestamp is a synonym of the Rowversion data type.</p></blockquote>
<p><strong>What is SWITCHOFFSET function?</strong></p>
<blockquote><p>SWITCHOFFSET function is used to convert the time from one time zone to another time zone, and it will work for date time offset fields.</p></blockquote>
<p><strong>How to SELECT n Random records from a Table in the database?</strong></p><pre class="crayon-plain-tag">SELECT TOP 3 *FROM tbl_TableName ORDER BY NEWID();</pre><p>
<strong>Which stored procedure is used to send an email in SQL Server?</strong></p>
<blockquote><p>sp_send_dbmail: The msdb database stored procedure.</p></blockquote>
<p><strong>Which stored procedure is used to update a description of the column?</strong></p>
<blockquote><p>We can update column description using sp_updateextendedproperty.</p></blockquote>
<p><strong>How we can get the Database name using SQL Command?</strong></p><pre class="crayon-plain-tag">SELECT DB_NAME();</pre><p>
<strong>I want to concatenate NULL value with string and do not require output as NULL only.</strong><br />
<strong> How do you achieve this?</strong><br />
<strong> Using,</strong></p><pre class="crayon-plain-tag">SET CONCAT_NULL_YIELDS_NULL ON / OFF;

SET CONCAT_NULL_YIELDS_NULL ON:
PRINT 'dbrnd.com' + NULL;
Result is NULL.

SET CONCAT_NULL_YIELDS_NULL OFF:
PRINT 'dbrnd.com' + NULL;
Result is dbrnd.com</pre><p>
<strong>How can you insert multiple rows together in a single insert statement?</strong></p><pre class="crayon-plain-tag">INSERT INTO tbl_Tablename 
(id,name)
VALUES
(1,'abc'),(2,'xyz'),(3,'pqr');</pre><p>
<strong>How will you delete all records of table other then recently added 10 records?</strong></p><pre class="crayon-plain-tag">DELETE FROM table_name
WHERE id not in 
(
	SELECT TOP 10 ID FROM 
	table_name ORDER BY date DESC
);</pre><p>
<strong>What is the solution of below error?</strong></p>
<p><strong>Msg 7411, Level 16, State 1, Procedure , Line 3 Server &#8216;SERVERNAME\MSSQL2012&#8217; is not configured for DATA ACCESS.</strong></p>
<p>Require to enable DATA ACCESS on SQL Server Instance.</p><pre class="crayon-plain-tag">EXEC sp_serveroption 'SERVERNAME\MSSQL2012', 'DATA ACCESS', TRUE</pre><p>
<strong>Can you execute Stored Procedure in View?</strong></p>
<blockquote><p>Yes: Using OPENQUERY, we can execute stored procedure in view.</p></blockquote>
<p><strong>What is a @@FETCH_STATUS in T-SQL?</strong></p>
<blockquote><p>To know the status of the last cursor FETCH statement issued against any cursor currently opened by the connection.</p></blockquote>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
