How to start and stop Microsoft SQL Server from the command line

Start a command prompt using the "Run as administrator" option.  If you do not use this option you may be a message that 'Access is denied.' To start the default instance of SQL Server type the following in command … [Continue reading]

Equivalent of DUAL table in Microsoft SQL Server

I spent quite a few few years developing PL/SQL on Oracle databases and had grown accustomed to its syntax.  One of the things which I didn't enjoy was that the 'FROM' clause in a SELECT statement was required (it is not in TSQL).  This causes a  bit … [Continue reading]

T-SQL – Search Stored Procedure Code for Text

Find text in SQL Server Procedures

Often I have to search for stored procedures in SQL Server to find pieces of text.   The motivation for this is to find procedures which use a table or to look for code which the developer has done silly things like hardcoded directories (Boris....). … [Continue reading]

C# Methods with Unlimited Parameters

To create a method that can take unlimited parameters, utilize the params keyword in the method declaration.  This allows you to specify a method parameter that take an argument where the number of arguments is variable.   You are not allowed to have … [Continue reading]

How to determine the version and edition of SQL Server

Connect to the instance of SQL Server, and then run the following query (this will work for all versions of SQL Server): [crayon-632281b5ce2e3485795148/] The result form the query will look like the following. Microsoft SQL Server 2008 (SP1) - … [Continue reading]

How to get the column names of a table in SQL Server (T-SQL)

The following query can be run (substitute the ‘TableName’ in the query with the table name you want column information on) to get the column names for any table in T-SQL. [crayon-632281b5ce42f168572469/] [crayon-632281b5ce434021951720/] To get … [Continue reading]

How to take a screenshot on a iPad.

The iPad is a very easy to use device.  What is surprising is that sometimes things that you wouldn’t normally do everyday are possible but are hidden away. Thankfully taking a screenshot on the iPad is very easy to do.  All that is required is to … [Continue reading]

Enable xp_cmdshell using sp_configure

Microsoft SQL Server

When you install a SQL Server instance, any feature that is not necessary for the core engine to run has been disabled by default. xp_cmdshell is a significant security risk because it allows a compromised SQL Server to elevate the attack to the … [Continue reading]

About Carlos Ferreira

Put Bio here. … [Continue reading]