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
1answer
32 views

odd OS memory consumption by two nearly-identical SQL 2008 R2 instances

Instances are legacy, something we have to carry for the next 3 years, 2008 R2 64-bit, both SQL Server and Windows Server OS. Two copies on two nodes. Both servers are set to consume "Maximum server ...
0
votes
1answer
24 views

Add Leading Zeros in CASE, CHARINDEX and SUBSTRING Query

I am splitting a column based on the colon using this code which works. ,CASE WHEN CHARINDEX (':', ref) > 0 THEN SUBSTRING(ref, 1, CHARINDEX(':', ref) -1) ELSE NULL END AS EndVal The '...
0
votes
0answers
30 views

Sql server bulk loading optimization

We've got a process that's importing a 7gig / 334 million row data file. The data file is sorted on the first column The process is built on the "import first, index later" methodology. It uses BCP. ...
1
vote
1answer
35 views

Fetch data if exist in distinct of another column

I am trying to generate the query to fetch the data on the basis of company which have tax paid record in each year of : Select * From ( Select CompanyName , TaxPaidOn , ...
0
votes
2answers
27 views

I have to create tables where both have each as the foreign key . Which one should be created first

DDL QUERY FOR CREATING MAINTENANCE_PROBLEM CREATE TABLE MAINTENANCE_PROBLEM ( MP_ID int primary key, MP_Description varchar2(250), Standard_Min_Labor_Cost number(4,2), Standard_Min_Labor_Hours int,...
1
vote
2answers
41 views

SQL Server 2008 - Two FULL backups in one day

There is a database backed up by NetBackup once a day (Full backup 6PM to tape + 3/4x log backup per day). Database is in FULL recovery mode. Vendor of application has remote access and he scheduled ...
1
vote
1answer
43 views

Truncation error creating clustered index on schema-bound view

I was just creating a schema-bound view that I wanted to put an index on (to try out some computed column variations). I created the view WITH SCHEMABINDING, then I had to create a clustered index ...
-2
votes
2answers
37 views

query tuning help [closed]

All, Would need some tips / tricks to tune this query please: WITH Candidates(ActivityId) AS( SELECT ActivityId FROM EmailHashBase WITH (NOLOCK) WHERE ActivityId IN ( ...
1
vote
1answer
44 views

SQL Server List a Database's Users' Permissions

I have an SQL Server and it has 60+ databases. Each database has 3-10 users. I need to list database users' permissions for all databases. I can't find any clear solution on the internet. I need to ...
0
votes
1answer
94 views

calculate running balance of debit credit using union all

i'm making account statement for which i need that account balance before today and with each transaction row of debit or credit plus and minus from initial opening balance on the basis debit/credit ...
0
votes
2answers
24 views

The Filegroup PRIMARY for the database CRM running out of space

I have a db for which I am getting error as shown below. The Filegroup «PRIMARY» for the database "CRM" in SQL instance "MSSQLSERVER" on computer "prod" is running out of space. sqace details in MB ...
0
votes
1answer
47 views

Is ORDER BY on two indexed columns will be slow?

I have multiple-field index on columns a,b,c,d and another unique index on column id. Is my query like below after adding id to ORDER BY slows large or i don't need to worry ? Query plan shows that ...
0
votes
1answer
40 views

In sql-server according to syntax, who has to go first: DECLARE or SET NOCOUNT ON?

In sql-server according to syntax, who has to go first: DECLARE or SET NOCOUNT ON?
0
votes
0answers
31 views

Cannot Connect to New Server

Disclaimer, I'm not a dba. I have been handed the job and have to do it. For day to day operations, I can handle the job, but now they want to upgrade the server and I'm stuck on this one issue. I ...
0
votes
0answers
30 views

Is it possible to use OAUTH2 in MS SQL Server

I am using msdb.sp_senddbmail procedure to send emails from MS SQL Server but now I need to move to OAUTH2. I tried to implement separate application and call it from procedures using xp_cmdshell but ...
0
votes
1answer
39 views

XQuery in SQL Server to convert XML column data to relational data table

I previously asked a question about an error I was recieving. You don't really need it to understand this question but it's here for reference: XML/SQL Server 2008 Error: XQuery...Cannot implicitly ...
1
vote
2answers
31 views

Produce fixed length output to file regardless of the length of data in each column/row

Not sure about this as I'm kind new to this. I need to output rows to fixed length files format. The table's columns are ID, Name & Desc. The output should be the same length for each row ...
-1
votes
2answers
36 views

How to get First in and Last out in multiple records with night shift:

We have Date, Time, EmpId, InOut, Shift_Start_Time and Shift_End_Time of an employee. Need your help to write a sql for these conditions: 1.Consider the records which Time is falling between ...
0
votes
1answer
70 views

The invoice number is characters and numbers combined but I want to change these to numerical only in SQL

The invoice number is characters and numbers combined but I want to change these to numerical only in SQL. I want like this CC/DDD/1, CC/DDD/2 .... n
1
vote
1answer
62 views

Is it better to add a data file or better to increase the existing files (MAXSIZE)

I'm quite familiar with SQL-Server as a developer but not so much in the DBA role. Currently I'm working on a rather large DB (~7TB, living in 7 files, all equal in size and all within one single ...
1
vote
1answer
44 views

Update statistics

For the data retention purpose I am deleting records from some 60 tables. Some of the tables have less number of records while some have more. I don't want to update the stats for all the tables. Is ...
-1
votes
1answer
65 views

Improve performance in Deletion Operation

I Am doing Import Process of half a million records. Initially i will move the .csv file data to a sql table,then i will parse the records (Split the records to different tables and then parse) and ...
0
votes
0answers
34 views

Strange SQL 2008 R2 Sp3 Ent behavior - redistribute data across multiple files

I’ve got a 5TB database (Database_PROD) in one data file (1,5 TB of empty space in it). Installed some time ago by someone on SQL Server 2008 R2 SP3 Enterprise. Database contains 2726 tables and 5399 ...
2
votes
1answer
41 views

Error while creating Extended Events on 2008 SQL Server

I am trying to create an extended event to capture the login information of my server. While creating an extended event on SQL 2008 using the below query CREATE EVENT SESSION [SA_Monitor] ON SERVER ...
0
votes
0answers
45 views

SQL Server 2008: The target name, “package0.event_file”, is invalid, or the object could not be found

What can cause the following error? Msg 25623, Level 15, State 2, Line 1 The target name, "package0.event_file", is invalid, or the object could not be found Given the following TSQL: CREATE EVENT ...
0
votes
3answers
78 views

MS SQL 2008 R2 - How to use a production database through dev/test environments or how to copy a SQL schema and all its data to another

We currently have 3 Windows Server 2008 R2 VM identically build for Sage x3 v6.5, one for production/formation/budget database, a second one for QA (qualification) and a third one for dev & tests. ...
0
votes
0answers
71 views

Unable to create linked server from SQL Server 2008R2 to Azure SQL

I have created a couple of databases in Azure and added them to an Elastic Pool. I am able to create a linked server on SQL Server 2017. The issue I am faced with is when creating the linked server ...
1
vote
2answers
169 views

Oracle to T-SQL OPENQUERY special character conversion issues

I'm struggling to figure out where the character encoding issue on my Linked server may be coming from here. The ZPDT_PAT_ALPHA column should have a degrees symbol at the end, as shown by the DUMP. ...
0
votes
2answers
25 views

Merging or transposing data

Data structure as follows: ID Oper DateTime 3849 Login 2019-12-17 06:30:57.500 3849 Logout 2019-12-17 15:46:37.880 3849 Lunch 2019-12-17 12:16:11.373 3849 LunEnd 2019-12-17 12:46:26....
1
vote
3answers
105 views

How to Add A User To A Database In Standby / Read-Only Mode In Sql Server

I have a database which is in standby / read-only mode in my reporting server. But, I can not add a new user to this database. How can i add a new user to this database?
0
votes
3answers
329 views

How to optimize this Select MAX() SQL query?

In the following select query, it take almost 1 min to return the result, seems the table has over 2 millions record and growing. There are no index i can use from the table. How do I optimize this ...
0
votes
0answers
34 views

Unfinished A Killed/Rollback Transaction [duplicate]

I have killed a transaction 2 days ago but it hasn't finished yet. You can see the situation in the pic. What can i do?
4
votes
1answer
249 views

Insert multiple rows into a table with only an IDENTITY column [duplicate]

I have a table called dbo.Groups defined like this: CREATE TABLE dbo.Groups ( GroupID int NOT NULL IDENTITY (1,1) PRIMARY KEY ); The table really consists of just the one IDENTITY column. ...
6
votes
3answers
814 views

Keeping data in old Database (SQL 2008) identical to new Database (SQL 2016)?

I am moving database to new server. New server has SQL Server 2016 running, current server has SQL Server 2008. I need to have backup/fallback plan in place for few weeks (in case something goes ...
-1
votes
1answer
36 views

How to Find All Sql Server Users Privileges Rights

I want to list all user's privileges which is in Active Directory accout or using Sql Server account to connect to my database server. I want to see that which users have ddl right or which users can ...
0
votes
2answers
58 views

Database Log File Size Growth So Huge Unexpectedly [duplicate]

My database has two log files. Their sizes are growing very fast. My backup sizes are becoming massive. I know that when I take full backup of my database, the log files are emptied but it is not. I ...
3
votes
2answers
114 views

Restore from SQL Server 2008 to 2014

When a full-backup is restored by the DBA, does the DBA need to restore permissions, users, and roles separately? Or does it all come with the full restore? I am from the dev team. We are migrating ...
1
vote
1answer
64 views

How to Get Backups & Restores Start and Finish Times?

I backup my databases from prod environment to file server. After taking my backups, i restore them to my report server. And i want to know that if i can get information about when backup and restore ...
3
votes
1answer
33 views

Permission Denied for a User that is part of AD

I have a group created in Active Directory. This Group contains 3 users. For some strange reason one of the user within the group can't select from specific type of SCHEMA whilst the 2 other users ...
1
vote
0answers
32 views

Capture trigger update() with inserted & Deleted changes only

I have price table that has over 100 columns. I'm in the process of fine tunning triggers and reducing amounts of records inserted, to audit changes when updates are applied. The audit table ...
0
votes
0answers
25 views

How to create difference value in last group row

I want to create a query for a find difference value between Quo QTY and INV QTY and display in the last group row. For example, in this picture, I want to query a display like this. but now it ...
0
votes
1answer
92 views

Moving Partitioning Files To Another Disk Drive In SQL Server

There is a production table which was partitioned by someone in our company. Some partitioning files was wrongly located to different disk drive. I have to move those files to the disk where they ...
0
votes
1answer
110 views

Unable to trace “Arithmetic overflow error converting numeric to data type numeric” error in profiler

I have a .net application. Its trying to create tables, views and insert/update data into many tables. while application running i got an error. I tried to trace the query in SQL Profiler, but i ...
2
votes
2answers
132 views

'Row Goal' different behavior - why?

This is a heap with 400+ Million rows and 16 non clustered indexes, 146 columns. Please do not focus on why I cannot create a clustered index. That is not in my control and not in scope to my question....
4
votes
1answer
84 views

How do I solve the following error on attaching ldf-less database in SQL Server?

Before you write about the dangers of not having backups, etc., please withhold judgement... perhaps I just inherited the problem? I have an .mdf which which I am trying to attach to SQL Server 8. I'...
-1
votes
1answer
124 views

How to sync data between two databases on two different ms sql server instances - one 2008 and the other 2016

What is the easiest way to sync data between two databases on two different instances. I am not thinking replication. Just sync e.g. production database to test database from time to time.
0
votes
1answer
76 views

Migrating a maintenance plan from ms sql 2008 to 2016

I have a bunch of maintenance plans that I want to copy/migrate to sql server 2016. I am able to connect to Integration Services on sql server 2016 but I get the following error when expanding 'MSDB' ...
-3
votes
1answer
59 views

Sql query to Clear existing email addresses from table [closed]

Sql query to Clear existing email addresses from table. please I need help
0
votes
1answer
87 views

What firewall ports should be opened for central management server

Within my environment we currently have a MSSQL installation which serves as the Master in a Multiserver Agent environment (MSX). Due to this server being within a tightly controlled network the ...
3
votes
1answer
132 views

Full recovery model and tablock inserts logging

When testing some queries, I set the recovery model to full on a database and ran two identical 1M row inserts, with and without TABLOCK. On the one with TABLOCK, I got around 9295 log records on a ...

1
2 3 4 5
77