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

How to replace first and last character of column in sql server?

I have a database column and its give a string like ,Recovery, Pump Exchange,. I want remove first and last comma from string. Expected Result : Recovery, Pump Exchange.
Manish Sharma
  • 2,406
  • 2
  • 16
  • 31
15
votes
1 answer

PIVOT with varchar datatype

I´m trying to PIVOT some data in a table, but I cannot do it because I do not find the way to do it using varchar columns. I have this table: And what I need is this: I need to use the 'ug_label' row data as columns. As the datatype is VARCHAR, I…
NicoRiff
  • 4,803
  • 3
  • 25
  • 54
15
votes
2 answers

Design principles for designing database architecture of financial transaction system?

I want to design a database which will keep record for financial transaction.I want to design it as a product so that it can be used for any type of financial transaction.Are there some design principles specific to financial transaction database…
Maddy.Shik
  • 6,609
  • 18
  • 69
  • 98
15
votes
5 answers

How to rename something in SQL Server that has square brackets in the name?

I have a column in one of my tables which has square brackets around it, [Book_Category], which I want to rename to Book_Category. I tried the following query: sp_rename 'BookPublisher.[[Book_Category]]', 'Book_Category', 'COLUMN' but I got this…
rajesh
  • 153
  • 1
  • 4
15
votes
6 answers

How to automatically generate unique id in SQL like UID12345678?

I want to automatically generate unique id with per-defined code attach to it. ex: UID12345678 CUSID5000 I tried uniqueidentifier data type but it generate a id which is not suitable for a user id. Any one have suggestions?
15
votes
5 answers

Simple way to prevent a Divide By Zero error in SQL

I have a SQL query which used to cause a Divide By Zero exception I've wrapped it in a CASE statement to stop this from happening. Is there a simpler way of doing this? Here's my code: Percentage = CASE WHEN AttTotal <> 0 THEN…
Denys Wessels
  • 16,829
  • 14
  • 80
  • 120
15
votes
6 answers

Insert into table with select statement plus additional column in SQL Server 2008

I am trying to insert into a table from a select statement as well as add additional parameters to the rows with something like- SELECT Appt_ID, Pracitioner_ID, Appt_Book_ID, Start_Time, UR_NO, …
user2537701
15
votes
3 answers

LIKE and NULL in WHERE clause in SQL

I have a store procedure which i have planned to use for search and get all values. Scenario: If the parameter passed is NULL it should return all the values of the table and if the parameter passed is not NULL it should return the values according…
A Coder
  • 3,039
  • 7
  • 58
  • 129
15
votes
6 answers

Null value in a parameter varbinary datatype

How can I add a null value in a parameter varbinary datatype? When I execute the following code: using (SqlConnection myDatabaseConnection1 = new SqlConnection(myConnectionString.ConnectionString)) { using (SqlCommand mySqlCommand = new…
Karlx Swanovski
  • 2,869
  • 9
  • 34
  • 67
15
votes
8 answers

How to remove the first character if it is a specific character in SQL

I currently have a table Telephone it has entries like the following: 9073456789101 +773456789101 0773456789101 What I want to do is remove only the 9 from the start of all the entries that have a 9 there but leave the others as they are. any help…
w3n2u
  • 333
  • 3
  • 5
  • 13
15
votes
5 answers

sql server select column by number

Can I select specific columns by the number of the columns in SQL? Something like SELECT columns(0), columns(3), columns(5), columns(8) FROM TABLE
Mike
  • 1,302
  • 6
  • 23
  • 43
15
votes
5 answers

SQL Query - Change date format in query to DD/MM/YYYY

What I'm trying to achieve is fairly straight forward, to get one date format to another; From This: Jan 30 2013 12:00:00:000AM To This: DD/MM/YYYY or in this case 30/01/2013 However, when it's the 1st to the 9th of the month the date format is…
user2069217
15
votes
4 answers

A more elegant way of escaping dynamic SQL?

OK, so I've got this line of code in a search stored procedure: SET @where = 'job_code = ''' + REPLACE(@job_code, '''', '''''') + '''' and there are basically two operations I'd like to streamline -the first being surrounding the concatenated value…
Mike Perrenoud
  • 66,820
  • 29
  • 157
  • 232
15
votes
6 answers

SQL Unit Testing Stored Procedures

I am new to working with SQL database but have been confronted with testing my database. For security reasons any queries or updates are done through stored procedures. It was suggested to me by a peer to use stored procedures to test other stored…
Kairan
  • 5,342
  • 27
  • 65
  • 104
15
votes
5 answers

There is insufficient system memory in resource pool 'internal'

SQL Server 2008 Linked Server and ad-hoc INSERTs cause a rapid memory leak which eventually causes the server to become non-responsive and ends with the following error: Msg 701, Level 17, State 123, Server BRECK-PC\SQLEXPRESS, Line 2 There is…
Breck Carter
  • 351
  • 2
  • 5
  • 18