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
197
votes
8 answers

How to create composite primary key in SQL Server 2008

I want to create tables in SQL Server 2008, but I don't know how to create composite primary key. How can I achieve this?
Ganesamoorthy
  • 3,623
  • 8
  • 25
  • 26
196
votes
11 answers

CROSS JOIN vs INNER JOIN in SQL

What is the difference between CROSS JOIN and INNER JOIN? CROSS JOIN: SELECT Movies.CustomerID, Movies.Movie, Customers.Age, Customers.Gender, Customers.[Education Level], Customers.[Internet Connection], Customers.[Marital Status],…
PriceCheaperton
  • 5,071
  • 17
  • 52
  • 94
193
votes
21 answers

A transport-level error has occurred when receiving results from the server

I'm getting a SQL Server error: A transport-level error has occurred when receiving results from the server. (provider: Shared Memory Provider, error: 0 - The handle is invalid.) I'm running Sql Server 2008 SP1, Windows 2008 Standard 64…
Chuck Conway
  • 16,287
  • 11
  • 58
  • 101
193
votes
18 answers

SQL-Server: Error - Exclusive access could not be obtained because the database is in use

I am actually trying to make a script (in Sql Server 2008) to restore one database from one backup file. I made the following code and I am getting an error - Msg 3101, Level 16, State 1, Line 3 Exclusive access could not be obtained because the…
Steam
  • 9,368
  • 27
  • 83
  • 122
189
votes
7 answers

Enable 'xp_cmdshell' SQL Server

I want to execute EXEC master..xp_cmdshell @bcpquery But I am getting the following error: SQL Server blocked access to procedure 'sys.xp_cmdshell' of component 'xp_cmdshell' because this component is turned off as part of the security…
edgarmtze
  • 24,683
  • 80
  • 235
  • 386
188
votes
27 answers

T-SQL split string

I have a SQL Server 2008 R2 column containing a string which I need to split by a comma. I have seen many answers on StackOverflow but none of them works in R2. I have made sure I have select permissions on any split function examples. Any help…
Lee Grindon
  • 2,117
  • 2
  • 16
  • 8
187
votes
32 answers

A connection was successfully established with the server, but then an error occurred during the pre-login handshake

I am getting following error when i am trying to connect Production DB from Local Environment. I was able to connect Production DB before, but suddenly i am getting following error, any idea? A connection was successfully established with the…
Jordon Willis
  • 4,851
  • 7
  • 27
  • 34
186
votes
38 answers

How to split a comma-separated value to columns

I have a table like this Value String 1 Cleo, Smith I want to separate the comma delimited string into two columns Value Name Surname 1 Cleo Smith I need only two fixed extra columns
Gurru
  • 2,013
  • 3
  • 17
  • 20
184
votes
3 answers

GRANT EXECUTE to all stored procedures

Does the following command effectively give the user, "MyUser," permission to execute ALL stored procedures in the database? GRANT EXECUTE TO [MyDomain\MyUser]
Chad
  • 23,658
  • 51
  • 191
  • 321
183
votes
10 answers

How to drop column with constraint?

How to drop a column which is having Default constraint in SQL Server 2008? My query is alter table tbloffers drop column checkin I am getting below error ALTER TABLE DROP COLUMN checkin failed because one or more objects access this column. Can…
Robin Michael Poothurai
  • 5,444
  • 7
  • 23
  • 36
182
votes
25 answers

Cannot open backup device. Operating System error 5

Below is the query that I am using to backup (create a .bak) my database. However, whenever I run it, I always get this error message: Msg 3201, Level 16, State 1, Line 1 Cannot open backup device 'C:\Users\Me\Desktop\Backup\MyDB.Bak'. Operating…
Smiley
  • 3,207
  • 13
  • 49
  • 66
182
votes
10 answers

SQL "between" not inclusive

I have a query like this: SELECT * FROM Cases WHERE created_at BETWEEN '2013-05-01' AND '2013-05-01' But this gives no results even though there is data on the 1st. created_at looks like 2013-05-01 22:25:19, I suspect it has to do with the time?…
JBurace
  • 5,123
  • 17
  • 51
  • 76
180
votes
17 answers

Why is SQL Server 2008 Management Studio Intellisense not working?

I'm being driven to insanity trying to figure out why Intellisense just fails to work at all. The server I'm using is local and is 2008, the database is set to 2008 compatibility, Intellisense is on in every menu I can find, and yet no member list…
179
votes
4 answers

Optional parameters in SQL Server stored procedure

I'm writing some stored procedures in SQL Server 2008. Is the concept of optional input parameters possible here? I suppose I could always pass in NULL for parameters I don't want to use, check the value in the stored procedure, and then take things…
larryq
  • 15,713
  • 38
  • 121
  • 190
178
votes
13 answers

Read data from SqlDataReader

I have a SQL Server 2008 database and I am working on it in the backend. I am working on asp.net/C# SqlDataReader rdr = cmd.ExecuteReader(); while (rdr.Read()) { //how do I read strings here???? } I know that the reader has…
zack
  • 7,115
  • 14
  • 53
  • 63