Category Archives: Uncategorized

SQL: Different ways to generate sequence

There was a question from the op regarding adding a new column to a query output by generating the cyclic sequence numbers from 1 to 3. Select A =identity(int,1,1),B,C from table_abs 1,A,41 2,B,13 3,C,90 4,D,91 5,E,98 6,F,12 7,G,54 8,H,16 For … Continue reading

Posted in SQL, SQL 2012, Uncategorized | Tagged , , | Leave a comment

SQL Server: Discuss Execute(SQL) At LinkedServer

Abstract This article details the use of “Execute AT LinkedServer” clause. It’s best in some ways when you are trying to run dynamic complex queries  across heterogeneous data source. There are many instances that OpenQuery/OpenRowSet and four-part qualifier calling might not … Continue reading

Posted in Uncategorized | Tagged , , , , , | Leave a comment

SQL : How to Find Unused Indexes details

The Dynamic Management View (DMV) named sys.dm_db_index_usage_stats that track  index usage details of the database. This DMV gives an information about an index which is being updated but not used in any seeks, scan or lookup operations. The below query list … Continue reading

Posted in SQL, Uncategorized | Tagged , , , | Leave a comment

PowerShell : CSV – Disk Space Report – Excel

Abstract Monitoring disk space utilization of server(s) is a critical and important job for any administrator. Keeping things organized might improve application availability and server availability. Being a database administrator for 10 years, I have faced and handled/managed lot of issues … Continue reading

Posted in PowerShell, Uncategorized | Tagged , , , | 1 Comment

SQL Server: Monitoring Disk Space with FSUTIL command line utility

Table of Contents Introduction Pre-requisites Data flow Enable xp_cmdshell Download SQL Code Output Conclusion References See Also Introduction This article talks about one of SQL method to fetch the disk usage details and use of T-SQL in conjunction with invoking … Continue reading

Posted in SQL, SQLCMD, Uncategorized | Tagged , , | Leave a comment

Disk Space GUI Tool – Multi Server(s) – Grid and Email Output

Monitoring server resources is critical and important job of any Administrator. Keeping things organized might improve application availability and server availability. Being a database administrator for 1o years have faced and handled/managed lot of issues with disk space. There are … Continue reading

Posted in PowerShell, Uncategorized | Tagged , , , | Leave a comment

Minimizing SQL Server DBCC CHECKDB Performance Impacts

Overview SQL Server is the most popular relational database management system, which is used by many organizations to maintain their data. Every user expects that data should be stored in a consistent and integrated form. SQL Server is equipped with … Continue reading

Posted in Uncategorized | Tagged | 1 Comment

SQL – MultiServer SQL Inventory – PowerShell

Inventory is a vital information,whether you’re a consultant or an in-house DBA, you need to have a reliable inventory of the servers you manage.This inventory can take any number of forms but, ideally, will allow some aggregation of information. When … Continue reading

Posted in PowerShell, SQL, Uncategorized | Tagged , , , , , | Leave a comment

MongoDB – Insert,Update,Upsert and Delete Examples – CRUD

In MongoDB we have to use either insert() or save() method to add the document to a collection Insert Single document > db.employee.insert(      {      “employee_id”:1101,      “name”:”Prashanth”,      “sal”:90000,      “dob”: new Date(1983,2,3,5,20),      “department”:          [              ‘DB Amdin’,’DB Developer’          ],      “Location”:”New York”      }); Insert Multiple document – We have to use … Continue reading

Posted in MongoDB, Uncategorized | Tagged , , , , , , | Leave a comment

T-SQL – Read CSV files using OpenRowSet

We can directly access a CSV file using T-SQL. Input file Configure server to run Ad Hoc Distributed Queries sp_configure ‘Ad Hoc Distributed Queries’,1 GO reconfigure GO Check for Microsoft Access Driver on your system SQL select [hour], UserID, [ReportLaunch] … Continue reading

Posted in SQL, Uncategorized | Tagged , , , , , , | 4 Comments