This tag is for SQL Server 2008, major build version 10.00.xxxx.

learn more… | top users | synonyms (2)

2
votes
1answer
49 views

SQL Server : GRANT REFERENCES Fails With Msg 15151 as Windows User with sysadmin role and also as 'sa' [closed]

Okay, what am I missing? Someone please hit me with the proverbial clue-by-four. On SQL Server 2008 R2, I execute this command: GRANT REFERENCES ON ASYMMETRIC KEY ::IRESKey to XYZZYEXT; I get this ...
0
votes
0answers
19 views

Informatica is causing Convert_implicit in SQL Server 2008

In our project a datafile is loaded into SQLServer using Informatica. The source column is defined in Informatica as UniChar.60 The target column in SQL Server is defined as varchar(60) But when the ...
33
votes
2answers
150 views

SQL Server unpredictable select results (dbms error?)

Below is simple example, which returns strange results, that are unpredictable and we cannot explain it in our team. Are we doing something wrong or is it SQL Server error? After some investigation ...
0
votes
1answer
54 views

DB Permission: User can drop only their created db's?

I want to set permission against a user, which can create database and drop on their created databases neither any database. Any idea/suggestion ?
0
votes
2answers
42 views

Mapping a Login to a User

On my production system I login to SQL Server with CPSDOM\mconnors. When I execute SELECT CURRENT_USER; it returns CPSDOM\mconnors. We use Windows authentication on our DBs. On my test system I ...
0
votes
1answer
74 views

SQL Server Deadlock on delete

I have a query like this: with xx as ( SELECT [FilePath], ROW_NUMBER() over (partition by [FilePath] order by [FilePath]) as RowNumber FROM [dbo].[foo] ...
0
votes
2answers
65 views

Find tables with modified data after a specified datetime [duplicate]

I am performing few inserts and updates on my database using tool provided by app supplier. I want to compare the updated database and backup after running the tool. But my database size is around ...
0
votes
0answers
53 views

Decimal Data Type as Primary Key

One of my tables is set up like this: create table dbo.Source ( testID decimal (10,3) PRIMARY KEY , column 2 somedatatype , column 3 somedatatype ) Whenever I perform SSIS into this table ...
1
vote
1answer
43 views

Proper way to store a password within a SQL Server agent job

I know this is a stupid idea, but I'm having a hard time finding a better solution right now. I need to execute several sql stored procedures on a daily basis, then execute a powershell script to ...
1
vote
0answers
38 views

tempdb contention issue and excessive pagewrites/s

Still removing the rust from my SQL Server skills, so please bear with some stupid questions here and there... Customer has a SQL Server 2008 R2 running in an Azure VM with 8 cores and 14GB RAM. ...
0
votes
0answers
9 views

Find unpublished columns via RMO

The stored procedure sp_helpmergearticlecolumn will return all columns for a table and have a bit set if the column is published or not. The MergeArticle RMO object has the function ...
1
vote
2answers
75 views

Different table size on sp_spaceused and standard report “Disk Usage by Top Tables”

I ran sp_spaceused and Disk Usage by Top Tables standard report for a table. The results for sp_spaceused are: name rows reserved data index_size unused SomeTable <1301755> ...
1
vote
1answer
92 views

Converting VARBINARY HEX to VARCHAR

I have a fun problem, I have data stored in SQL Server 2008 VARDATA column as Hex. I need to see what this translated to string is. I have tried CONVERT(VarChar(MAX), VARDATA, 2) and it returns a ...
0
votes
3answers
138 views

DISTINCT Role in SELECT

EDIT: @Moderators: Please delete this question. I still feel that it is unclear what I am asking. Maybe I could have used some Venn diagrams in order to describe the problem. The COUNTs do not seem to ...
0
votes
1answer
32 views

SQL problem with checking next and previous rows

I have a list and the returned table looks like this. I took the preview of only one car but there are many more. What I need to do now is check that the current KM value is larger then the ...
0
votes
1answer
14 views

Building test site, update dates (back date records)

I have 3 tables that all connect and I need to back date them in an MS SQL 2008 setting. I was thinking about how to do this and not sure if I am on the correct path. The big problem I have is I have ...
0
votes
1answer
41 views

Inplace upgrade from SQL Server 2008 Standard to SQL Server 2014 evaluation

I am trying to evaluate SQL Server 2014 by using the 2014 evaluation edition to upgrade an in place SQL Server 2008 Standard sp4 instance. At the end of the process I expect to have a SQL Server ...
0
votes
1answer
49 views

How can I choose the best autogrowth option for my new database? [duplicate]

I want to create a new database that I can use for testing, restoring it from a full backup from a production database. These backup file sizes are around 45,486KB, and the production database size is ...
1
vote
1answer
135 views

Delete files from disk, with a job, respecting some rules ( SQL Server 2008 )

We have An application that our customers use to download and upload files. I need to delete these files from disk after 30 days, of if it was downloded, in 7 days. How can i Use the script below, ...
0
votes
1answer
45 views

SQL update next row in select

I have ran into a problem with SQL. I have a list with car and mileage data. What I need to do is for the empty fields to calculate data. Each row has a field for KM (mileage in KM metric unit), ...
0
votes
1answer
45 views

Merging two Select queries with different where statements

I have this query below in which I am trying to get results for the month and year to date (account balance). SELECT T3.AcctCode, T3.AcctName, SUM(T1.Debit - T1.Credit)* -1 AS 'Balance' FROM OJDT T0 ...
0
votes
1answer
87 views

Automate SQL Server restore from Prod to Dev

I would like to setup an automated restore job which takes the latest timestamp .bak file and restores it into the DEV instance. I currently have a job on the DEV box that uses the UNC path to the ...
0
votes
1answer
40 views

copy table with all constraint

how I would copy a table with all constraints? I run select * into myNewTable from baseTable where 1=0 This copy a table but no with constraints
1
vote
1answer
29 views

Update incoming rows based on % calculation

Below is the business requirement which I have to achieve... As a Sales Data Operations process/product owner, I want to be able to identify share class conversions (aka "wash trades") coded as ...
0
votes
1answer
57 views

Dynamically change a db in transact sql

I am trying to run a script against a database that is dropped from a third party daily so the name of the database changes daily. I can get the name of the new database using the sys.databases ...
-1
votes
2answers
192 views

How to run multiple select statements in Data flow task in SSIS [closed]

I am migrating data from one database to another database using SSIS package and i need to write multiple select statements for same table depending on conditions as mentioned below. Actual Queries i ...
1
vote
2answers
48 views

Get time elapsed between log entries

At a company, fluids are prepared and held in tanks, following a preparation/recipe. The preparations move from tank to tank depending on needs. The tasks are logged in sequence into a table. What I ...
0
votes
1answer
57 views

Subtract next row's datetime with current row's datetime based on condition

It might sound complex - I think it is. I have an output like this: | EmployeeID| DateAndTime | Type | AbsenceID | DateEntered | LastModifiedDate | minutes | DN | | ...
0
votes
0answers
51 views

lock request time out period exceeded. When revoking db_owner access

I am trying to revoke db_owner access of an user and I am getting this below error! I have no active transactions User (whom I want to revoke access) is not connected to any db DataBase owner is ...
2
votes
0answers
75 views

Case Statements, subqueries, and datediff

First time posting on this website so please let me know if you require any other information. This first section of code worked perfectly and resulted in correct information. [Field 1] = (CASE ...
1
vote
3answers
91 views

Script to drop all databases except one not working

I'm trying to drop all databases but one on my test server. For this, I'm using the below script but it gives error: EXEC sp_MSforeachdb ' USE [?] IF (DB_ID(''?'') > 4 AND DB_NAME()!=''ABC'') ...
0
votes
1answer
56 views

Prevent record from being inserted in the table in After Trigger

I have a scenario where I have to insert a record in TableA only if the RecordId exists in TableB. I have written an Instead of Trigger on TableA for Insert, in which I am checking if the RecordId ...
0
votes
1answer
45 views

Best practice to recover an CRUD statement to a linked server if connection is lost

I am looking for the best practice for the following scenario. We have a CRM in our company. When an employee updates the record of a company, there is trigger that fires a stored procedure which has ...
0
votes
1answer
17 views

What can cause an Index “total writer” to be the same in every index?

I have a table, with some Indexes ( created by me, others by SQL Server Profiler (SqlServer 2008)). I use this query to analyze unused Indexes: --Possible bad Indexes (writes > reads) SELECT ...
1
vote
0answers
93 views

Inserts/updates are extremely slow with Merge Replication in SQL Server 2008

I got hired into a new company and they had merge replication already in place. They have had issues with it to the point I have to evaluate whether to keep it or replace it. The main issue is it ...
0
votes
2answers
62 views

Is it possible to connect to Oracle 9i data source in SSIS?

We're doing a migration from Oracle 9i to SQL Server 2008. So I'm thinking of a way to move the data from Oracle and I thought about SSIS. I'm new to this Microsoft's technology and I would like to ...
1
vote
1answer
50 views

How to distinguish between system and user defined roles in a single database?

Is there a way to distinguish between a system role/user and a user defined role/user? As system role/user I understand a role/user which is installed/assigned implicitly at the time the database has ...
1
vote
1answer
35 views

What User Level is needed for Transactional Replication

I've been setting up Transactional Replication between two database servers I have running. My first experiment with setting it up I simply used SA and local Admin account for all of the agents. ...
1
vote
1answer
138 views

SQL Server: update trigger fires before insert trigger

I have an application with a SQL Server-hosted database. I do not have access to the application code, but I do have full access to the database. I have added my own custom auditing to a table to ...
0
votes
0answers
41 views

Trying insert into a temp table only if the id does not match the id from another table I am inserting from

I am very new to this... I am trying to insert certain values from a table into a temp table. Table applNoteText_dealerCmt ( my temp table) Table ApplNotes This is what I have so far USE ...
0
votes
1answer
46 views

How do I get the previous or next row to compare with the current row for two columns?

I need to show a list of employees and their absence days with hours. I have the tables Employee LogAbsence LogTimeAttendance From Employee I ...
4
votes
1answer
182 views

Is there a way to list the “last backup” file of a Database?

I'm trying to do something really simple, but with one problem: declare @cmd varchar(1000) set @cmd='restore verifyonly from disk =''\\server\backup_folder\''?''' exec sp_msforeachdb @cmd ...
0
votes
1answer
46 views

Restoring SQL Server 2000 database to SQL Server 2008

Is it necessary to restore system databases of SQL Server 2000 to SQL Server 2008, if I am restoring my other databases from 2000 to 2008?
0
votes
2answers
92 views

Backing up a really huge SQL Server database

We have a SQL Server 2008 database of size over 200GB. There is no disk space on the server to take a backup. I really need to take a backup or make another copy of this database. what would be the ...
3
votes
2answers
251 views

Dropping multiple foreign keys of unknown name

I have a DB schema generated by Hibernate. Hibernate generates FKs by assigning them a generated name like FK0123456789ABCDEF. As part of the upgrade process of an application installed at a ...
1
vote
3answers
64 views

Select from two different tables and group by dates

I'm new in databases so I need help. I have two tables: First table: | Date .........| Diagnostics ................| ID ...............| | 2015-03-08 ...| Diag1 ......................| 2932 ...
0
votes
1answer
298 views

SQL Server 2008, problem with backing up transaction log

I have a transaction backup job which runs every hour, first it backups up from the database log to another drive then it shrinks the log and deletes old trn files. The middle task shrinks the log ...
2
votes
0answers
134 views

Upgrading SQL Server from 2008 to 2012 doesn't respect existing install / instance paths

Basic Information : Running Microsoft Windows Server 2008 with MS SQL Server 2008 (version 10.0.5869), trying to upgrade to SQL Server 2012. Currently working in a cloned VM of our production server ...
2
votes
3answers
94 views

Bulk change Agent Jobs' definition to “Quit the job reporting failure” from “Go to the next step” On Failure

There are agent jobs with multiple steps in our servers and all their steps are defined as "go to the next step" "On Failure". So, even a job step fails, operator doesn't get notified because ...
0
votes
0answers
88 views

Sql agent job fails with access denied error

We are trying to execute a SQL agent job which executes a step to shut down a service on DEV ENV using CMDexec, but it fails with error below: Executed as user: ABC\mssql. System error 5 has ...