Tags » SQL Query

Select all columns which are not null in a table in SQL Server

Sometimes there happens to be a situation where we have a table containing more than 30 or 40 columns and most of the columns contain no value(null) (Assuming that null columns are not defined as a sparse column). 253 more words

SQL Server

What exactly happens when you fire a query?

This is for them the people who are needing to start as an Oracle DBA. If they have to make a sensible picture of Oracle Architecture by then, in particular, they need to perceive what is SQL query lifecycle in Oracle. 423 more words


R: Connecting to SQL Server Database

You can query data from a SQL Server database directly from R using the RODBC package.


First you need to form a connection

##connection string
cn <- odbcDriverConnect(connection="Driver={SQL Server Native Client 11.0};server=localhost; database=SSRSTraining;trusted_connection=yes;") 164 more words

List of SQL commands


SQL, ‘Structured Query Language’, is a programming language designed to manage data stored in relational databases. SQL operates through simple, declarative statements. This keeps data accurate and secure, and helps maintain the integrity of databases, regardless of size. 788 more words

SQL Query

Custom Stored Procedure to capture current Disk Space utilization details for monitoring purpose

Here are the required steps to capture Disk space details using a custom stored procedure.

  1. Connect SSMS.
  2. Open a new query window (Ctrl+n)
  3. Copy paste the below code in the query window.
  4. 264 more words

SDSS DR 7: Query linking the RunQA table

Query to get the seeing from the RunQA table:

 m.dr7objid, s.ra,s.dec,s.z,
 r.seeing_r into mydb.MyTable_116 from mydb.MyTable_97 as m,SpecObj as s, PhotoObj as p, RunQA as r
 WHERE m.dr7objid = p.objID AND p.fieldID = r.fieldID AND m.dr7objid = s.bestobjid

SQL Server: Linked Servers

SQL Server Linked Servers feature allows you to query data from other databases (even non SQL Server databases) from within SQL Server.

While I believe large data transfer jobs are best handled using an ETL solution like SSIS, sometimes all you want is a just a couple hundred rows of data from another database and setting up an ETL jobs might be overkill. 357 more words

MS SQL Server