Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [sql-server-2008]

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

1
vote
1answer
193 views

Add values from two existing column into new columns for a total

We have two existing columns in our database named 'ClientIncome' and 'PartnerIncome'. We would like to add a new column named 'HouseholdIncome' We would like to add the values from 'ClientIncome' ...
0
votes
1answer
242 views

Microsoft SQL Server error 14545

I was trying to use copy Database wizard from one server to another to make a certain database identical and i got the error (The @flags parameter is not valid for a job step of type 'SSIS'. (...
-3
votes
1answer
92 views

calculate group by running total in sql server 2008 [closed]

I HAVE SOME SAME SAMPLE DATA IN MY TABLE ID | HOUSENO | AREAR | CURRENT | TOTAL_DEMAND | TOTAL_RECIVED ---------------------------------------------------------------- 1 | 1/10/1 | 0 | 165 ...
2
votes
1answer
190 views

Efficient join technique for two very large tables

I am working on a concept for database synchronization recently. The scenario is as follows: there is a master table "Items" with 1M+ rows in it CREATE TABLE [dbo].[Item]( [Id] [...
0
votes
2answers
27 views

SQL Query with Aggregate Count, where at least 1 of the counts has a value in a field

SELECT PERSON_ID,COUNT(APPL_ID) COUNTS FROM APPLICATIONS GROUP BY PERSON_ID ORDER BY COUNTS DESC The above query returns all persons who have applied for all time (essentially a count of the whole ...
2
votes
1answer
216 views

Okay to run sp_refreshview against all views on a regular basis?

Microsoft SQL Server has a system stored procedure called sp_refreshview which updates the metadata of the view that's passed in. Are there any downsides to running this procedure regularly on all of ...
0
votes
1answer
38 views

Statment running significantly slower than component parts and causes high CPU usage

I am running the following statement in SQL Server Studio 2008: Use Systems select subdirectory from [Systems].[dbo].[ScanningArchiveFileSystem] f where f.FileFlag = 1 and SubDirectory not in ( ...
0
votes
1answer
797 views

Evaluating most frequent values of columns in a single query

I have a table describing my application users with some details such as name, surname, birth date, nationality, email, etc... I would like to known for each property, and for each user category, the ...
0
votes
1answer
58 views

How to link data from two spreadsheets imported to sql

I imported 2 spreadsheets to SQL Server tables. One sheet has data containing persons name & surname, the project they are working on as well as there banking details. The other spreadsheet has ...
1
vote
1answer
298 views

SQL Server logical consistency-based I/O error

I have a job on my live environment DB and the job has failed again this morning reporting SQL Server Error 824 (Soft I/O error, where the OS could read the page but SQL has treated it as corrupt): ...
1
vote
1answer
26 views

Optimizing sorted table for join

In our asset tracking system, I have the following 2 tables: item item_location_date Where item_location_date has the following fields: ild_item (FK to Item) ild_location (FK to location) ...
3
votes
1answer
226 views

GZip existing varbinary(max) column in Sql Server 2008+

I have an existing legacy table that is ~180GB in size due to a client application storing PDF files as varbinary. I'd like to be able to compress that column for all rows using GZIP to help save ...
1
vote
0answers
35 views

need help with multiple column aggregate using pivot in mssql

below is the temporary table for class assessments. this table contain list of class assessment which include the assessment code, date of assessment, total item and passing percentage. create table #...
7
votes
1answer
891 views

How to GRANT permission to execute stored procedure?

I have an AD group that is setup as a Windows Authenticated SQL Login on my SQL Server. On DatabaseA it has the db_datareader and public roles. So the users of this AD group only have read access to ...
0
votes
1answer
179 views

SQL Server 2008 Database encryption

In my company there is MS SQL SERVER 2008 standard edition installed. My problem is we want to encrypt whole database but in standard edition there is encryption like transparent-data-encryption(TDE) ...
5
votes
1answer
1k views

How to repair corruption for “Possible chain linkage problem.”

I have large table with 15 000 000 record and suddenly Select Top stopped working. I use MS SQL Management Studio. This is not working, the query return 0 records: SELECT TOP (10) [Id] ...
1
vote
0answers
211 views

How to reset SQL Server Configuration Manager Windows To Original Windows Configuration (as if it had been newly installed)

I have been looking at a lot of articles, and still cannot come up with an answer to the following. I am running Windows 10 workstation, and have installed SQL Server 2008 R2 Developer. This problem ...
2
votes
2answers
139 views

SQL Server : cannot add subscriber to publication

I am trying to configure replication as per the official tutorial from Microsoft. In the section Create a subscription to the transactional publication, see step 5. The name of the subscriber ...
0
votes
1answer
411 views

How to find Linear interpolation without using pivot and unpivot in SQL Server 2008

id x val ------------- 1 1 8.18 2 3 8.35 3 5 8.51 4 7 8.52 5 10 8.54 6 15 8.57 7 1 8.35 8 3 8.60 9 5 8.70 10 7 8.75 11 10 8.76 12 15 8.82 13 1 8.55 14 3 ...
1
vote
1answer
97 views

How do I determine the time period to which the SQL Server i/o warning is referring?

SQL Server log shows batches of warnings, of the type: SQL Server has encountered 18757 occurrence(s) of I/O requests taking longer than 15 seconds to complete on file [T:\.. SQL Server has ...
3
votes
2answers
220 views

Can a diagram be created from deadlock xml extracted from the ring buffer in SQL Server 2008?

In later versions of SQL_Server, we view the event file in the object browser to look at deadlock diagrams. This particular client has SQL 2008 (compatibility 2005) and the only copy of deadlocks have ...
3
votes
1answer
181 views

SQL Server Agent Services not Coming Up

After the Windows Server 2008R2 was restarted after some planned downtime, the SQL Server Agent Service is not getting started. There are multiple SQL Server named instances and Agent Services of non ...
-1
votes
2answers
792 views

UPDATE trigger causes deadlock

I have a After Update trigger where trigger insert a value in same table to find a duration column.My goal is whenever end_time value is inserted then trigger will find duration in hh:mm:ss format and ...
1
vote
1answer
74 views

Is there a way to check which computer or IP used a particular script?

As the Title suggest, is there a way to check what IP used a particular SQL Script? The scenario is, there is a recreation script in a email and we hypothesize that somehow, that recreation script ...
0
votes
0answers
209 views

LDAP linked server in SQL Server: what connectivity is required?

In an instance of SQL Server I have created a Linked Server for LDAP queries. EXEC master.dbo.sp_addlinkedserver @server = N'LDAP', @srvproduct=N'Active Directory Service Interfaces', @provider=N'...
5
votes
1answer
713 views

Why can't the transaction log shrink during a backup?

I have a large database in Simple recovery model (vendor requirement) and it took 3 days to back it up to the new hosting company's server. The morning of the third day, the DB went offline because ...
0
votes
1answer
25 views

How are they calculating “AssignmentBaseline0Work” in this query?

I just wanted to understand how they are calculating "AssignmentBaseline0Work". (SELECT ProjectUID, CAST(MAX(CAST(TaskUID AS nvarchar(36))) AS uniqueidentifier) AS TaskUID, AssignmentUID, ...
0
votes
3answers
117 views

Odd behavior of between operator when updating

I have to maintain FRP (Financial Resource Planning) Software that was implemented by some shady consultants (they came up with the jobs), and it stores the data in a SQL Server database. The software ...
-1
votes
1answer
672 views

Rewrite query to not use CONCAT function in SQL Server 2008 R2?

I know that the CONCAT function does not exist in SQL Server prior to 2012. How would i optimize my code to not use the CONCAT function? SELECT dbname = DB_NAME(), ...
0
votes
1answer
471 views

Specifying the IP address to be used when connecting to an instance

I have an application that was compiled with a hard-coded connection string (using the server's IP address '192.168.40.201' and not the server name) to an SQL Server. A backup of the database has ...
3
votes
1answer
658 views

Pivot with rollup in sql server

Is it possible to use a cursor to create a dynamic table and then use those columns to aggregate data in SQL server 2008? For example take the following table. CREATE TABLE Billing ( BillingId ...
1
vote
1answer
468 views

SQL Server Agent Alerts using severity 16

My work is currently deleting lot of stored procedures, views, tables and so on. My worry is that if we miss judge a object and it goes into production that we'll only catch the errors when an user ...
1
vote
1answer
74 views

Two Inner join on the same field to get same data

I'm developing a Report in SSRS for MS CRM 2011. There is a table named StringMapBase which contains Option Set we have declared in different entities. This table has Value and AttributeValue column. ...
-3
votes
1answer
33 views

Sql 2008 r2. Nvarchar(50) how many size does it consume on the Hard drive [closed]

im trying to build a program with so many transaction and inputs. the columns is only nvarchar(50). i want to know how much size does it consume in my hard drive?
2
votes
1answer
112 views

When is autoclose OK to be not OK

By chance, I happened to see that the autoclose feature on SQL dbs (I'm using SQL 2008) shouldn't be on and I found that all of my SQL dbs were set to have autoclose on. I've set autoclose to off on ...
0
votes
0answers
522 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
322 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
625 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
181 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
49 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
354 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
310 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
133 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
1k 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
200 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
45 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
51 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
100 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 ...