Sometimes we have to search what Collation is supported by SQL Server, for example, if we know our computer system is English Windows edition , and English Visual Studio, so what the collation exactly is supported by default when you directly add a SQL Server file such as a SQL Server Compact 4.0 file ? [Read More ...]

Seems there is few help information on internet that how to import an existing SQL Server data table structure into Microsoft Visio 2010, or there are some information, but when you read them, you are always confused because most of them missed some important steps. OK, now people are using Microsoft Office 2010, so the [Read More ...]

The last time we posted “Install Microsoft SQL Server Compact 4.0”, Some friends feed backed they could not see anything about SQL Server Compact 4.0 in their Visual Studio 2010. Firstly, you have to upgrade your Visual Studio 2010 to sp1. However, after you upgrade and installed SQL Server Compact 4.0, you might still not [Read More ...]

How to select last 5 or 10 or … rows in a SQL Server data table ? Solution 1: This is the normal solution SELECT TOP N * FROM MyTable ORDER BY Id DESC Solution 2:  Solution 1 is the normal way but when the data table is huge but the Id is not indexed, [Read More ...]

There are lots of ways to update a table data, here we have one example as the following: UPDATE HOSTDB SET InScan = NOWHOSTDB.InScan, Alarm1 = NOWHOSTDB.Alarm1, Alarm2 = NOWHOSTDB.Alarm2, Alarm3 = NOWHOSTDB.Alarm3, Alarm4 = NOWHOSTDB.Alarm4 FROM HOSTDB, NOWHOSTDB WHERE HOSTDB.idx = NOWHOSTDB.HOSTDBidx AND HOSTDB.idx = 1640

There was a coder wrote the following code about  a SQL Server saving operation: public static bool SaveToDatabase(string strTab, string strSql, SqlConnection Sqlcn, DataSet ds) {     SqlCommand comm = new SqlCommand();     comm.CommandText = strSql;     comm.Connection = Sqlcn;     comm.CommandType = CommandType.Text;     SqlDataAdapter sda = new SqlDataAdapter(comm);     SqlCommandBuilder scb = new [Read More ...]

There is a table structure here: CREATE TABLE [dbo].[FEEDBACK_LOG]( [Idx] [int] IDENTITY(1,1) NOT NULL, [FBIdx] [bigint] NOT NULL, [EventStatus] [int] NULL, [StartTime] [datetime] NOT NULL, [EndTime] [datetime] NOT NULL, [Length] [int] NOT NULL, CONSTRAINT [PK_FEEDBACK_LOG] PRIMARY KEY CLUSTERED ( [Idx] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS [Read More ...]

We have already had a post about “Clear ID counter after delete data table” which is just for reset identity column in SQL Server using Truncate command. However, Truncate is just the one method of resetting Identity in SQL Server, and it is only for the table which no foreign keys defined. If you use [Read More ...]

When we have huge data and we need to display data in client side page by page, the best way might be paging data in SQL Server side, otherwise the huge data retrieving will be ‘dead’ in your client side. Now we have a table as following: CREATE TABLE [dbo].[USER_EVENTS_LOG]( [LogEventsUserID] [int] IDENTITY(1,1) NOT NULL, [Read More ...]

For Microsoft languages developer, SQL Server 2005 / 2008 Management Studio Express is a required database management tool. But, at least for SQL Server 2005 / 2008 Management Studio Express, people all complained it is not easy to install, we always got error or trouble to install it. Here let us try to do one [Read More ...]

© 2013 CodeEase.com Suffusion theme by Sayontan Sinha