Sql – tips and tricks

Sql Server 2008, 2012

Sql Server instance? How to specify in url:

Use %5C
Fx server=localhost%5Cinstancename
http://localhost:1521/?database=jan_20150414_attain17&server=localhost%5Csql2008

For reporting services:

Use underscore: _
http://localhost/reports_sql2008


 

Describe like commands in MS Sql:

exec sp_help <tablename>
exec sp_columns <tablename>

exec sp_helptext <SP>

 



 

Administrative sql

Get list of databases – ordered by creation date:

SELECT name, database_id, create_date
    FROM sys.databases 
    ORDER BY create_date DESC

 

 

Set backup to compress

EXEC sp_configure ‘backup compression default’, 1 ;
RECONFIGURE WITH OVERRIDE;
GO

 


 

SQL Learning:

Pluralsight courses:

http://www.pluralsight.com/tag/sql

http://www.pluralsight.com/courses/table-of-contents/sqlserver-2012ic

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s