Category: SQL Server

How to Create a Column with a Configurable Floating-Point Type in SQL Server

At first I tried it with a column of type Real, so the column definition was, for example, Column(1,1), but that always gave me an error “Parameter or variable ‘Column’ has an invalid data type.”. So I tried it with the Decimal data type instead. In general, let’s take the column definition Column(2,1) as an …

Read More How to Create a Column with a Configurable Floating-Point Type in SQL Server

How to fix the error There is already an open DataReader associated with this Command which must be closed first.

I have now applied this fix on my website sunamo.cz/sunamo.net. I had run into this error before when opening several pages in a row, but I did not know what it meant, since I do not use the SqlDataReader or DataReader class anywhere in the application. Then today I tried to open all 7 of …

Read More How to fix the error There is already an open DataReader associated with this Command which must be closed first.

How to Get a Website Running on Full IIS, Including a SQL Server Express with Advanced Services Database

I am writing this guide mainly for myself, in case I ever need to reinstall Windows 8, so it may not match your needs exactly. I am working with W8 here (not W8.1) because my PC comes with an installation disc for W8. However, the upgrade to W8.1 is free for everyone, so I tried …

Read More How to Get a Website Running on Full IIS, Including a SQL Server Express with Advanced Services Database

Operating system error 5 (Access is denied), or What to do when you can’t attach a SQL Server database?

It’s really simple. I went through a lot of pages that mostly advised changing the account the SQL Server service runs under to your own account, but I didn’t want to do that. After all, if it were meant to be that way, MS would have set it up like that, and it wouldn’t run …

Read More Operating system error 5 (Access is denied), or What to do when you can’t attach a SQL Server database?

Which is better for storing empty values in SQL Server 2012 in terms of size – an empty string or null?

Testing methodology: 2 databases were created, each with a single table containing only an int column and an NVarChar(20) column. The first one always received NULL values in the NVarChar column, while the second database received empty strings. Once again, my goal here is to save as much space as possible. And the result? The …

Read More Which is better for storing empty values in SQL Server 2012 in terms of size – an empty string or null?