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

learn more… | top users | synonyms (1)

0
votes
1answer
25 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
27 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 ...
-1
votes
1answer
24 views

Retrieve user Permissions on a database [on hold]

Please could you provide me query that shows user(John Felix) permissions on a server\database.
2
votes
0answers
35 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
41 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'') ...
-2
votes
0answers
13 views

Can anyone tell me which programming language is from www.freelancer.com, www.clickbank, www.craigslist.org and www.pof.com? [on hold]

I want to build a site like www.pof.com and advance search area is my favor (key word post and match and searching). Any one can tell me better, simple and easy to apply and manage in the future for ...
0
votes
1answer
30 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
26 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
15 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
24 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
36 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
36 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
21 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. ...
0
votes
1answer
41 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
29 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
33 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
167 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
33 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
83 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
218 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
53 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
61 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 ...
1
vote
0answers
47 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
61 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
26 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 ...
0
votes
1answer
66 views

How to set foreign key in table in one database that references a table in another database [closed]

Msg 1768, Level 16, State 0, Line 1 Foreign key 'FK_id' references object 'dbo.student' which is not a user table. Msg 1750, Level 16, State 0, Line 1 Could not create constraint. See ...
-3
votes
1answer
80 views

Ola Hallengren Index Optimise Script not Rebuilding Indexes [closed]

I have downloaded Ola Hallengren's script and deployed to master database. I run it using the below... EXECUTE dbo.IndexOptimize @Databases = 'USER_DATABASES', @FragmentationLow = NULL, ...
0
votes
1answer
37 views

Error with FUNCTION ( SQL Server 2008 ) - ''Cannot find either column…'

Friends, I have this Function: create function [dbo].[fn_xxx] ( @Nome varchar(100), @Descricao varchar(500) ) RETURNS @tbDados table ( Qtd int ) as Begin ...
1
vote
0answers
40 views

When does SQL Server follow the Minimum Password Age policy?

According to this SQL Server 2008 whitepaper, SQL Server should only pay attention to the Minimum Password Age policy when the Check_Expiration (Enforce Password Expiration) option is turned on. Page ...
0
votes
1answer
28 views

When does a port get assigned if SQL Server is set to TCP Dynamic Ports

I'm trying to determine when a dynamic port is assigned to SQL Server. If the TCP/IP Properties have the TCP Dynamic Ports enabled, does that port get assigned at the time the Server is installed or ...
2
votes
1answer
34 views

Agent service account shows as not clustered

One of the SQL Server 2008 R2 instances I administer is running on a two node Windows Cluster (Windows Server 2008 R2 Enterprise) When I run the DMV sys.dm_server_services, SQL Server Service Account ...
0
votes
0answers
43 views

ComputerNamePhysicalNetBIOS and “Current Host Server” shows different machines

I have a SQL Server 2008 R2 instance on a two node (say names X and Y) windows server cluster (Windows Server 2008 R2 Enterprise). Server Manager on both nodes shows 'X' as the 'Current Host ...
0
votes
0answers
41 views

Using loops inside Openrowset

I'm trying to execute a query across around 200 servers using openrowset function. This function needs to execute in a loop - the query is sucessfull in SQL Server 2012 environments, but failing in ...
0
votes
0answers
40 views

Get list of rows in an hour bracket, grouped by 5 minute increments

Im beating my head the wall with this one. Using data from an attendance tracking table, I need to basically count how many people are inside the building at a given time, assuming that they are still ...
1
vote
0answers
34 views

Full text index does not honour deleted words - They are still indexed

I have a full text index defined as 'Automatic' radio button checked on in its Catalog. When I modify a word in the full text indexed column, the new word appears in the sys.dm_fts_index_keywords but ...
1
vote
1answer
38 views

Validate many SQL statements for correctness

I have about 150 reports generated from SQL statements. These reports are saved independently from the server. Some generated from sprocs, some from table-valued functions, but mostly just SQL ...
0
votes
1answer
22 views

skip the rows that already imported in sql server 2008 r2

I used the sql server 2008 r2 wizard to import excel file to my DB, now I'm trying to import more excel sheets may have the same data that I imported before. how can I import these excel sheets to the ...
1
vote
0answers
25 views

Is there an equivalent to sys.dm_exec_query_memory_grants for non-waiting queries?

Basically I have a proc that executes and requires massive amounts of memory. We can sometimes get into a situation where the proc executes multiple times, in which case the memory grants are visible ...
1
vote
0answers
34 views

Table queries locked during long insert SQL server

Everyday runs a sql job that loads data from bulk files and load them in auxiliary tables, to adapt and then copy to the destination table where applications read (and only read) the data. I am ...
0
votes
1answer
35 views

How to split a multivalued column, do a lookup and update another column?

This is a part of my previous question. How can I achieve the following for all the records in my table using a single query? SET @TeamMembers = TeamMembers from tblProjects where ID = '125' ...
1
vote
0answers
56 views

How does SQL Server know it was abnormally shutdown last time [closed]

I am doing background reading on this. Would like to know how does SQL Server know it was abnormally shutdown last time?
2
votes
2answers
81 views

Cannot generate SSPI context ( SQL Server 2008 ) ( RESOLVED )

When someone tries to connect to a SQL Server instance, the error shows up: It's not possible do generate SSPI context. Yesterday we had a blackout (don't know how to say this expression in ...
0
votes
2answers
55 views

AVG function returns wrong average

I have a simple table with a column of type REAL. There are 2 rows in the table and the values are 0.23 and 0.24. If I run the following: SELECT AVG(MyColumn) FROM dbo.MyTable I would expect to ...
0
votes
1answer
118 views

Single query approach to split and copy string values in a column

This is a part of my previous question. I have the below logic to split a string value from a column in table tblProjects as below: SELECT @Docs = Documents FROM tblProjects WHERE ID = @ID SET ...
3
votes
0answers
73 views

How long does it take before an index on table makes a difference?

We are using SQL server 2008. We are doing a root-cause analysis on an event in production and trying to explain everything. This is the scenario: We had a query that runs twice a minute and takes 4 ...
0
votes
1answer
58 views

How to create a stored procedure with columns from three different tables in SQL Server 2008?

I'm a fresher and I would like to get some suggestions on how to create a stored procedure in which I have to select columns from three different tables. 2 columns customername and customercode from ...
0
votes
0answers
61 views

how to restrict user to run sql server database only on partiular ip only?

How to restrict user to run a SQL server database on in particular IP only? I have one database I just want to give to clients. But I wont Restrict that the database should run only on one ...
0
votes
1answer
19 views

Run SQL requests generated by some script

I'm using this script to delete data from all the tables in my database. It generates DELETE statements in proper order, each request in one row : DECLARE @schema_name sysname; DECLARE @table_name ...
1
vote
0answers
56 views

Too big database file 90GB [closed]

I just found that one of database growth to size of 90 GB (one file) The biggest table is about 23 GB , mostly containing integer data. Till now I dont have performance problems, but I think that ...
3
votes
1answer
55 views

Full to Simple recovery mode during massive data update?

I`ve got a 50 Gb database, in which a table takes up 43 GB, and it's full of bad data(over 90%), and i plan to clean it. Database is in Full recovery mode. My plan is: 0 - take a backup for safety ...