Questions tagged [sql-server-2008]

Use this tag for questions specific to the 2008 version of Microsoft's SQL Server.

Extended support for SQL Server 2008 and 2008 R2 have ended on July 9, 2019. That means the end of regular security updates. (source: SQL Server 2008 End of Support.)

If you're still using SQL Server 2008, you should seroiusly consider upgrading your SQL Server to a supported version.

SQL Server 2008 (codename Katmai, version number 10.00) was released on August 6 2008, and aims to make data management self-tuning, self organizing, and self-maintaining with the development of SQL Server Always On technologies, to provide near-zero downtime. SQL Server 2008 also includes support for structured and semi-structured data, including digital media formats for pictures, audio, video, and other multimedia data. In current versions, such multimedia data can be stored as BLOBs (binary large objects), but they are generic bitstreams. Intrinsic awareness of multimedia data will allow specialized functions to be performed on them. According to Paul Flessner, Senior Vice President, Server Applications, Microsoft Corp., SQL Server 2008 can be a data storage backend for different varieties of data: XML, email, time/calendar, file, document, spatial, etc as well as perform search, query, analysis, sharing, and synchronization across all data types.

Other new data types include specialized date and time types and a Spatial data type for location-dependent data. Better support for unstructured and semi-structured data is provided using the new FILESTREAM data type, which can be used to reference any file stored on the file system. Structured data and metadata about the file is stored in the SQL Server database, whereas the unstructured component is stored in the file system. Such files can be accessed both via Win32 file handling APIs as well as via SQL Server using T-SQL; doing the latter accesses the file data as a BLOB. Backing up and restoring the database backs up or restores the referenced files as well. SQL Server 2008 also natively supports hierarchical data and includes T-SQL constructs to directly deal with them, without using recursive queries.

The Full-text search functionality has been integrated with the database engine. According to a Microsoft technical article, this simplifies management and improves performance. Spatial data will be stored in two types. A "Flat Earth" (GEOMETRY or planar) data type represents geospatial data which has been projected from its native, spherical, coordinate system into a plane. A "Round Earth" data type (GEOGRAPHY) uses an ellipsoidal model in which the Earth is defined as a single continuous entity which does not suffer from the singularities such as the international dateline, poles, or map projection zone "edges". Approximately 70 methods are available to represent spatial operations for the Open Geospatial Consortium Simple Features for SQL, Version 1.1.

SQL Server includes better compression features, which also helps in improving scalability. It enhanced the indexing algorithms and introduced the notion of filtered indexes. It also includes Resource Governor that allows reserving resources for certain users or workflows. It also includes capabilities for transparent encryption of data (TDE) as well as compression of backups. SQL Server 2008 supports the ADO.NET Entity Framework and the reporting tools, replication, and data definition will be built around the Entity Data Model. SQL Server Reporting Services will gain charting capabilities from the integration of the data visualization products from Dundas Data Visualization, Inc., which was acquired by Microsoft. On the management side, SQL Server 2008 includes the Declarative Management Framework which allows configuring policies and constraints, on the entire database or certain tables, declaratively. The version of SQL Server Management Studio included with SQL Server 2008 supports IntelliSense for SQL queries against a SQL Server 2008 Database Engine. SQL Server 2008 also makes the databases available via Windows PowerShell providers and management functionality available as Cmdlets, so that the server and all the running instances can be managed from Windows PowerShell.

Source

53837 questions
16
votes
1 answer

How to read / write geography data using C#, Entity Framework and SQL Server 2008?

I have a form from which the user will be able to enter the latitude and longitude of a certain point on the map. The data will be input as string values. I did some research and found out from various sources that the Entity Framework doesn't…
Filip Filipovic
  • 354
  • 3
  • 7
  • 20
16
votes
3 answers

conversion of a datetime2 data type to a datetime data type error with EF Code first?

I'm using EF Code first with my asp.net mvc application. here is my code: Request.RequestDate = DateTime.Now; the type of RequestDate is datetime in my database. and this is error that occurred when i use the above code!: The conversion of a…
16
votes
9 answers

SQL Server CTE -Find top parentID forEach childID?

I have a table which contains hierarchy data - something like: childID | parentID ____________________ 1 | 5 5 | 9 9 | 20 2 | 4 3 | 7 7 | 8 8 | 8 20 | 20 4 …
Royi Namir
  • 144,742
  • 138
  • 468
  • 792
16
votes
6 answers

Add Identity column to a view in SQL Server 2008

This is my view: Create View [MyView] as ( Select col1, col2, col3 From Table1 UnionAll Select col1, col2, col3 From Table2 ) I need to add a new column named Id and I need to this column be unique so I think to add new column as identity. I must…
Saeid
  • 13,224
  • 32
  • 107
  • 173
15
votes
1 answer

tsql last "occurrence of" inside a string

I have got field containing comma separated values. I need to extract the last element in the list. I have tried with this: select list_field, LTRIM(RTRIM(right(list_field, len(list_field) - CHARINDEX(',',list_field)))) But it returns the last part…
Alberto De Caro
  • 5,147
  • 9
  • 47
  • 73
15
votes
3 answers

SQL Select or Insert return ID

Alright so a quick SQL question here(using sql-server-2008). I have a mapping table names with the following columns ID DisplayName What I want to do is first SELECT [ID] FROM [names] WHERE [DisplayName] = 'chuck'; BUT, if the name 'chuck' doesn't…
Kelly Elton
  • 4,373
  • 10
  • 53
  • 97
15
votes
4 answers

Adding a nullable foreign key

I have two tables built like this (this is just a simplified and non-proprietary example): Person Table ----------- p_Id, f_name, l_name Job Table ---------- job_Id, job_desc I want to add a foreign key column, Persons.job_Id, that can be nullable…
Yatrix
  • 13,361
  • 16
  • 48
  • 78
15
votes
1 answer

Setting up Liquibase with MS-SQL Server

I am utilising Liquibase (www.liquibase.org) into our MVC3 SQL Server 2008 project to manage database migration/changes. However I'm stumbling on the first hurdle: Connecting to Microsoft SQL Server instance. I am looking at the quick start tutorial…
Dan Black
  • 1,167
  • 3
  • 14
  • 20
15
votes
5 answers

Using a HAVING clause in an UPDATE statement

This query SELECT FirstName, LastName, NCAAStats.AccountId, College_Translator.school_name, StatTypeId, COUNT(*) AS 'Count' FROM NCAAstats INNER JOIN College_Translator ON College_Translator.AccountID = NCAAstats.AccountId GROUP BY FirstName,…
Tyler DeWitt
  • 23,366
  • 38
  • 119
  • 196
15
votes
4 answers

How to use cursor to update record

i am using below query to update my all records but it starts update from second row how can i modify it to do changes from 1'st row ? i am using mssql 2008 i think i can not use @@FETCH_STATUS as 1'st line as it is global. thanks in advance use…
vivek
  • 849
  • 4
  • 14
  • 24
15
votes
3 answers

Create custom error message in check constraints in SQL SERVER 2008

I'd like to see the ability to attach custom error messages to CONSTRAINT objects, specifically CHECK constrints. Either directly or via a custom error number in sysmessages. I've seen developers have to create triggers. I think that's not a good…
oscar.fimbres
  • 1,145
  • 1
  • 13
  • 24
15
votes
1 answer

Bulk Insert w/ .fmt file: Operating system error code (null)

I'm trying to import a text file defined by a .fmt format. Instead of being comma-delimited, this text file is what I would call column-delimited (i.e. the first 8 characters is the first field, the next 3 characters is the second, etc). When I…
PowerUser
  • 11,583
  • 20
  • 64
  • 98
15
votes
2 answers

SQL Server 2008 and milliseconds

In SQL Server 2008, why do the following queries return the same value? -- These all return 2011-01-01 23:59:59.997 SELECT CAST('2011-01-01 23:59:59.997' as datetime) SELECT CAST('2011-01-01 23:59:59.998' as datetime) And why does the following…
Mass Dot Net
  • 2,150
  • 9
  • 38
  • 50
15
votes
3 answers

How do I select TOP 5 PERCENT from each group?

I have a sample table like this: CREATE TABLE #TEMP(Category VARCHAR(100), Name VARCHAR(100)) INSERT INTO #TEMP VALUES('A', 'John') INSERT INTO #TEMP VALUES('A', 'John') INSERT INTO #TEMP VALUES('A', 'John') INSERT INTO #TEMP VALUES('A',…
Legend
  • 113,822
  • 119
  • 272
  • 400
15
votes
3 answers

SQL Server 2008 compatibility with SQL Server 2005

What is the best way to use SQL Server 2008 as a development database, but ensure that the database is compatible with SQL Server 2005?
Brad Leach
  • 16,857
  • 17
  • 72
  • 88