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
1
vote
1answer
56 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
29 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?
-2
votes
1answer
34 views

Literature Attachments on Pivotal 5.9 [closed]

Literature Attachments on Pivotal 5.9 We need to extract all Literature Attachments from the database . We cannot find any tool to assist with this effort . Please describe how we can extract the ...
-2
votes
0answers
31 views

Need to add a new AD group to SQL [closed]

Need to add a new AD group to SQL James created a four active directory group , each one unique to the four pivotal environments we have . When i open SQL management studio and try to add the group ...
4
votes
1answer
49 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
769 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
29 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
34 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
107 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
58 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
30 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
25 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
24 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
57 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
44 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
114 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
59 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
33 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
37 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
26 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
50 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
79 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 ...
2
votes
3answers
432 views

How to restrict deletion of specific row of SQL server table

I want to restrict deletion of specific row. For example if someone wants to truncate a table or delete all the records from table then an error message should be thrown, for particular id it is not ...
1
vote
0answers
42 views

ODBC connects but authentication fails on users table

We have sql 2008 running in mixed mode. The site where sql is running the ODBC connection works and ms access authenticates against the user table. We have an IPSec vpn to a satellite office using ...
0
votes
1answer
45 views

Correct way to restore dbs to new server

We are migrating from sql server 2008 to 2017 and will do the following install sql server 2017 on the new machine make backups of all dbs on old server RESTORE DATABASE DbName FROM DISK = 'C:\temp\...
0
votes
0answers
12 views

Import mysql tables and data into Sql server2008, when mysql is on a remote server and sql server 2008 is my local server

I am trying to import mysql tables and data (on a remote server), to sql server local database. I have exported data from mysql workbench and saved them as .txt and then imported flat text files into ...
-2
votes
1answer
80 views

Send by SQL sales report for each seller [closed]

How can I send a report to each seller about their sales? I can already generate the report, but I cannot send it individually, this is an example of my data this is my script, i hope someone can ...
1
vote
1answer
26 views

Updating values based on 3 table join

I have three tables orders, customer_old and customer_new. The orders table contains the old_user_login and associated order number. The customer_old table contains the information on customer, ...
0
votes
2answers
63 views

Sync database table schema and stored procedures

We have 2 databases. One is at our server, the other is local. We need to sync them both in a manner that local database has all data and server database has no data only empty tables and stored ...
3
votes
2answers
116 views

Can subqueries produce different execution plans than CTE's?

I was talking with the bossman, and he prefers subqueries over CTE's. Personally, I loathe subqueries. He mentioned that subqueries can be faster, but I am not convinced. I ran this short test: ...
0
votes
2answers
60 views

Memory issue in Transactional Replication

I want to replicate a data of 500 GB through transactional replication once in a day, so my query is this, will it create a new file in the snapshot folder on daily basis of 200-300 GB or will update ...
0
votes
1answer
125 views

Passing Variable in json_value in sql server 2016 [duplicate]

declare @id int set @id = 1754 select (JSON_VALUE(cast(ad.data_map as varchar(max)),'$.dataMap."1754".value')) CorrespondanceNumber, (JSON_VALUE(cast(ad.data_map as varchar(max)),'$.dataMap.***"'+...
0
votes
0answers
22 views

Insert Into Table From SQL Server To MySQL

I am on server1 which has a linked server to server2 and server3. This must be done on server1, but I can not get the syntax accurate. What I want to do is query server2 using OPENQUERY, and ...
0
votes
2answers
47 views

How To Grant A User Just To Create A Table In Existing Database But Not To See Other Existing Tables In It

We have dealed with an outsource company to install an application for use of our accounting department. Now, they want to access our existing database to install their application but i don't want ...
15
votes
5answers
5k views

How to add 1 milliseconds to a datetime string?

Based on a select, I can return x rows like this: 1 2019-07-23 10:14:04.000 1 2019-07-23 10:14:11.000 2 2019-07-23 10:45:32.000 1 2019-07-23 10:45:33.000 We have all milliseconds with 0. Is ...
-3
votes
1answer
378 views

The login is from an untrusted domain and cannot be used with Windows authentication

I am facing this issue after trying to run a Windows application on sharing client side in a workgroup environment, while this application working on server machine fine.
0
votes
1answer
127 views

Mssql query problem. Column '' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause

There is a problem I have experienced in mssql. ( but I don't have this problem in mysql. ) They know two different engines. but I could not find a solution. Do you think I can fix this error? My ...
3
votes
1answer
96 views

SQL Server 2008 R2 Edition Upgrade Process

I have several SQL Server 2008 R2 Standard Edition instances that we need to upgrade to SQL Server 2008 R2 Enterprise Edition. If I have valid SQL Server 2017 Enterprise Edition (with SA) PIDs, do I ...
0
votes
1answer
30 views

Get last Reoganized OR Rebuild index date

I am currently working on migrating sqlserver 2008r2 to SQL server 2016.The DBA before me used "IndexOptimize" from https://ola.hallengren.com/downloads.html to create the iIndex solution. I can see ...
2
votes
1answer
63 views

SQL Server takes an hour to fail over to secondary node

I am at a new job, we have a 2008 R2 (SP1) WSFC which hosts SQL Server 2008 FCI. Each node has it's own storage, nodes are 32 core with 32 GB memory (don't ask me why it is configured this way). ...
6
votes
3answers
3k views

Is it possible to alias a column based on the result of a select+where?

I have a table like this: TB1: COD | A001 | A002 | A003 1 cars baby nasa and then a second table: TB2: COD | NO_COL_TB1 | DESCRIPTION | 1 | A001 | Something 2 | A002 | ...
0
votes
1answer
111 views

Query to Find Multiple Start Time and End Time on a Single Day based on Boolean Value

I want to find the multiple Start Time and End time in a single Day based on the Boolean value where data is divided into each half hour interval for a day. So Each day is divided into 24hrs/2 = 48. ...
-3
votes
2answers
58 views

How can we get the output fields of a procedure?

I have written a procedure but I want to figure out what columns (fields) in the output without running the process?
1
vote
2answers
89 views

Handling data encoding issues while loading data to SQL from Script (Notepad++)

I'm pretty sure this is not a SQL Server problem. I already asked a question HERE with an awesome explanation, BUT I still can't explain to the guys where I work that it has nothing to do with SQL ...
0
votes
1answer
199 views

error 15466 An error during decryption

I have a stored procedure that runs xp_cmdshell with a user with sysadmin right.(it was created by someone else long time ago). For security purposes I need to remove the sysadmin right from this user....
0
votes
0answers
28 views

SQL Server upgrade advisor reserved keyword warning - Can't find keyword!

I am running SQL Server 2008 Upgrade Advisor tool on a SQL Server 2000 DB, and the final report shows an error: Database Server,"PreUpgrade", "After upgrade, new reserved keywords cannot be used ...
0
votes
1answer
42 views

Why does sql server have a hard time rounding floats?

if exists (select 1 from sys.tables where name = 'd_ratio') begin drop table d_ratio end if exists (select 1 from sys.tables where name = 'elrd') begin drop table elrd end CREATE TABLE [dbo].[...
1
vote
2answers
31 views

Simple confusion with DATALENGTH()

DATALENGTH() function returns the length of the data in BYTES. The table is like this: create table tb3 ( id int, id2 varchar(100), nome varchar(200) ) | id | id2 | nome | | |---------...
0
votes
2answers
90 views

SQL: Comparing multiple dates

I got a table with multiple columns that contain DateTime namely gendate1 up to gendate8. In my stored procedure, the user will have to input a date (@date_start). Now I have to compare the inputted ...
1
vote
0answers
60 views

How avoid updating unnecessary columns in Update statement? [duplicate]

I have an Update statement which update several columns. Some of those columns are nvarchar(max) type and not always need to be updated. I would like to avoid updating unnecessary columns, so, the ...