SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

New York City .NET

The author of the NYCdotNet blog is a VB.NET and SQL server developer living and working in New York City. The author seeks to promote clean, readable, efficient code in both VB and SQL from design to development, deployment, and application maintenance.

How to get Open Live Writer working with Blogger

Wow – I didn’t blog at all in 2016!  While I’m certain that falls squarely on me, perhaps a small part of it is related to a bug connecting to Blogger (formerly Blogspot) blogs in my favorite blogging software – Open Live Writer.  This blog post explains the… Read more

0 comments, 916 reads

Posted in New York City .NET on 10 February 2017

Fixing Truncation Issues with T-SQL Flex

If you’ve worked with SQL Server for any length of time, you’ve run into this error:

Msg 8152, Level 16, State 14, Procedure MyProcedure, Line 162
String or binary data would be truncated.

While the problem is simple enough - you’re trying to put a big value in a small… Read more

0 comments, 664 reads

Posted in New York City .NET on 21 December 2015

Talking TypeScript on the .NET Rocks! Podcast

I appeared on the .NET Rocks podcast show #1149 this week.  I had a blast talking about TypeScript, the new ES6 features coming in TypeScript 1.5, and grunt-ts, our TypeScript compiler task for Grunt.

I wanted to add a few things.

Firstly, here are a number of additional links… Read more

2 comments, 765 reads

Posted in New York City .NET on 9 June 2015

Excel 2013 Conditional Formatting for Columns

If you have two columns in an Excel sheet, and you want to conditionally format fields in the second column when the values are not equal, do this:

Our starting point – we want Grape to be highlighted because it is not the same as Cherry.
Select all of column…

Read more

0 comments, 734 reads

Posted in New York City .NET on 14 January 2015

Enabling Portable Git in Node.js command prompt on Windows

GitHub for Windows doesn't put Git in the PATH by default.  If you'd like your Node.js command prompt to have the git command available by default, simply edit your nodevars.bat file.  By default, this is in C:\Program Files\nodejs\.  You will have to run your text editor in an administrative… Read more

0 comments, 987 reads

Posted in New York City .NET on 8 January 2015

Using an alternate TypeScript compiler inside Visual Studio

TypeScript team member Daniel Rosenwasser provided instructions for replacing the TypeScript compiler and language service used by Visual Studio here:


He also described how to update the lib.d.ts file later in the same issue:


These instructions are not guaranteed to work, so be sure to back up your…

Read more

0 comments, 1,102 reads

Posted in New York City .NET on 6 January 2015

Gmail and Match.com are Conspiring to Breakup My Marriage

My wife and I are happily married.  Both of us were surprised the other day when she started getting Match.com personals results sent to her GMail account!  She was a bit freaked out that it was some creepy malicious person, but it seems that it was just some end-user carelessness… Read more

0 comments, 655 reads

Posted in New York City .NET on 1 December 2014

Setting up WebStorm to debug grunt with TypeScript

It’s possible to use the WebStorm editor to debug grunt tasks if you are using TypeScript and generating .map files.  Assuming that grunt is already launching from the command line, here’s how to step into the debugger:
  • Open your project’s folder in WebStorm.
  • Click Run… Edit Configurations…
  • Add a new…

Read more

0 comments, 1,586 reads

Posted in New York City .NET on 28 November 2014

New Add-on for SSMS: T-SQL Flex

Do you ever copy query results out of SQL Server Management Studio, paste them into your text editor, and then perform gold-medal find + replace gymnastics to create T-SQL scripts?

Do you ever need to copy a small amount of data from one SQL server to another, but don’t want… Read more

5 comments, 10,560 reads

Posted in New York City .NET on 8 September 2014

How to Generate a Fiddler SAZ File

Fiddler is a free program that will log HTTP and HTTPS requests on Windows.  These instructions demonstrate how to use Fiddler to create an archive file (.SAZ) of these requests for troubleshooting purposes using the full version of Fiddler.  As an alternative, there is a simplified version of Fiddler available… Read more

0 comments, 2,048 reads

Posted in New York City .NET on 8 July 2014

Getting Started with the Modern.ie VMs on VirtualBox with IIS Express

Microsoft has made pre-packaged Virtual Machine images available for purposes of testing different versions of IE via the modern.ie web site.  This blog post describes how you can get these VM images loaded into the free VirtualBox software and talking to an IIS Express web site running on your local… Read more

0 comments, 2,261 reads

Posted in New York City .NET on 22 May 2014

From Zero to Pull Request with Git on Windows

I wrote a guide about using Git and GitHub for "Windows people".

This is the guide I wish was available when I got started with Git last year.

The guide takes you through everything you need to know to get started with Git and GitHub, and only requires a Windows… Read more

0 comments, 1,663 reads

Posted in New York City .NET on 16 April 2014

Rounding versus truncating

Be careful when implicitly converting data types in T-SQL.  Directly assigning 1.5 (either as a FLOAT or a NUMERIC) to an INT value in SQL Server may truncate the value to 1 rather than rounding it up as you might expect.  Explicitly calling ROUND( ,0) as part of the assignment… Read more

0 comments, 1,029 reads

Posted in New York City .NET on 15 April 2014

Query to Find "Update" Dependencies on a Table or View (SQL Server 2012)

The built-in dependency finder in SQL Server Management Studio does not provide the ability to distinguish between dependencies that are read-only and dependencies that are read-write.  However, SQL Server 2012 does make this information available via the management views.


The query below will return all of the objects that… Read more

2 comments, 2,768 reads

Posted in New York City .NET on 23 July 2013

How To Make Your DLL Into A NuGet Package for a Private NuGet Feed

This is my reinterpretation of the documentation on NuGet.org, modified to remove the public publishing steps, and to add local publishing steps and a source control reminder.  This guide is intended to help enable the benefits of NuGet for proprietary code such as business-specific DLLs that are not fit… Read more

1 comments, 19,493 reads

Posted in New York City .NET on 5 June 2013

Performing an INSERT from a PowerShell script

This code demonstrates how to do an INSERT into SQL Server from a PowerShell script using an ADO.NET command object with strongly-typed parameters.  This script issues a DIR *.* command and inserts the results to the database.  While this example is not particularly useful, it is hopefully very simple and… Read more

8 comments, 63,278 reads

Posted in New York City .NET on 24 May 2013

Setting up an Internal Friendly URL

Note: This solution is not necessarily the best or most efficient solution in all cases.  It is, however, very simple and works with any site - even ones you have no control over.


Internal Web System XYZ must be accessed via an ugly URL such as http://randomservername.internalexample.com:8675309/SomeCrazyPath/SomeFile.htm

Desired End… Read more

1 comments, 2,619 reads

Posted in New York City .NET on 27 February 2013

Using SkyDrive at Work for Collaboration - A Quick Start Guide

It seems that many of my projects in the past year or so have required sharing files with external business partners.  I've found that SkyDrive has been quite useful for this purpose.  Here's how to get started quickly and securely sharing files.

Setting up SkyDrive sync:

1. If you don't…

Read more

1 comments, 1,132 reads

Posted in New York City .NET on 6 February 2013

Using Inline “With” Blocks to Augment a VB.NET Default Constructor

Say you have a simple data transfer class that looks like this:

Public Class Employee
    Public Property Name As String
    Public Property HireDate As Date
    Public Property EmployeeID As Integer
End Class

Normally to load up this class, you might call something like this:

Dim employee As…

Read more

2 comments, 1,123 reads

Posted in New York City .NET on 2 February 2013

IIS Express Quickie Command-line

This is a reminder to my future self for how to quickly start IIS Express from the command-line on 64-bit Windows 7 or 8 assuming you already have IIS Express installed using the defaults.

  1. Open admin command line.
  2. cd\Program Files (x86)\IIS Express
  3. iisexpress /path:c:\YourApplicationRootFolder /port:WhateverPortNumber

Note: You can also specify… Read more

1 comments, 3,311 reads

Posted in New York City .NET on 24 November 2012

Older posts