sql-server-2008-r2 Questions

10

Solved

How do you rewrite expressions containing the standard IS DISTINCT FROM and IS NOT DISTINCT FROM operators in the SQL implementation in Microsoft SQL Server 2008R2 that does not support them?
Epact asked 2/5, 2012 at 15:24

2

I've built a database in SQL Server 2008 R2 and am using Visual Studio 2010 Ultimate to create a database project for it. I've created both a SQL Server project and Database project to represent m...

3

Solved

I've Googled this with no success. I'm using SQL Server Profiler for SQL Server 2008 R2, and I've ensured that for the 'Events Selection' of the trace: I'm reporting all columns for Security Audit...

12

Solved

I'm trying to connect to an MDF. I've even gone to the lengths of re-installing sql server express entirely (it is now the only flavor of SQL installed on my box, where previously I had 05 dev and ...

4

Solved

I have been experiencing a strange issue for last few weeks. On my two different servers the sql server Agent stops working automatically, All I have to do is to restart the agent and is back on ru...
Ahasuerus asked 18/12, 2013 at 14:27

11

I've added an alias of "." which should point to my local (named) instance, ".\SQL2008". But when I try to connect to ".", it times out. Am I missing something or is this not allowed? Aliases...

4

Solved

I have a sql table that stores the daily prices of stocks. New records are inserted every day after the market closes. I want to find the stocks that have consecutive increases in price. The table...
Letta asked 27/4, 2012 at 16:32

3

Solved

I have a table in SQL Server 2008 R2 with close to a billion rows. I want to change the datatype of two columns from int to bigint. Two times ALTER TABLE zzz ALTER COLUMN yyy works, but it's very s...
Shutz asked 25/5, 2012 at 12:43

4

Solved

I have tables set up like so: Parent ------ id, ... Child ----- id, parent_id, x, y I want to find the Parents, or the distinct parent_id(s), if all of the rows in Child containing a given pare...
Chastain asked 22/8, 2012 at 14:12

3

Solved

I have a requirement for a report and I would like my sql query to repeat each row twice. Example : **Table 1** Id Name 1 Ab 2 Cd 3 Ef I want to write a query which outputs the following :...
Armored asked 3/11, 2014 at 15:18

3

Solved

I am using SQL Server 2008 R2. I want to drop the column if it is already exists in the table else not throw any error. Tried: ALTER TABLE Emp DROP COLUMN IF EXISTS Lname; Error: Incorrec...
Desirae asked 24/7, 2018 at 6:42

4

Solved

I dont have users in sysadmin except [sa] user unfortunately, I logged in as [sa] user and disabled it then I cant enable it, what I can do to enable it again?
Rachellrachelle asked 1/8, 2013 at 10:25

6

Solved

I'm trying to write the following in order to get a running total of distinct NumUsers, like so: NumUsers = COUNT(DISTINCT [UserAccountKey]) OVER (PARTITION BY [Mth]) Management studio doesn't s...
Joshuajoshuah asked 26/6, 2012 at 7:48

11

Solved

I am using this query to rename the database: ALTER DATABASE BOSEVIKRAM MODIFY NAME = [BOSEVIKRAM_Deleted] But it shows an error when excuting: Msg 5030, Level 16, State 2, Line 1 The databa...
Saltant asked 22/5, 2013 at 6:53

11

Solved

I want to update my column CODE_DEST with an incremental number. I have: CODE_DEST RS_NOM null qsdf null sdfqsdfqsdf null qsdfqsdf I would like to update it to be: CODE_DEST RS_NOM 1 qsdf 2 sdf...
Janssen asked 30/11, 2012 at 16:14

7

Solved

I want to retrieve the last time table was updated(insert,delete,update). I tried this query. SELECT last_user_update FROM sys.dm_db_index_usage_stats WHERE object_id=object_id('T') but the dat...
Cardiograph asked 5/7, 2013 at 12:56

7

I have a small table with 500 rows. This table has 10 columns including one varchar(max) column. When I perform this query: SELECT TOP 36 * FROM MyTable WHERE (Column1 = Value1) It retrieves ar...
Potty asked 22/5, 2012 at 18:20

4

Solved

Question: In our SQL-Server 2005 database, we have a table T_Groups. T_Groups has, amongst other things, the fields ID (PK) and Name. Now some idiot in our company used the name as key in a mappi...
Tetrabranchiate asked 26/10, 2012 at 7:25

4

Solved

I want to create a rule to restrict special characters to be entered into a column. I have tried the following. But it didnt work. CREATE RULE rule_spchar AS @make LIKE '%[^[^*|\":<>[]{}`\( ...
Canalize asked 20/8, 2014 at 15:17

5

Solved

I have a table that looks something like: AccountID, ItemID 1, 100 1, 200 2, 300 I have a proc that accepts a table value parameter which updates the Items associated with an account. We'll pass...
Stricture asked 4/3, 2011 at 17:31

2

Solved

I have SQL Server 2008 R2. I have around 150 tables in a database and for each table I have recently created triggers. It is working fine in my local environment. Now I want to deploy them on my ...
Rowlett asked 19/1, 2013 at 10:51

8

Solved

I have a table ABC in a database DB. I want to create copies of ABC with names ABC_1, ABC_2, ABC_3 in the same DB. How can I do that using either Management Studio (preferably) or SQL queries ? Th...
Chrysanthemum asked 15/3, 2013 at 8:55

15

Solved

We have developed an assembly for SQL Server 2008 R2. The assembly has been working for a week. The managed stored proc inside the assembly was working fine for the whole week and then it stops wo...
Tinker asked 12/8, 2011 at 2:14

9

Solved

I've one main report with 5 sub reports. Sub report contains more than 10 parameters. (With 10 Multi valued parameters - So I've used Join method to pass value from Main report to Sub Report) I'...

3

Solved

I have got this problem in local instance of SQL Server 2008 R2 on my machine. There are several databases on this instance. But I am not able to see any of them from the object explorer. I am ab...
Complainant asked 26/4, 2013 at 5:36

© 2022 - 2024 — McMap. All rights reserved.