ASP.NET Update SQL

I have a SQL Server with a roster/information. I would like to update the table with situps, pushups, and Id. I know how to insert information into a table, but having trouble with the Update part of it. Here is my code: SqlConnection conns = new SqlConnection(ConfigurationManager.ConnectionStrings[“TestDBConnectionString1”].ConnectionString); SqlCommand cmd = new SqlCommand(“UPDATE test SET SitUps […]

Not Storing Decimal Point in SQL Server 2008 R2 Express

I am in the UK. I have a Windows 2008 server in Germany with SQL Server 2008 R2 Express installed on it. The regional settings for Windows are set to UK. SQL Server language is set to English. When I run sp_helplanguage @@LANGUAGE it shows that it is set to us_english I have numerous tables […]

Split a Description Column to 3 Columns, T-SQL / SQL Server 2008

I need to split a nvarchar(100) column into three nvarchar(28) columns without a known delimiter and without breaking mid-word. I am thinking that I would need to find the space that is near the 28th character, measure length and position of the word just before that space and decide weather the delimiter should be before […]

Data quality Services Internal behaviour

When creating a knowledge basis on DQS, we can only select SQL Server and Excel from the drop down. I want to query oracle. To do that, I thought of creating a view on SQL Server that selects from a Oracle linked server but I’m worried about performance. Lets say my table has 10k rows, […]

Correlating log entries, such as failed login attempts efficiently

I am looking for an efficient way to identify account brute forcing. My log database contains authentication log entries. Each entry has: time stamp username IP address login attempt results (success / fail ) I want to produce a report which indicates that which logins have been attacked. Attacked is defined as: unsuccessful login attempts […]

SQL – Group records by N dollar amount

My question is somewhat similar to Group by every N records in T-SQL however I want to group by a maximum dollar amount So I have 20 records with a total amount of 50,000, I need to break them into groups so that each group has a maximum amount of 10,000. I tried using a […]

Inserts become increasingly slow over time?

I have a simple console app written in C# with VS.NET 2012. I’m using a simple database with Entity Framework 5 (model first). I have two tables, Customer, and Email. Every email record has a reference to a customer record. I create the customer and email object, save them to the collection in the EF […]

How can I group by arbitary time period with SQL

This is similar but not equal to my previous question That was about how to summarize log-items per day. I use this SQL. SELECT [DateLog] = CONVERT(DATE, LogDate), [Sum] = COUNT(*) FROM PerfRow GROUP BY CONVERT(DATE, LogDate) ORDER BY [DateLog]; Now I want to improve that to summarize over an arbitary time period. So instead […]

Left Outer Join only if column exists (SQL server)

I’m using SQL Server Express and I’m trying to pull different columns from different tables using LEFT OUTER JOIN. It’s working great but only if all columns exist. So I’ve been reading for the past hour how to add a condition so that LEFT OUTER JOIN is done only if column exists. See code below […]

Counting records with a specific date value

I want to get all records entered with specific day, for example today: ALTER PROCEDURE [dbo].[SP_GET_QUEUESINFO_BY_DATE] @date nvarchar = ‘2012-09-21’ AS BEGIN declare @dateStart nvarchar(50) = @date + ‘ 00:00:00.0’ declare @dateEnd nvarchar(50) = @date + ‘ 23:59:59.437’; declare @returnData table (allQueue int,inQueue int,outQueue int) SELECT ‘table1’ as table_name, COUNT(*) FROM Queue as Counts UNION […]

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