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
138
votes
7 answers

Backup a single table with its data from a database in sql server 2008

I want to get a backup of a single table with its data from a database in SQL Server using a script. How can I do that?
EBS
  • 1,663
  • 2
  • 16
  • 17
138
votes
2 answers

GROUP BY to combine/concat a column

I have a table as follow: ID User Activity PageURL 1 Me act1 ab 2 Me act1 cd 3 You act2 xy 4 You act2 st I want to group by User and Activity such that I end up with something like: User …
viv_acious
  • 2,429
  • 9
  • 34
  • 55
137
votes
3 answers

SQL Server: Maximum character length of object names

What is the maximum character length of object name (e.g. constraint, column) in SQL Server 2008?
jrara
  • 16,239
  • 33
  • 89
  • 120
137
votes
5 answers

Do while loop in SQL Server 2008

Is there any method for implement do while loop in SQL server 2008?
Nithesh Narayanan
  • 11,481
  • 34
  • 98
  • 138
137
votes
13 answers

How to kill/stop a long SQL query immediately?

I am using SQL server 2008 and its management studio. I executed a query that yields many rows. I tried to cancel it via the red cancel button, but it has not stopped for the past 10 minutes. It usually stops within 3 minutes. What could the reason…
sequel.learner
  • 3,421
  • 7
  • 22
  • 24
136
votes
14 answers

Database Diagram Support Objects cannot be Installed ... no valid owner

I tried to create a database diagramm with SQL Server 2008, but an error occurs: Database diagram support objects cannot be installed because this database does not have a valid owner. To continue, first use the Files page of the Database…
Rookian
  • 19,841
  • 28
  • 110
  • 180
135
votes
8 answers

"The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine" Error in importing process of xlsx to a sql server

I have a 64 bit windows 7 and SQLServer 2008 R2 (64 bit) I follow the instructions that are here to import excel file to sql server but in figure3 section of that post when I try to access excel file and when I click next this error make me…
Mosijava
  • 3,941
  • 3
  • 27
  • 39
135
votes
10 answers

ALTER DATABASE failed because a lock could not be placed on database

I need to restart a database because some processes are not working. My plan is to take it offline and back online again. I am trying to do this in Sql Server Management Studio 2008: use master; go alter database qcvalues set single_user with…
JOE SKEET
  • 7,950
  • 14
  • 48
  • 64
134
votes
3 answers

Is having an 'OR' in an INNER JOIN condition a bad idea?

In trying to improve the speed of an immensely slow query (several minutes on two tables with only ~50,000 rows each, on SQL Server 2008 if it matters), I narrowed down the problem to an OR in my inner join, as in: SELECT mt.ID, mt.ParentID,…
ladenedge
  • 13,197
  • 11
  • 60
  • 117
133
votes
10 answers

Which SQL query is faster? Filter on Join criteria or Where clause?

Compare these 2 queries. Is it faster to put the filter on the join criteria or in the WHERE clause. I have always felt that it is faster on the join criteria because it reduces the result set at the soonest possible moment, but I don't know for…
Jon Erickson
  • 112,242
  • 44
  • 136
  • 174
132
votes
12 answers

Is the NOLOCK (Sql Server hint) bad practice?

I'm in the business of making website and applications that are not mission critical -> eg. banking software, space flight, intensive care monitoring application, etc. You get the idea. So, with that massive disclaimer, is it bad using the NOLOCK…
Pure.Krome
  • 84,693
  • 113
  • 396
  • 647
132
votes
6 answers

SQL Server Management Studio won't let me add an index to a table

When I right click on the indexes folder in the table the "New Index" menu item is grayed out. I don't understand why. I've deleted all data in the table just in case, and refreshed and restarted SSMS, but no luck. I'm using SQL Server 2012 Business…
131
votes
10 answers

Generate MD5 hash string with T-SQL

Is there a way to generate MD5 Hash string of type varchar(32) without using fn_varbintohexstr SUBSTRING(master.dbo.fn_varbintohexstr(HashBytes('MD5', 'email@dot.com')), 3, 32) So it could be used inside a view with SCHEMABINDING
Grief Coder
  • 6,508
  • 9
  • 38
  • 51
130
votes
4 answers

Is there StartsWith or Contains in t sql with variables?

I am trying to detect if the server is running Express Edition. I have the following t sql. DECLARE @edition varchar(50); set @edition = cast((select SERVERPROPERTY ('edition')) as varchar) print @edition In my instance, @edition = Express…
Valamas
  • 24,169
  • 25
  • 107
  • 177
130
votes
11 answers

Generate random int value from 3 to 6

Is it possible in Microsoft SQL Server generate random int value from Min to Max (3-9 example, 15-99 e.t.c) I know, I can generate from 0 to Max, but how to increase Min border? This query generate random value from 1 to 6. Need to change it from 3…
FSou1
  • 1,861
  • 4
  • 18
  • 25