Questions tagged [sql-server-2008]

SQL Server 2008 (major build version 10.00.xxxx). Please also tag with sql-server.

Filter by
Sorted by
Tagged with
0
votes
0answers
1k views

Login failed for user '<mysqllogin>'. Reason: Failed to open the explicitly specified database. [CLIENT: <local machine>] issues

Over the last 10 days or so, I've started to get 'Login failed for user ''. Reason: Failed to open the explicitly specified database. [CLIENT: ]' entries nearly every 5 mins in my SQL 2008 logs and I ...
5
votes
1answer
404 views

Getting year DATEPART from Unix date

In my database, the dates are retained as days elapsed since/before 01/01/1970, which I understand to be a Unix date format, eg. today is 23rd May 2018 and the value is 17674. I'm trying to run a ...
0
votes
2answers
1k views

Combine date and time into one new column

I have two columns named date and time respectively. Both of them have datatype nvarchar as they were imported from ms excel. I want to combine the column into a new column named datetime. I managed ...
0
votes
1answer
281 views

Adding Time Limit parameter to Ola hallengren Index Maintenance

I would like to limit the duration of the index maintenance procedure of Ola Hallengren to be 7200 seconds (2 Hours) I found parameter TimeLimit defined as: Set the time, in seconds, after which no ...
0
votes
1answer
77 views

Index Reorganize During Database Full Backup

Index maintenance usually starts 3 hours before the database full backup and ends before the full backup start. The database is using the Simple Recovery model. Last weekend the index maintenance ...
1
vote
1answer
589 views

Creating the same unique ID in multiple tables

I have two tables of data; one table is the Employee Master table containing a list of unique employee names, and the other table contains transactional data with multiple records for each employee. ...
2
votes
1answer
53 views

Trying to replace a cursor with update statement, went wrong somewhere

I have a cursor im trying to rewrite into a single update statement. When comparing the results, I get 280 records that are being copied over with the cursor but NOT copied over with the update ...
-2
votes
1answer
638 views

Compare all 70 columns from two tables in same database

I have two tables with 70 columns each and they have same columns names in each table. I want to compare the data of every column and the output is number of rows which are different of every column. ...
1
vote
2answers
266 views

Windows Authentication In SQL DTS packages

We have a SQL server 2008 R2 and have legacy DTS packages running on the server. As of now, the subtasks inside DTS packages are using dynamic properties where SQL Login ID details have been given, ...
2
votes
4answers
3k views

How do I select MAX/MIN from multiple tables, along with other columns from MIN/MAX row

I have a query where I JOIN 4 weekly "summary" tables, and SELECT a MIN and a MAX of units FROM each table. This would give me the highest/lowest total units sold for, and I'm pulling an average from ...
0
votes
3answers
97 views

How to remove earliest/latest row by two columns (userId, StatusCheck)?

I have crosschex database that is used to store logged in/out data. Sometimes it happens that user clock in/out few times. I would like to remove that duplicates leaving the earliest when log in and ...
0
votes
1answer
268 views

SQL Server listen on a specific port

I want to change the PORT to 255: can i change per db or just for instance? is there any issue can come up? have to restart the service?
0
votes
1answer
59 views

Replication Monitor - Start Synchronizing grayed out

Having an issue where the start synchronizing menu item in the replication monitor is grayed out for users who have repl_monitor permissions in the distribution database. The weird thing is that it ...
0
votes
1answer
52 views

How to find the time taken to execute a script

As a part of partitioning table,1M records were inserted into a table using insert statement and I forgot to capture the time taken to insert. Is there any way to find out the time taken to execute ...
1
vote
1answer
183 views

SQL Server Agent Service deleted

Has anybody run into the issue where an application (arcserv) using SQL Server Express 2008 is uninstalled on a server running SQL Server 2014? When arcserv was uninstalled, it or user deleted the SQL ...
1
vote
1answer
42 views

Transact-SQL script equivalent to the option: Apply Tracked Changes

Could anybody tell me what is the transact equivalent script of using the: Apply Tracked Changes menu?
5
votes
4answers
2k views

Why would SQL Server automatically remove manually created indexes?

What causes Microsoft SQL Server to remove manually created indexes automatically? Every index I create it removes within a few hours. Here is the code I use to create the indexes. Affected views run ...
0
votes
1answer
8k views

how to sum decimal values in sql server [closed]

I am working on an sql queries where i have a temp table named DECLARE @tcal table(TagIndex smallint,TagName nvarchar(20),Total decimal(18,2)) in which decimal numbers are used to stored. The ...
2
votes
2answers
2k views

How to get random datetime of current day in SQL Server

I am working on a SQL query where I need to get datetime of any specific date. For this I used the following query: DECLARE @RandomDate datetime DECLARE @fromDate datetime = '2018-04-07' SELECT ...
1
vote
1answer
178 views

How to restore .bak only if it's good

I'm using Tsql script to restore several databases. RESTORE DATABASE XXX_M FROM DISK = 'C:\XXX.bak' WITH FILE = 1, replace GO Sometimes the .bak file comes corrupted (not data corrupted ). I ...
3
votes
5answers
2k views

Creating a Persisted Computed Column with a function

I am working with the programmers on a database solution. They want to add a computed column to mimic the old keys for the older queries, procedures, and systems and index it. The new keys will be ...
1
vote
2answers
870 views

Merging continous date range using T-SQL

I have a table containing a part time working pattern consisting of start and end dates together with hours values. Where there is an gap between an end date and a subsequent start date, this ...
3
votes
1answer
455 views

Best practices on dealing with devs that want to use XP_CMDSHELL to BCP OUT

This is not a technical question. I would like to know the best practice to use in a place where devs want to have SA for everything. The most recent event is: Devs want to use BCP OUT to export ...
1
vote
1answer
1k views

Combine two table with different column but same value

I have two tables with similar value: TABLE A a_empno a_checktime a_updatetime a_status a_location ------- ----------------------- ----------------------- ------- ----...
1
vote
0answers
853 views

INSERT IGNORE/UPDATE IGNORE equivalency in SQL Server

I've got the following table structure. CREATE TABLE dbo.UserOrgUnits ( UserOrgUnitId int PRIMARY KEY NOT NULL IDENTITY, UserId int NOT NULL, OrgUnitId int NOT NULL, DateUpdated int ...
2
votes
3answers
51 views

Can I retrieve all database objects owned by a particular database?

Is there a way to search all database objects by a particular database name or its id. Is that possible? I would like to do this so that I can find out how many stored procedures, functions, views, ...
1
vote
2answers
46 views

Does an index continue to be used after it is dropped (Database Polling investigation)

The folly of developers who use database polling is shown below. I have identified a query below which did not have an index in place on a particular column In addition to polling the database every ...
0
votes
2answers
408 views

Reorganize and Rebuild Indexes with active connections

I want to rebuild or reorganize indexes in a table. What happens if there are active connections to that table at the moment?
0
votes
1answer
57 views

SQL 2008 Cluster Install, “Cluster shared disk Availability Check”

I am trying to setup a new sql server 2008 cluster, on windows 2012R2, and the installer is failing on the cluster shaed disk availability check. I have verified that there are 5 disks assigned to "...
0
votes
1answer
351 views

Adding time slots through trigger SQL Server

I am quite new to SQL. I am now working on something to schedule appointments. I found an existing answer about time slots, but did not quite understand. I need to automatically add time slots to the ...
0
votes
2answers
40 views

How Can i Update only one Column of SQL Table via store procedure with passing rest column value null

Here is What i Have tried. I Have created a Table [tblUser] which allow null value and a Store procedure [spUpdateUser] with All Parameters which can be passed null except ID parameter Whenever this ...
-1
votes
1answer
375 views

cannot read property user access. this property is not available on sql server 7.0

I want to know the .mdf file path from property tab of a db, but it was throwing error as cannot read property user access. this property is not available on sql server 7.0 Note : on querying my ...
0
votes
3answers
111 views

How I would I break a total count query into intervals?

For example, if I did a normal count query like: select status, count(*) from customers group by status and get the result status count ----------------- open 1200 closed 1002 but I want ...
0
votes
1answer
359 views

How to group records by a two-value column ignoring small gaps?

I have a subquery with a column named code that only has 1 and 0 values and an ID column because I query a lot of codes for each ID. I want to group by said column (and by ID) and by ocurrence but ...
0
votes
0answers
32 views

migrating instance from 2008r to 2016 Enterprise [duplicate]

i have a client that wants to migrate his data to sql server 2016 . currently they have 2008r and the databases are huge(total of 4 tb) on the instance. what is the best way to performe this with the ...
3
votes
2answers
92 views

How Do I Force Data From First Table to Display

DB: SQL SEVER 2008 I'm joining multiple tables and I want the results to always show the data from the "Project" table. In the example below, I have a client where billing and discount data is in ...
4
votes
0answers
87 views

Moving a very large (40 TB) DB from a 2008 server to a 2016 server [duplicate]

The Situation: Our 2008 MSSQL server is old and rapidly running out of drive space. We have a new 2016 server ready, we just need to move a 40 TB database from the old server to the new one. The DB, ...
2
votes
1answer
71 views

SQL 2008/R2 Extended Events - Row Count

I need to setup a sql audit to capture all queries running on a server from any unauthorized locations, and one of the columns that is required is Row Count. In sql trace, this is possible. But I can'...
0
votes
0answers
201 views

Recover data from .mdf file, and no correct version of SQL Server

I have an 80gb .mdf file that I need to open and get the data out of. It was on a computer running SQL Server 2008 R2 Express that died, but I was able to pull the file off the half dead HDD. I don'...
6
votes
0answers
262 views

SQL Server Profiler: why the RPC Starting event does use an different decimal separator from SP Starting?

Trying to diagnose an problem, I've ran into that inconsistency. In SQL Server Profiler, the RPC Starting event uses the regional settings to write real numbers (example: in Portuguese(Brazil) 14.5 ...
3
votes
1answer
656 views

Why is my database using Partitioning? ( I know it's not )

Running this query: select * from sys.dm_db_persisted_sku_features Shows me that I'm using Partitioning: | feature_name | feature_id | |--------------|------------| | Partitioning | 200 | ...
1
vote
1answer
2k views

Two-step Replication between SQL 2008 and 2017

I am currently using transactional replication from several SQL 2008 publishers to a central 2014 subscriber/distributor. I need to replicate this data to a 2017 server, which would require a 2017 ...
0
votes
1answer
690 views

why my split string functions are not working with large OBJECT_DEFINITION?

I have in one of my databases a stored procedure called PROCEDURE [repl].[usp_upd_repl_out_application], that is not exactly a very clever stored procedure but it has over 389 lines. As I need to ...
1
vote
0answers
71 views

Get the records matching the combination of column values from a temporary table

I have a temp table with 4 columns question_tbl: TempTable -- combination to lookup id | Code1 | Code2 | code3 --------+----------+-------------+--------- 111 | AA | A1 ...
0
votes
1answer
163 views

How can I create a stored procedure of inheritance tables in SQL Server [closed]

I have three tables create table CustomerTypes( CustomerTypeID int primary key identity(1,1), CustomerType varchar(11) ); insert into CustomerTypes(CustomerTypeID,CustomerType) select 1, 'Regular' ...
0
votes
1answer
522 views

Unexpected Shutdown affects SQL Server DB start at OS start up

I have an application that uses a sql server db (SQL Express 2008 R2) and starts when Windows OS starts. When the pc shutdown unexpectedly and then restart the pc the application run automatically but ...
0
votes
2answers
10k views

Where to download Sql Server 2008 R2? [closed]

I need to do a fresh install in a lab environment. Where's a good place to download it?
11
votes
2answers
2k views

When is the SQL Server database ready to accept queries?

In the SQL Server error log file I found the following lines: 2018-02-22 14:10:58.95 spid17s Starting up database 'msdb'. 2018-02-22 14:10:58.95 spid16s Starting up database 'ReportServer'. ...
0
votes
1answer
911 views

SQL Server Failover Cluster setup shared drive issue

I'm trying to complete an SQL install on a two node cluster which has three LUNs assigned from Filer storage present and currently owned by the first node. I've selected the "New SQL Server ...
1
vote
2answers
120 views

How can I get Sql Server 2016 on a 32-bit server?

I didn't build it, but we've got a 32-bit Windows Server 2008, with SQL server 2008 and 4GB of RAM. I need to upgrade it to SQL Server 2016 in order to log ship to a new server, so we can put this ...