RSSCategory: SQL

May

20

DML vs DDL

Posted by Leave a Comment

Most of the time, when referring to DML (Data Manipulation Language) and DDL (Data Definition Language), we are simply talking subsets of SQL commands.

Continue Reading

Sep

9

Use a SharePoint List as a Data Source in a SSRS Report

Posted by 5 Comments

In this example we will use a SharePoint list as a data source in a SSRS report using SQL Server 2012 Report Builder.

Begin by adding a new data source to your report. Select Microsoft SharePoint List under the connection type dropdown. For the connection string you will want to enter the root URL for your site/subsite. For example, if the URL for our list is http://technicaloverload.com/My-Test-List/, then you would enter http://technicaloverload.com/ in the connection sting box.
Continue Reading

May

1

Change the Default Database for a User in SQL Server

Posted by Leave a Comment

Here are three easy ways to change the default database for a user in SQL Server.

Option 1: Execute the system stored procedure sp_defaultdb

EXEC sp_defaultdb @loginame='UserName', @defdb='NewDefaultDB'

Continue Reading

Feb

14

Enable or Disable a Table Index in SQL Server

Posted by 1 Comment

Sometimes you may need to temporarily disable an index before performing an action. To do so in SQL Server you can use the ALTER INDEX statement.

To disable the index:

ALTER INDEX index_name ON tablename DISABLE

To enable it again you just need to rebuild:

ALTER INDEX index_name ON tablename REBUILD

Feb

1

Working With Duplicates in SQL Server

Posted by Leave a Comment

While none of our own databases would have issues with duplicate records, sometimes we have to work on those that are not so well designed. Below are a few handy queries for sorting out duplicate records.

First, an example of our table with duplicates highlighted:

SELECT * FROM Parts

Continue Reading

Jun

27

Change SELECT TOP Value in SSMS

Posted by Leave a Comment

If you want to change the value of the default ‘SELECT TOP 1000’ option when you right-click on a table in SQL Server Management Studio you can do so by going to the Tools -> Options menu:

Continue Reading