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

Skip some columns in SqlBulkCopy

I'm using SqlBulkCopy against two SQL Server 2008 with different sets of columns (going to move some data from prod server to dev). So want to skip some columns not yet existed / not yet removed. How can I do that? Some trick with…
abatishchev
  • 98,240
  • 88
  • 296
  • 433
15
votes
1 answer

ScriptingOptions sql smo does not support scripting data

I'm generating sql database script using c# code. following code works fine for create table but when I try to use scriptOptions.ScriptData = true; it is throwing following exception. An unhandled exception of type …
Neo
  • 15,491
  • 59
  • 215
  • 405
15
votes
3 answers

How to find all connected subgraphs of an undirected graph

I need some help for a problem that i am struggling to solve. Example table: ID |Identifier1 | Identifier2 --------------------------------- 1 | a | c 2 | b | f 3 | a | g 4 | c | h …
Stad
  • 216
  • 2
  • 11
15
votes
1 answer

Scripting setup of database mail

I've used the SQL Server 2008 GUI to set up database mail profiles & accounts on my test server, and I'd now like to duplicate those to our production database. Is there a way to generate a script to do this?
chris
  • 36,094
  • 53
  • 157
  • 237
15
votes
1 answer

Is there a practical way to use the hierarchyID datatype in entity framework 4?

As it stands now, the CLR UDTs including HierarchyID aren't supported in Entity Framework 4. HierarchyID.ToString() is useful, but breaks down once any item has 10+ siblings (the basic structure is /3/4/12/ or /3/4/2/ so the 12th node will sort…
15
votes
4 answers

Sql server update multiple columns from another table

I have read lots of post about how to update multiple columns but still can't find right answer. I have one table and I would like update this table from another table. Update table1 set…
Klapsius
  • 3,273
  • 6
  • 33
  • 56
15
votes
1 answer

SSIS Stored Procedure uses Temp Table 2008 and 2014

I'm currently writing an SSIS package that retrieves data from a stored procedure via an OLE DB Source. The stored procedure contains a rather nasty query that I've been able to improve with the use of temp tables. If I switch these temp tables to…
Nelson O
  • 263
  • 2
  • 8
15
votes
2 answers

Undo Table Partitioning

I have a table 'X' and did the following CREATE PARTITION FUNCTION PF1(INT) AS RANGE LEFT FOR VALUES (1, 2, 3, 4) CREATE PARTITION SCHEME PS1 AS PARTITION PF1 ALL TO ([PRIMARY]) CREATE CLUSTERED INDEX CIDX_X ON X(col1) ON PS1(col1) this 3 steps…
Storm
  • 4,307
  • 11
  • 40
  • 57
15
votes
4 answers

How to Compare two strings using a if in a stored procedure in sql server 2008?

I want to do something like this: declare @temp as varchar set @temp='Measure' if(@temp == 'Measure') Select Measure from Measuretable else Select OtherMeasure from Measuretable
Vishal
  • 12,133
  • 17
  • 82
  • 128
15
votes
4 answers

Compare two rows and identify columns whose values are different

The Situation We have an application where we store machine settings in a SQL table. When the user changes a parameter of the machine, we create a "revision", that means we insert a row into a table. This table has about 200 columns. In our…
d.wing
  • 263
  • 1
  • 2
  • 9
15
votes
6 answers

SQL GUID Vs Integer

I have recently started a new job and noticed that all the SQL tables use the GUID data type for the primary key. In my previous job we used integers (Auto-Increment) for the primary key and it was a lot more easier to work with in my opinion. For…
Dalbir Singh
  • 2,629
  • 3
  • 26
  • 29
15
votes
6 answers

Prevent duplicates across multiple executions of copying records back into source table while changing one column

I want to select CustomerID, OrderTypeID, and LoanNumber from tblOrder and insert it with a new OrderTypeID but same CustomerID and LoanNumber. My query does that but it duplicates the values, every time the query is executed it duplicates the…
grace
  • 253
  • 1
  • 5
  • 17
15
votes
6 answers

Inserting more than 1000 rows from Excel into SQLServer

I'm new to Sql but what is the best way to insert more than 1000 rows from an excel document into my database(Sql server 2008.) For example I'm using the below query: INSERT INTO mytable(companyid, category, sub, catalogueref) VALUES …
user3545217
  • 173
  • 1
  • 1
  • 8
15
votes
6 answers

ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION

I've tried putting the COMMIT TRAN in a if else loop, and I'm still getting this error. I have to enroll a student in a class. If the number of seats after enrollment falls in negative, I have to reverse it and print a message saying can't enroll.…
user3573343
  • 151
  • 1
  • 1
  • 3
15
votes
6 answers

How to get last week date range based on current date in sql?

I have this code in crystal reports that gives me last week date range based on the current date. First day of the week: If DayOfWeek(currentdate) = 2 Then currentdate Else If DayOfWeek(currentdate) = 3 Then dateadd ("d",-1,currentdate) Else If…
asfsdf
  • 175
  • 1
  • 2
  • 10