Stories recently tagged with 'table'

How to bind a WPF Pivot Grid to MS Access DataBase(www.viblend.com)

submitted by viblendviblend(160) 1 year, 5 months ago

Binding of a WPF Pivot Grid to MS Access DataBase read more...

add a comment |category: |Views: 39

tags: another

NPOI with Excel Table and dynamic Chart(leniel.net)

submitted by lenielleniel(504) 2 years, 7 months ago

NPOI is a great open source project that enables us to create Excel spreadsheets in code using Microsoft .Net Framework. A reader of my blog commented on the post titled Creating Excel spreadsheets .XLS and .XLSX in C# about a problem he was having to get NPOI working with an Excel table bound to a chart. The chart should get updated whenever new data is inserted into the table. NPOI doesn't achieve what the user desires at first but in this post I experiment a workaround to the problem so that you can use NPOI to insert new data on a template spreadsheet that has a table bound to chart. Read on... read more...

add a comment |category: |Views: 361

tags: another

delete duplicate records in sql server table(logiclabz.com)

submitted by webtipswebtips(265) 2 years, 9 months ago

delete duplicate records in sql server table with or without primary key read more...

add a comment |category: |Views: 45

tags: another

SQL 2005 Server Side Paging using CTE (Common Table Expression)(softscenario.blogspot.com)

submitted by animaonlineanimaonline(275) 4 years, 3 months ago

When a application want to show the result from an SQL-query as a paged view, i.e. showing ten or fifteen result on first page, then have a "next" function to show the next page of results. To minimize traffic over the network, it is best practice to do the paging on the SQL-server, so that only the results you want to show is sendt to the application. With SQL Server 2005 this is quite easy using the new CTE capabilities and the new ROW_NUMBER() function. (using the AdventureWorks example database for SQL-2005 http://codeplex.com/) Consider the following T-SQL to select out all employees from Person.Contact: SELECT [FirstName] ,[MiddleName] ,[LastName] ,[EmailAddress] FROM [Person].[Contact] This will result in 19972 rows returned, and the paging logic has to be done on the client application. not good.. so first we implement the ROW_NUMBER() function like this: SELECT ROW_NUMBER() OVER (Order by [Person].[Contact].[LastName]) AS RowID, [FirstName] ,[MiddleName] ,[LastName] ,[EmailAddress] FROM [Person].[Contact] This will create a unique RowID for each row in the result. Now we need to wrap the result in a CTE using just the WITH [ctename] AS () statement: WITH AllEmployees AS (SELECT ROW_NUMBER() OVER (Order by [Person].[Contact].[LastName]) AS RowID, [FirstName] ,[MiddleName] ,[LastName] ,[EmailAddress] FROM [Person].[Contact]) Now we have all the Employees in a in-memory table called AllEmployees, and we can select from this table as any other table, with all the common clauses. Simplest term: SELECT [FirstName] ,[MiddleName] ,[LastName] ,[EmailAddress] FROM AllEmployees Then, to use this for a Server-side paging solution, the simplest way we use the RowID to establish what rows to return, either by using DECLARE [varname] or by putting the whole code into a Parameterized StoredProcedure like this: CREATE PROC GetPagedEmployees (@NumbersOnPage INT=25,@PageNumb INT = 1) AS BEGIN WITH AllEmployees AS (SELECT ROW_NUMBER() OVER (Order by [Person].[Contact].[LastName]) AS RowID, [FirstName],[MiddleName],[LastName],[EmailAddress] FROM [Person].[Contact]) SELECT [FirstName],[MiddleName],[LastName],[EmailAddress] FROM AllEmployees WHERE RowID BETWEEN ((@PageNumb - 1) * @NumbersOnPage) + 1 AND @PageNumb * NumbersOnPage ORDER BY RowID END The parameter for this procedure is used for the paging and when executed it will return a result based on how many results per page, and what page read more...

add a comment |category: |Views: 27

tags: another

Check for column in SQL Table and add if not there (learnmsnet.com)

submitted by omacdonomacdon(110) 4 years, 4 months ago

This article describes how to add a table to a column and check before adding if it exists. read more...

add a comment |category: |Views: 10

tags: another