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
112
votes
9 answers

How do I grant myself admin access to a local SQL Server instance?

I installed SQL Server 2008 R2 to my local machine. But, I can't create a new database because of rights (or lack of). "CREATE DATABASE PERMISSION DENIED" So, I tried to assign the admin privileges to my current login "User does not have…
SkonJeet
  • 4,827
  • 4
  • 23
  • 32
112
votes
10 answers

How to write a WHERE Clause to find all records in a specific month?

I want to be able to give a stored procedure a Month and Year and have it return everything that happens in that month, how do I do this as I can't compare between as some months have different numbers of days etc.? What's the best way to do this?…
Tarks
  • 4,127
  • 6
  • 38
  • 43
111
votes
3 answers

The EXECUTE permission is denied on the user-defined table types?

I have a question about User-Defined Table Types in SQL Server 2008. For the need of one of the ASP.NET application we defined our own table-types on SQL Server 2008 to use them as parameters in the stored procedures (when executing sql command in…
111
votes
8 answers

Stored procedure slow when called from web, fast from Management Studio

I have stored procedure that insanely times out every single time it's called from the web application. I fired up the Sql Profiler and traced the calls that time out and finally found out these things: When executed the statements from within the…
iamserious
  • 5,385
  • 12
  • 41
  • 60
111
votes
23 answers

Remove trailing zeros from decimal in SQL Server

I have a column DECIMAL(9,6) i.e. it supports values like 999,123456. But when I insert data like 123,4567 it becomes 123,456700 How to remove those zeros?
abatishchev
  • 98,240
  • 88
  • 296
  • 433
111
votes
13 answers

How to find the port for MS SQL Server 2008?

I am running MS SQL Server 2008 on my local machine. I know that the default port is 1433 but some how it is not listening at this port. The SQL is an Express edition. I have already tried the log, SQL Server Management Studio, registry, and…
royalghost
  • 2,773
  • 5
  • 23
  • 29
110
votes
15 answers

A dependent property in a ReferentialConstraint is mapped to a store-generated column

I get this error when writing to the database: A dependent property in a ReferentialConstraint is mapped to a store-generated column. Column: 'PaymentId'. public bool PayForItem(int terminalId, double paymentAmount, …
Welsh King
  • 3,178
  • 11
  • 38
  • 60
110
votes
11 answers

How do I view the full content of a text or varchar(MAX) column in SQL Server 2008 Management Studio?

In this live SQL Server 2008 (build 10.0.1600) database, there's an Events table, which contains a text column named Details. (Yes, I realize this should actually be a varchar(MAX) column, but whoever set this database up did not do it that way.)…
adamjford
  • 7,478
  • 6
  • 29
  • 41
108
votes
2 answers

Confused about UPDLOCK, HOLDLOCK

While researching the use of Table Hints, I came across these two questions: Which lock hints should I use (T-SQL)? What effect does HOLDLOCK have on UPDLOCK? Answers to both questions say that when using (UPDLOCK, HOLDLOCK), other processes will…
Jeff Ogata
  • 56,645
  • 19
  • 114
  • 127
108
votes
56 answers

How to find third or nᵗʰ maximum salary from salary table?

How to find third or nth maximum salary from salary table(EmpID, EmpName, EmpSalary) in optimized way?
Karan Gandhi
  • 1,494
  • 2
  • 12
  • 20
107
votes
3 answers

Why use the SQL Server 2008 geography data type?

I am redesigning a customer database and one of the new pieces of information I would like to store along with the standard address fields (Street, City, etc.) is the geographic location of the address. The only use case I have in mind is to allow…
Jeff Ogata
  • 56,645
  • 19
  • 114
  • 127
107
votes
16 answers

Get first day of week in SQL Server

I am trying to group records by week, storing the aggregated date as the first day of the week. However, the standard technique I use for rounding off dates does not appear to work correctly with weeks (though it does for days, months, years,…
Quick Joe Smith
  • 8,074
  • 3
  • 29
  • 33
107
votes
3 answers

Storing DateTime (UTC) vs. storing DateTimeOffset

I usually have an "interceptor" that right before reading/writing from/to the database does DateTime conversion (from UTC to local time, and from local time to UTC), so I can use DateTime.Now (derivations and comparisions) throughout the system…
Frederico
  • 1,071
  • 2
  • 8
  • 3
107
votes
3 answers

T-SQL and the WHERE LIKE %Parameter% clause

I was trying to write a statement which uses the WHERE LIKE '%text%' clause, but I am not receiving results when I try to use a parameter for the text. For example, this works: SELECT Employee WHERE LastName LIKE '%ning%' This would return users…
dp3
  • 1,607
  • 4
  • 19
  • 28
107
votes
5 answers

SQL NVARCHAR and VARCHAR Limits

All, I have a large (unavoidable) dynamic SQL query. Due to the number of fields in the selection criteria the string containing the dynamic SQL is growing over 4000 chars. Now, I understand that there is a 4000 max set for NVARCHAR(MAX), but…
MoonKnight
  • 23,214
  • 40
  • 145
  • 277