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
220
votes
10 answers

Saving results with headers in SQL Server Management Studio

I am using SQL Server Management Studio. I wish to save the results of a query to an excel file. I choose "save as" and then save to CSV file which I can open in excel. All good except I am missing column headers, any ideas how I get them…
dublintech
  • 16,815
  • 29
  • 84
  • 115
219
votes
9 answers

How to check date of last change in stored procedure or function in SQL server

I need to check when function was changed last time. I know how to check creation date (it is in function properties window in SQL Server Management Studio). I found that in SQL Server 2000 it wasn't possible to check modify date ( look at this…
219
votes
7 answers

How to Select Every Row Where Column Value is NOT Distinct

I need to run a select statement that returns all rows where the value of a column is not distinct (e.g. EmailAddress). For example, if the table looks like below: CustomerName EmailAddress Aaron aaron@gmail.com Christy …
Grasshopper
  • 4,717
  • 9
  • 36
  • 62
214
votes
20 answers

How to find server name of SQL Server Management Studio

I installed Microsoft SQL Server 2008. When I start SQL Server Management Studio (SSMS), I get the Connect to Server login window with a blank textbox for Server name. I have tried a lot of names, but I couldn't solve it. How can I find / get the…
Cantremember
  • 2,141
  • 2
  • 13
  • 3
213
votes
12 answers

Copy data into another table

How to copy/append data from one table into another table with same schema in SQL Server? Edit: let's say there is a query select * into table1 from table2 where 1=1 which creates table1 with the same schema as well as data as in table2. Is…
Rajaram Shelar
  • 7,537
  • 24
  • 66
  • 107
212
votes
9 answers

Multi-statement Table Valued Function vs Inline Table Valued Function

A few examples to show, just incase: Inline Table Valued CREATE FUNCTION MyNS.GetUnshippedOrders() RETURNS TABLE AS RETURN SELECT a.SaleId, a.CustomerID, b.Qty FROM Sales.Sales a INNER JOIN Sales.SaleDetail b ON a.SaleId = b.SaleId …
AndrewC
  • 6,680
  • 13
  • 43
  • 71
209
votes
7 answers

Alter column, add default constraint

I have a table and one of the columns is "Date" of type datetime. We decided to add a default constraint to that column Alter table TableName alter column dbo.TableName.Date default getutcdate() but this gives me error: Incorrect syntax near…
ram
  • 11,468
  • 16
  • 63
  • 89
208
votes
31 answers

Format of the initialization string does not conform to specification starting at index 0

I have an ASP.NET application which runs fine on my local development machine. When I run this application online, it shows the following error: Format of the initialization string does not conform to specification starting at index 0 Why is this…
G.S Bhangal
  • 3,060
  • 4
  • 23
  • 48
206
votes
42 answers

How to generate a range of numbers between two numbers?

I have two numbers as input from the user, like for example 1000 and 1050. How do I generate the numbers between these two numbers, using a sql query, in seperate rows? I want this: 1000 1001 1002 1003 . . 1050
user3211705
  • 2,418
  • 3
  • 19
  • 36
205
votes
8 answers

nvarchar(max) vs NText

What are the advantages and disadvantages of using the nvarchar(max) vs. NText data types in SQL Server? I don't need backward compatibility, so it is fine that nvarchar(max) isn't supported in older SQL Server releases. Edit: Apparently the…
David Pfeffer
  • 38,869
  • 30
  • 127
  • 202
204
votes
13 answers

Select SQL Server database size

how can i query my sql server to only get the size of database? I used this : use "MY_DB" exec sp_spaceused I got this : database_name database_size unallocated space My_DB 17899.13 MB 5309.39 MB It returns me several column that i…
Adeel ASIF
  • 3,354
  • 9
  • 27
  • 44
202
votes
5 answers

How to check existence of user-define table type in SQL Server 2008?

I have a user-defined table type. I want to check it's existence before editing in a patch using OBJECT_ID(name, type) function. What type from the enumeration should be passed for user-defined table types? N'U' like for user defined table doesn't…
abatishchev
  • 98,240
  • 88
  • 296
  • 433
198
votes
20 answers

SQL Server SELECT LAST N Rows

This is a known question but the best solution I've found is something like: SELECT TOP N * FROM MyTable ORDER BY Id DESC I've a table with lots of rows. It is not a posibility to use that query because it takes lot of time. So how can I do to…
Diego
  • 16,436
  • 26
  • 84
  • 136
198
votes
16 answers

How can I find out what FOREIGN KEY constraint references a table in SQL Server?

I am trying to drop a table but getting the following message: Msg 3726, Level 16, State 1, Line 3 Could not drop object 'dbo.UserProfile' because it is referenced by a FOREIGN KEY constraint. Msg 2714, Level 16, State 6, Line 2 There is…
user1943020
198
votes
6 answers

How to find current transaction level?

How do you find current database's transaction level on SQL Server?
dance2die
  • 35,807
  • 39
  • 131
  • 194