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

"Cannot insert explicit value for identity column in table when IDENTITY_INSERT is set to OFF" with composite key

We have recently added a new "level" to our database - added a key "Company_ID" to be above/before the existing ID Identity field in the tables throughout the database. For example, if a Table had ID then fields, it now has Company_ID, then ID, then…
and_E
  • 293
  • 1
  • 3
  • 11
14
votes
4 answers

Replace multiple characters in SQL

I have a problem where I want to replace characters I am using replace function but that is not giving desired output. Values of column table_value needs to replaced with their fill names like E - Email P - Phone M - Meeting I am using this…
Nikhil Agrawal
  • 47,018
  • 22
  • 121
  • 208
14
votes
1 answer

JDBC getUpdateCount is returning 0, but 1 row is updated, in SQL Server

Anyone ever seen this? I'm using MS SQL Server 2008, and I've tried it with two different JDBC drivers (jtds, and Microsoft's). I run a simple statement to update a row, and it does update it, but getUpdateCount returns 0. If I try it for different…
Rob N
  • 15,024
  • 17
  • 92
  • 165
14
votes
3 answers

UTF-8 character gets changed in INSERT statement on MS-SQL-Server

I have a table on my MS-SQL-Server 2008R2 that itself has an nvarchar(50) field. Now when i insert a value using the Server Management Studio like INSERT INTO INFORMATIONS(SOME_TEXT) VALUES('finančné služby') and i immediately select the…
BigBlackDog
  • 544
  • 1
  • 6
  • 19
14
votes
3 answers

How to drop user defined objects from master database

I am using SQL Server 2008 R2. I had created an SQL Script for my project's database i.e. used to create all the tables, constraints, views, stored procedures and functions with some minimal data for creating a fresh database. But by mistake, I…
Dev
  • 6,570
  • 10
  • 66
  • 112
14
votes
3 answers

Delete Query by joining multiple columns

I have Table T1 with Column C1,C2 and Table T2 with Column C3,C4,C5. I would like delete records from T1 where C1 = C3 AND C2 = C4 and C5 = '123'. What will be the query I tried following DELETE FROM T1 WHERE (C1,C2) = SELECT (C3,C4) FROM T2 WHERE…
Debopam
  • 3,198
  • 6
  • 41
  • 72
14
votes
2 answers

How do I create a temporary table from a type?

Suppose I have some type: CREATE TYPE usr.NameList AS TABLE ([name] VARCHAR(MAX) NOT NULL); And now I want to create a temporary table based on this type, how do I do it? CREATE TABLE #superBrand (usr.NameList) -- doesn't work Also, from this:…
quant
  • 21,507
  • 32
  • 115
  • 211
14
votes
6 answers

SQL Server : export query as a .txt file

I am trying to export my SQL Server query results into a folder in .txt format (this is for an automated job) I know the equivalent in MySQL works with INTO OUTFILE. Does anyone know the best way to do this in SQL Server 2008 Management Studio?…
SRahmani
  • 348
  • 1
  • 5
  • 17
14
votes
5 answers

What is difference between unique key with 'not null' constraint and primary key?

I want to know difference between these two key. When the Unique key with not null constrain in terms of how they are stored in database and what difference are there when we making Select,Insert,Update, Delete operation for these keys.
Bhavesh Kachhadiya
  • 3,902
  • 3
  • 15
  • 20
14
votes
1 answer

SQL Fuzzy Matching

Hope i am not repeating this question. I did some search here and google before posting here. I am running a eStore with SQL Server 2008R2 with Full Text enabled. My requirements, There is a Product Table, which has product name, OEM Codes, Model…
Jeyara
  • 2,198
  • 1
  • 23
  • 26
14
votes
2 answers

Why can't I query OFFSET/ FETCH query on my SQL Server?

I want to run this query on my SQL Server as follows: Microsoft SQL Server Management Studio 10.50.1600.1 But it can't recognize the OFFSET and so shows ERROR? SELECT * FROM dbo.tbl_MatchDetail ORDER BY MatchDetailID OFFSET 10 ROWS FETCH NEXT 10…
Milson
  • 1,525
  • 3
  • 15
  • 29
14
votes
4 answers

SQL Server Latches and their indication of performance issues

I am trying to understand a potential performance issue with our database (SQL 2008) and in particular one performance counter, SQLServer:Latches\Total Latch Wait Time Total Latch Wait Time (ms). We are seeing a slow down in DB response times and…
John Lemp
  • 5,029
  • 3
  • 28
  • 36
14
votes
4 answers

SQL Server Group By Order By Where

I have a single table which I need to pull back the 5 most recent records based on a userID and keying off of documentID (no duplicates). Basically, I'm tracking visited pages and trying to pull back the 3 most recent by user. Sample…
JGrimm
  • 399
  • 2
  • 4
  • 22
14
votes
6 answers

Update only Date portion of DateTime

I am using SQL Server 2008. I have a datetime in the database where the value is 10/4/2012 8:03:00 AM How do I update only the date portion? The field name is dTime. I like to update the date to 10/5/2012 and keep the time as it is.
Nate Pet
  • 44,246
  • 124
  • 269
  • 414
14
votes
2 answers

How can I script SQL Server database diagrams?

How can I export SQL Server database diagrams as developer-friendly SQL scripts? By developer-friendly, I mean written in a way similar to the way a human would write them as opposed to the messy many-UPDATEs style used by existing solutions. (Note…
Sam
  • 40,644
  • 36
  • 176
  • 219