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
14
votes
3 answers

Select the rows that just inserted

How can I retrieve the row just inserted? INSERT INTO LETTRE_VOIT select rsVoit.NOID, NO_ORDRE, rsOrdre.CODE_DEST, rsOrdre.MODAL_MODE, rsOrdre.MODAL_PORT, CASE rsOrdre.MODAL_PORT WHEN 'false' THEN 'D' ELSE 'P' END,…
user609511
  • 4,091
  • 12
  • 54
  • 86
14
votes
2 answers

Change column name while using PIVOT SQL Server 2008

SELECT * FROM EmployeeAttributes PIVOT ( MAX(VALUE) FOR AttributeID IN ([DD14C4C2-FC9E-4A2E-9B96-C6A20A169B2E],[BE8149E2-0806-4D59-8482-58223C2F1735],[23B2C459-3D30-41CA-92AE-7F581F2535D4]) ) P Result EmployeeID …
Rauf
  • 12,326
  • 20
  • 77
  • 126
14
votes
3 answers

Converting Varchar to NVarchar?

I know when converting from nvarchar to varchar, some data will be lost/changed. However, are there any risks of data changing when converting a varchar data type to an nvarchar?
Curtis
  • 101,612
  • 66
  • 270
  • 352
14
votes
4 answers

How to convert int to date in SQL Server 2008

I am using MS SQL Server 2008, and in a table I have column idate as date but in the integer format. But in the query I want that in the date format. Is it possible to convert integer date into proper datetime format?
Vikrant More
  • 5,182
  • 23
  • 58
  • 90
14
votes
1 answer

Is this a bug in MERGE, failing to implement FOREIGN KEY properly?

I am using the following tables to implement subtypes, which is a very common approach: CREATE TABLE dbo.Vehicles( ID INT NOT NULL, [Type] VARCHAR(5) NOT NULL, CONSTRAINT Vehicles_PK PRIMARY KEY(ID), CONSTRAINT Vehicles_UNQ_ID_Type…
A-K
  • 16,804
  • 8
  • 54
  • 74
14
votes
1 answer

How to use a CTE in a left outer join?

I am trying to join a common table expression to an existing table (table1) as follows. select column1, column2 from table1 left outer join ;with cte as ( select column1, column2 from table2) select column1, column2 from cte on…
Sergey Koulikov
  • 267
  • 4
  • 7
  • 16
14
votes
8 answers

Programmatically copy indexes from one table to another in SQL Server

Basically the exact same question as in this question: How to copy indexes from one table to another in SQL Server, BUT, how do I do it programmatically in T-SQL, given a source table name and destination table name? I.e. without knowing what table…
Gareth
  • 2,424
  • 5
  • 26
  • 44
14
votes
2 answers

SSRS only displaying first row

I have a very basic report in SSRS that displays a grid of data. The query correctly returns multiple rows but the report only displays the first row. The query is as simple as SELECT * FROM... I dont have any special formatting and the tablix is…
Blaze
  • 1,863
  • 7
  • 23
  • 40
14
votes
3 answers

update and insert queries creating a deadlock

I will try to explain my problem as detailed as possible, and i would appreciate any help/suggestion. My problem is regarding a deadlock being caused by two queries (one insert and one update). I'm using MS-SQL server 2008 I have two applications…
Atzoya
  • 1,377
  • 13
  • 31
14
votes
2 answers

How could I force the data type of a computed column to a bit field that don't allow nulls?

I got a computed column that I need to be a bit field, here an example of formula : case when ([some_field] < [Some_Other_field]) then 0 else 1 end The data type of computed column set using this formula is int. What's the best way to force the…
DavRob60
  • 3,517
  • 7
  • 34
  • 56
14
votes
8 answers

Get Column names from a query without data

I have a view vwGetData which gets data from two tables t1,t2 and has fields: t1.Field1 [ALIAS1], t1.Field2, t2.Field3, t2.Field4, t2.Field5 [ALIAS5] I will provide below input Select * from vwGetData i want to get below output in…
Thakur
  • 1,890
  • 5
  • 23
  • 33
14
votes
6 answers

SQL Server 2008 Generate a Series of date times

I am trying to generate a table with a series of date times in it. I have the specified start date time and end date time(end date time is end of sequence), I add a time interval ~ (this can vary) to the start date time in seconds and this gives me…
mouse
  • 141
  • 1
  • 1
  • 3
14
votes
5 answers

T-SQL, Insert into with MAX()+1 in subquery doesn't increment, alternatives?

I have a query where I need to "batch" insert rows into a table with a primary key without identity. --TableA --PK int (Primary key, no-identity) --CustNo int INSERT INTO TableA (PK,CustNo) SELECT (SELECT MAX(PK)+1 AS PK FROM TableA), CustNo …
KorsG
  • 729
  • 1
  • 7
  • 16
14
votes
3 answers

How to add multiline text in varchar(MAX) field

I have created varchar(MAX) field as memo field. Unfortunately I do not find a way how to add multiline text into such field using MS SQL Server Management Studio. If I use copy/paste of multiline text only first line of multiline test is inserted…
Tomas
  • 17,551
  • 43
  • 152
  • 257
14
votes
4 answers

Retrieve the ID of an inserted record: Php & MS SQL SERVER

This question relates to: PHP Version 5.3.6 Microsoft Drivers for PHP for SQL Server I am trying to properly retrieve the ID of a record insert using a combination of PHP and SQL Server 2005 or 2008. This question assumes the existence of the…
Ralph M. Rivera
  • 769
  • 3
  • 12
  • 25