Questions tagged [sql-server-2008-r2]

Use this tag for questions specific to the 2008 R2 version of Microsoft's SQL Server.

Important Note: Extended support for SQL Server 2008 (including 2008 R2) ended on July 9, 2019.

Microsoft will no longer release security updates for any version of SQL Server 2008. Don't let your infrastructure and applications go unprotected. We're here to help you migrate to current versions for greater security, performance and innovation.

If you are still using 2008 R2 version you should seriously consider upgrading.

SQL Server 2008 R2 (codename Kilimanjaro, version 10.50), released in April 2010, is the successor to SQL Server 2008.

This version of Microsoft SQL Server is the 3rd form to utilize the .Net framework for operating with a database framework.

This product includes:
  • Server/Database/Table Triggers
  • Stored Procedure (SProc) & Functions
  • Database Maintenance processes & features
  • Automated SQL Agent with time triggers

Reference

11320 questions
3
votes
3 answers

View joining with stored Procedure results

I have a existing view in SQL server used by the application. I need to join with table returned from the stored procedure. The stored procedure does lot of things like inserting to multiple #temp tables before returning the result. I tried to…
3
votes
1 answer

SMO Restoring Took Forever

I use this SMO to restore a backup: Server myServer = new Server(@"PC-1\Instance1"); Restore restoreDB = new Restore(); restoreDB.Database = "Sample"; restoreDB.Action = RestoreActionType.Database; …
3
votes
1 answer

Dynamic query to Union multiple databases

Say I have the following databases in SQL Server 2008 R2 db1, db2, db3, db4, db5......dbn each database has a table A which contains the columns C1,C2,C3 I can write the following Select statement on two databases to get the data across…
MayBeColin
  • 61
  • 2
  • 9
3
votes
5 answers

Substring in sql server on numbers

I have a column name called "PersonNameID" which contains two values ABCD-GHJI ABHK-67891 HJKK-HJJJMH-8990 I have to extract only the first part of the "PersonNameID" which contains number after "-".Ideally my output should be…
3
votes
2 answers

how to write query to fetch last week records

I need to fetch records from sqlserver2008r2, my query for fetching records for current week is: select EmpCode,EventDate1 as EventDate,InTime, case when OutTime is null then 'N/A' else Outtime end as OutTime from TMS_HOURCALC WHERE intime1 …
Hearty
  • 85
  • 2
  • 10
3
votes
2 answers

Referential Integrity error with dimension processing for cube

One of our production cube failed with the following error message: Source: Analysis Services Execute DDL Task Analysis Services Execute DDL Task Description: Errors in the OLAP storage engine: The attribute key cannot be found when…
Sparky
  • 743
  • 6
  • 15
  • 28
3
votes
3 answers

How can I write queries without having to specify the schema name?

I can only get data like this format: SELECT * FROM Abc.ACADEMY Where Abc is a username, ACADEMY is a table name, and ABC is also my schema name What I want to be able to write this as: SELECT * FROM ACADEMY How can I achieve this?
3
votes
4 answers

ExecuteScalar returns false for SQL count(*)

I have the following function to check if a user exists in my SQL table private static bool userexists(string user) { bool userexists = false; SqlCommand c = new SqlCommand("SELECT COUNT(*) from UserTable where Username = @user"); …
3
votes
6 answers

Count Response once in 30 days SQL

If I have a customer respond to the same survey in 30 days more than once, I only want to count it once. Can someone show me code to do that please? create table #Something ( CustID Char(10), SurveyId char(5), ResponseDate…
Jen Ro
  • 45
  • 6
3
votes
2 answers

Slow performance when using fully qualified name in SELECT

I'm using SQL Server 2008 R2 for this issue. In one of my apps, I need to refer to a table from another database. So I do a query: USE Db1 SELECT * FROM Db2.dbo.Table1 It takes ~2 seconds for the query to complete even for a table with just 300…
kupsidoo
  • 61
  • 5
3
votes
2 answers

getting error while creating new diagram in SQL Server 2008 R2/

I am getting this error when trying to create a new diagram in SQL Server 2008 R2: The specified module could not be found. (MS Visual Database Tools) Program Location: at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32…
3
votes
1 answer

Pulling results as rows, easy conversion/translation to columns?

I've been handed a task where I've been asked to make use of an SSIS 2008 package to create a CSV then FTP that CSV, following this tutorial here. My query isn't quite ready. I'm pulling results where the columns we're going after are coming out as…
fusion27
  • 2,396
  • 1
  • 25
  • 25
3
votes
1 answer

Implicit conversion from data type xml to nvarchar is not allowed. Use the CONVERT function to run this query

I'm writing following SQL procedure: ALTER PROCEDURE [dbo].[spc_InsertSubjectToContentRelation] ( @pCourseGUID XML, @pSubjectId XML, @pAssessmentIds XML, @pVideoIds XML ) AS BEGIN SET NOCOUNT ON; DECLARE @CourseGUID…
Jainendra
  • 24,713
  • 30
  • 122
  • 169
3
votes
2 answers

How do you alter a SQL Server credential that contains square brackets?

I want to alter a credential on my SQL Server install. It was auto-generated when I set up a replication publication to be used with the replication transaction log reader proxy. Apparently it was generated with square brackets as part of its name…
Jez
  • 27,951
  • 32
  • 136
  • 233
3
votes
1 answer

Query Xml in SQL Server 2008 R2

I am new to SQL Server and T-SQL. How can I query out the information stored in this xml in SQL Server 2008 R2? XML :
LionsFan
  • 35
  • 4
1 2 3
99
100