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

Format() function doesn't work?

I am trying to execute following built-in function in sql but it gives me error that this function doesn't exist my query: select EmpId, EmpName, format(EmpJoinDate, "YYYY-DD-MM") as date from Employee Error i am getting: 'format' is not a…
user728885
14
votes
6 answers

How to select the top n from a union of two queries where the resulting order needs to be ranked by individual query?

Let's say I have a table with usernames: Id | Name ----------- 1 | Bobby 20 | Bob 90 | Bob 100 | Joe-Bob 630 | Bobberino 820 | Bob Junior I want to return a list of n matches on name for 'Bob' where the resulting set first contains…
Jedidja
  • 16,610
  • 17
  • 73
  • 112
14
votes
6 answers

How to find which columns don't have any data (all values are NULL)?

I have several tables in a database. I would like to find which columns (in which tables) don't have any values (all NULL in a column). I the example below, the result should be TestTable1 --> Var2 TestTable2 --> Variable1 I don't have any idea…
jrara
  • 16,239
  • 33
  • 89
  • 120
14
votes
10 answers

Error: Package 'Microsoft SQL Management Studio Package' failed to load. In SQL Server Management Studio

I had installed SQL Server 2008 R2, the installation was succesful. But I can't open the Management Studio because this error is shown: Package 'Microsoft SQL Management Studio Package' failed to load. Any idea? Thanks.
Yaz
  • 367
  • 1
  • 5
  • 13
14
votes
5 answers

Finding pairs that do not exist in a different table

I have a table (orders) with order id, location 1, location 2 and another table (mileage) with location 1 and location 2. I'm using the Except action to return those location pairs in orders that are not in mileage. But I'm not sure how I can also…
Gabe
  • 5,113
  • 11
  • 55
  • 88
14
votes
5 answers

INSERT OVER statement?

What the difference between INSERT INTO table VALUES (values) and INSERT OVER table VALUES (values) ?
Alex
  • 2,438
  • 23
  • 30
14
votes
4 answers

Why is a UDF so much slower than a subquery?

I have a case where I need to translate (lookup) several values from the same table. The first way I wrote it, was using subqueries: SELECT (SELECT id FROM user WHERE user_pk = created_by) AS creator, (SELECT id FROM user WHERE user_pk =…
devzero
  • 2,510
  • 4
  • 35
  • 55
14
votes
4 answers

SQL Server 2008 R2 Add column into a specific location

I am using SQL Server 2008 R2 and I wish to add a new column into a specific spot in the column order in a table and not at the end. I wish to avoid having to recreate the table. How do I do this without recreating the table? i.e. Table:…
GordyII
  • 7,067
  • 16
  • 51
  • 69
14
votes
3 answers

Problems using SQL Server 2008 R2 PowerShell extensions outside of SQLPS

I would like to have the SQL Server PowerShell extensions available to me whenever I start PowerShell by loading the snap-ins in my profile.ps1 script. I found an article here with a script example that shows how to do this, and this works fine on…
Irinotecan
  • 567
  • 1
  • 6
  • 12
14
votes
0 answers

The endless debate: atomic inserts, locking, & transactions in SQL Server. It ends here

Edit: My question is, "Why does my first code example work?" Please read on... Edit1: There is no doubt that a unique constraint is the correct way to ensure duplicates don't happen. This is a given. However, sometime we need to know that we're…
IamIC
  • 17,747
  • 20
  • 91
  • 154
14
votes
5 answers

Calculation using Date function in SQL Server 2008

I am trying to compute TO_DATE column for a group of BINGID, INDUSID, COMP1. When IsRowActive = 1 then TO_DATE = "9999-12-31" , which is being returned correctly. But when IsRowActive = 0, then we have to calculate To_Date which should be 1 sec less…
Rohini Mathur
  • 431
  • 1
  • 5
  • 19
14
votes
2 answers

How to hide message window in MS SQL Server 2008?

Please look at the attached picture below.
Luong Le
  • 143
  • 1
  • 5
14
votes
6 answers

Best strategy for storing documents in SQL Server 2008

One of our teams is going to be developing an application to store records in a SQL2008 database and each of these records will have an associated PDF file. There is currently about 340GB of files, with most (70%) being about 100K, but some are…
DCNYAM
  • 11,966
  • 8
  • 53
  • 70
14
votes
2 answers

Dynamically column names from select sql

I have the following data output from my database Observation 1 aug -2015 Improvement suggestion 1 dec -2015 Observation 1 dec -2015 Accident 2 jan -2016 Non Conformity 5 jan…
Pochen
  • 2,871
  • 3
  • 22
  • 27
14
votes
4 answers

Select query skips records during concurrent updates

i have table that processed concurrently by N threads. CREATE TABLE [dbo].[Jobs] ( [Id] BIGINT NOT NULL CONSTRAINT [PK_Jobs] PRIMARY KEY IDENTITY, [Data] VARBINARY(MAX) NOT NULL, …
Boo
  • 1,634
  • 3
  • 20
  • 29