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
1 answer

TSQL- Trigger instead of UPDATE column not included in update statment

I have a small issue with what I am trying to do. but I suspect that it is not possible and just would like some other insights. I have a table that contains six columns. two of which are related to recording updates on the table,'UpdateBy' and…
DIYDoug
  • 51
  • 1
  • 6
3
votes
4 answers

Rewrite SQL Query- I need to replace NOT IN with Join

I have a query in my production environment which is taking long time to execute. I did not write this query but I must find a way to make it quicker since it is causing a big performance issue at the moment. I need to replace NOT IN with Left Join…
Aryan
  • 117
  • 1
  • 2
  • 11
3
votes
4 answers

Remove duplicates from col1 when condition in col2 is met

SQL Server 2008 R2(SP2) 10.50.4263 I have application number in col1 and an indicator (0 or 1) for first time buyers(ftb) in col2. Each application can have 1 or 2 applicants. For applications with two applicants, I get two entries for application…
3
votes
1 answer

Get Current Sp parameters and values - (reflection alike)?

Lets say I have this simple SP : CREATE PROCEDURE mySp @a int, @b int AS BEGIN ... ... select ________ END Now let's say I execute it via : exec mySp 1,2 Question : Is there any code which I can place in the ______ so…
Royi Namir
  • 144,742
  • 138
  • 468
  • 792
3
votes
1 answer

Getting top n latest entries from SQL Server full text index

I have a table in a SQL Server 2008 R2 database Article (Id, art_text) Id is the primary key. art_text has a full text index. I search for latest articles that contain the word 'house' like this: SELECT TOP 100 Id, art_text FROM Article WHERE…
3
votes
2 answers

When pressing F1 hotkey in SQL Server 2008 R2 hang my Maganement Studio?

Sometimes I miss the 1 or the F2 in my computer keyboard when using SQL Server Maganement Studio, that causes my SQL MS to hang and the I have to close it with the Task Manager, but many time I loss a lot from the queries I was working on, so I…
Artemination
  • 703
  • 2
  • 10
  • 30
3
votes
1 answer

SQL Server , restrict UNPIVOT to order columns automatically

I have a table with data in one row: Account | OrderID | OrderName | Priority | Fasting |AssignedTo |ResultsTo …
Sri Reddy
  • 6,832
  • 20
  • 70
  • 112
3
votes
2 answers

Connecting to a specific SQL Server instance on another machine

I'm trying to connect to a SQL Server 2008 R2 Express database using a Linq DataContext. The database engine is running on another machine in the local network. We are using SQL authentication, for the time being. SQL Server is set up to allow…
epalm
  • 4,283
  • 4
  • 43
  • 65
3
votes
1 answer

SQL Server Merge - Getting matched records to another temp table

I have a MERGE query to update data. In case of no match I am inserting records to source getting the output to a temporary table. Would it be possible to get the matched records to temporary table as well? Basically to avoid duplication of data in…
Naresh
  • 2,667
  • 13
  • 44
  • 69
3
votes
3 answers

How to make this the sample SQL Atomic?

I have an store procedure, ALTER PROCEDURE [dbo].[InsertDealGallery] ( @ImageID INT, @DealID INT ) AS DECLARE @MaxOrder INT; SELECT @MaxOrder = MAX([Order]) + 1 FROM DealGallery WHERE DealID = @DealID IF (@MaxOrder IS NULL) …
Imran Qadir Baksh - Baloch
  • 32,612
  • 68
  • 179
  • 322
3
votes
4 answers

Local SQL Server: The specified procedure could not be found

This problem has appeared on my PC a few days ago, without any changes I have made to the Visual Studio/SQL Server settings. When trying to perform any manual operation on the database file (*.mdf) in Visual Studio, I get the following error: The…
3
votes
4 answers

to select latest date and last but-one date from date column in SQL Server 2005

I have to select latest date and last but-one date from date column and group by ID column. So that I can get latest date and last but-one date for particular ID. Suppose, ----------------------------- ID …
3
votes
1 answer

Clustered Index internal structure

Will a clustered index in SQL Server 2008 R2 create an additional B-tree structure like in case of nonclustered index, where each element of the B-tree contains value and data locator? Or SQL server just sorts all the table by the clustered index…
3
votes
3 answers

How to create MERGE statement with variable in SQL Server

I am trying to create a stored procedure that contains a merge statement. I want the merge statement to be able to use the variable @TargetTable as target but it is asking me for a table variable. This is my code: CREATE PROCEDURE dbo.mergetable ( …
shawnl_28
  • 41
  • 1
  • 4
3
votes
1 answer

SSRS report won't load in browser

I am new to SSRS, but have begun migrating our reports to that for my organization. I have 3 reports set up at this time, but have run into a problem. Viewing any of the reports in Report Builder works just fine, but viewing 2 of the 3 in IE (also…
Brandon
  • 31
  • 1
  • 3
1 2 3
99
100