Tag: .net

Validating the existence of 350 million files over a network

I have a SQL Server table with around ~300,000,000 absolute UNC paths and I’m trying to (quickly) validate each one to make sure the path in the SQL Server table actually exists as a file on disk. At face value, I’m querying the table in batches of 50,000 and incrementing a counter to advance my […]

Does SQL Server Management Studio come with Visual Studio?

I have the full Visual Studio 2010 (not express) installed, with SQL Server that came with it as well: I was trying to locate SQL Server Management Studio (ssms) in order to follow this tutorial but I can’t seem to find it in my installation. I could theoretically download the 2008 Management Studio Express but […]

What is the purpose of System.Data.SqlClient.SqlParameter.IsNullable?

I’m currently trying to write a simple C# wrapper class for all the stored procedures in a database. While building some parameters in C#, I noticed the property SqlParameter.IsNullable and wondered what this is for. As far as I am aware, it is not possible to declare a stored procedure parameter as NOT NULL and […]

Where can i find information on creating plugins for SQL Server Management Studio?

I have read that while plug-ins are not supported for SQL Server Management Studio, it can be done. Does anyone have any resources or advice on how to go about it using C#? A company that is currently offering plug-ins to Management Studio is Red Gate: http://www.red-gate.com/products/SQL_Refactor/index.htm

Multiple databases with slightly changing models. How do I allow `EF` to work with different database structures at run-time?

I am working with EF6, MSSQL, Oracle, .NET4.5 on a system that is used globally across company (many departments) to query different databases that belong to our department, that have mostly same EF model, some databases are Oracle and some are Microsoft SQL, some are development or uat, some are logs. I am using different […]

Add SQL query options to NHibernate query

I’m working with some code that generates ICriteria queries for NHibernate. They get executed using ActiveRecord and ActiveRecordMediator.FindAll() For certain queries, I need to optimise them by adding on an OPTION (HASH JOIN) hint at the end of the SELECT statement. Is there a quick way I can do this? I don’t want to rewrite […]

SQLDatareader via CLR not returning SQL Message right way

I execute the following code via CLR, is there a reason why the message is not printed to the SQL Server, does it need to wait until the Stored Procedure returns all the rows (there is about 7 Billion rows to return) SqlCommand cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = […]

How to protect SqlLocalDB database file with custom password

I have designed a software using SqlLocalDb v11.0 instance. The database will be on user’s machine (.mdf file). I was using SQL Server CE before. In SQL Server CE my database is protected by a password with “Encryption Mode = Engine Default” Is there any way to protect SqlLocalDB? I know there is a way […]

Prepared statements and the built-in connection pool in .NET

I have a long-running service with several threads calling the following method hundreds of times per second: void TheMethod() { using (var c = new SqlConnection(“…”)) { c.Open(); var ret1 = PrepareAndExecuteStatement1(c, args1); // some code var ret2 = PrepareAndExecuteStatement2(c, args2); // more code } } PrepareAndExecuteStatement is something like this: void PrepareAndExecuteStatement*(SqlConnection c, args) […]

SQL Server 2008 RegEx CLR Use

OK, I realize that SS 2008 doesn’t have native regex functions. I also see that it’s possible to add them using CLR. I found the regex CLR at http://msdn.microsoft.com/en-us/magazine/cc163473.aspx , but I don’t know what to do with them. So I have 2 questions. The regex is only used when importing records (up to 1,000,000 […]

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.