if condition in where clause of sql query

Below is my where clause of the query when i want data for a specific user where Completion_Date>= ’11/01/2011′ and Completion_Date<= ’12/11/2012′ and System_user_id = 1234 and below is the where clause when i want to pull data for all the user: where Completion_Date>= ’11/01/2011′ and Completion_Date<= ’12/11/2012′ Since i dont want 2 seperate queries, […]

Joining/Appending different tables together in Microsoft sql server

Hai all I have 3 different tables in a database in MS SQL SERVER. LAB_patientreg patient_master patient_address This LAB_patientreg and patient_master are two tables containing patient details (the patients in both table are different, LAB_patientreg is the table regarding the patients who registered in lab directly and patient_master is about the patient registered to hospital […]

Windows Integrated Authentication Conflict With MS-SQL 2000 DB Connection With Integrated Security

We are developing an intranet web application on .NET 2.0 platform. The application is using Integrated Windows Authentication for Single Sign On. The users are authorized to use diffent modules according to the Active Directory Groups they are in. Up to the point where authentication and authorization is accomplished everything works fine. But the problem […]

DbContext and Connection pools

In an application that I’ve inherited there’s this in a Base Controller, that every other controller in the application inherits from. public BaseController() { db = new MyDbContext(); db.Database.Log = s => Debug.Write(s); } public MyDbContext() : base(“name=MyDbContext”) { // hack to force Visual Studio to deploy the Entityframework.SqlServer package var instance = SqlProviderServices.Instance; } […]

Someway to do `where booleanvalue=false` on both Sql Server and PostgreSQL?

I am attempting to make an application capable of running on both Sql Server and PostgreSQL. I can not seem to find a common expression that is basically select * from table where booleancol=false on SQL Server I must do(which is very confusing because the default value for bit types must be true or false, […]

Validate telephone number in SQL Server 2000

Does anyone have a nifty way of validating telephone numbers using sql (SQL Server 2000). I need to select all users fro ma Db that have valid phone number Thanks Sp Valid number 08450000000 01332000000 07444000000 +441332000000 Standard UK numbers

SQL database structure for Like and DisLike

I am new to web programming and need some expert advise. I am using SQL database for one of my website project. My website will display a list of topics with a Like and Dislike button. Logged in users will be able to click on the Like or dislike button for each topic. I am […]

What happened with SQL English query?

SQL Server 2000 was deployed with English Query. At that time, I was young and new to SQL so I skipped that chapter. Now after years, there is again an idea of making a logical program which can understand simple user questions. Is there any alternative to that? Where is English Query now?

How can InstallShield check if SQL Server 2005 (3.1) Compact Edition (CE) is installed

I am developing a Windows desktop application which requires the SQL Server 2005 Compact Edition (SQLServerCE31-EN.msi) to be installed. I am using InstallShield 2011 to install this as a pre-requisite during the installation process. In order to come up with the pre-requisite definition I used Process Monitor to see that these registry locations are checked […]

Why does Dapper QueryAsync<T> behave differently from Query<T> with sproc return values?

I have a stored procedure that performs a check, and returns either a row or a non-zero return value: CREATE PROCEDURE dbo.ConditionalGet @ID INT AS BEGIN — this is a silly made up condition just to test the issue IF @ID % 2 = 1 BEGIN RETURN -1 END SELECT * FROM MyTable WHERE ID […]

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