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
34 views

Inserting Millions Records Into A Table With Identity Column In Sql Server

I was changing the primary key column to different column on a table which contains about 300 million records in itself. I used the table design screen to change it but it got time-out. And, i decided ...
1
vote
1answer
30 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
24 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
43 views

A Procedure Causes Some Blockings In SQL Server [closed]

There is a stored procedure in my sql server database and it causes so much blockings for itself. Here is the code. How to solve this issue? USE [FATURA] GO /****** Object: StoredProcedure [dbo]....
-1
votes
1answer
47 views

How can I achieve the below case in marketing cloud without using loop? [closed]

I have a table like this and in the table you can see 123 losing to 456, 456 losing to 789 and 789 losing to 101112 and in the same fashion for ID's 5 and 6. In this case I want to replace winner ...
0
votes
0answers
21 views

SQL Instance not upgrading after install SQL Express 2014 [closed]

I'm trying to upgrade SQL Server 2008 R2 version 10.52.4000.0 to SQL Server Express 2014. All the packages seem to install correctly, however the Database Instance never upgrades. I don't see any sign ...
0
votes
0answers
19 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
43 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
53 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
64 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
90 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
26 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
59 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
68 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
52 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
66 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
38 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
25 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
69 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
58 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 ...
-1
votes
1answer
38 views

SQL Job failing due to an error [closed]

I am no expert with SQL for sure but I am wondering if I could take a swing at this on my own. I have an SQL job called "Misc Update NAV" that is scheduled to run every day at 7 am, however, when ...
1
vote
3answers
103 views

Query to see Index Fragmentation on all databases without using SP or temp tables

I am trying to compile a index fragmentation report on all databases, in a multi-server environment. The query will be executed via an openquery command, so I would like to make it as simple as ...
1
vote
2answers
46 views

Inline function Plan Properties in SQL Server 2008

Currently I use the below two queries to get some properties from the execution plan in stored procedures, the problem arises when I try to run it in a SQL Server 2008 version. Do you know if there is ...
6
votes
1answer
98 views

Issue with variable length string between compatibility level 80 and 100

I was getting tons of issues related with a specific scenario on my current enterprise. We have a SQL Server 2008 and we want to move to SQL Server 2016, so we are moving the compatibility from 80 to ...
1
vote
3answers
96 views

Force using an Index in Inner Join SELECT [closed]

I have the following query: select field1, field2 from table1 t1 with (index(IndSearch)) inner join table2 t2 ON t2.Id = t1.Id where t1.date between '04/01/2019' AND '05/01/2019' AND t2.field3 IN(...
4
votes
2answers
282 views

Start job from another SQL server instance

I have a job on an SQL 2008 server (Server A) (I know this is not ideal... That issue is being addressed). The agent runs under NT AUTHORITY\NETWORK SERVICE. I want to add a step that runs a job that ...
1
vote
1answer
47 views

move blob data to new filegroup

short version: what options do i have to move a table that has blob data over to a new filegroup, without blowing out the txlog? details: we have an extremely over-allocated filegroup ("DA1"). the ...
12
votes
2answers
596 views

Can SQL Server create collisions in system generated constraint names?

I have an application which creates millions of tables in a SQL Server 2008 database (non clustered). I am looking to upgrade to SQL Server 2014 (clustered), but am hitting an error message when under ...
-3
votes
1answer
64 views

SQL Performance Issues [closed]

I just recently configured a brand-new Windows SBS 2008 Server with SQL 2008. The box is a HP Proliant DL 380 G5 with 32GB RAM and a 250GB SSD. I have Access97 as a front-end and using ODBC I ...
0
votes
1answer
40 views

Missing Encryption Key when migrating Reporting Services from SQL Server 2008 to SQL Server 2016

Owing to a ransomware attack on our production server Reporting Services went down. This server was installed few years ago and its been in production for long. We have quite a few reports on this ...
0
votes
1answer
21 views

Multiple inserts using select row and variable combination with one SQL statement

I'm working with SQL 2008 R2 and have a need to find a specific row in a table that has three fields and then insert multiple rows into the same table with each insert using two values from the found ...
1
vote
1answer
104 views

I want to change to Dynamic SQL Query instead of CASE statement [closed]

I have two tables as below and description is given in below Employee table id EmployeeID departmentid department1 department2 department3 1 300 100 IT Finance ...
6
votes
1answer
823 views

Why am I getting the error “non-boolean type specified in a context where a condition is expected” for this request?

I am getting this error : "Error 102 : non-boolean type specified in a context where a condition is expected" for this request : DECLARE @num_dossiers TABLE (num_dossier INT,indice NVARCHAR(3)) ...
0
votes
0answers
47 views

Why can't SQL Server handle into's in 2 parts of a script? [duplicate]

I noticed some behavior I found weird while editing a co-workers stored procedure: create procedure weird_behavior (@switch bit) as if (@switch = 0) begin select * ...
2
votes
1answer
228 views

Table Fragmentation

If I execute the following: SELECT dbschemas.[name] as 'Schema', dbtables.[name] as 'Table', dbindexes.[name] as 'Index', indexstats.alloc_unit_type_desc, indexstats.avg_fragmentation_in_percent as ...
3
votes
5answers
439 views

Order table by two columns

I would like to order this table but I can not find a way to make it work. Can you help me? I have this table: I need this: I have a table where documents are listed, the first field is the id of ...
0
votes
1answer
63 views

Conversion of Row into Column

I'm in very weird situation and i have researched a lot but not able to find anything similar to this scenarios. Input looks something link this. Where Each patient has Primary Dx code, Admit Dx ...
7
votes
2answers
2k views

Why is my log file so massive? 22gb. I am running log backups

I can't seem to figure out the answer. I've seen multiple answers like this: Why Does the Transaction Log Keep Growing or Run Out of Space? and everyone talks about running back ups on your log file ...
1
vote
0answers
96 views

SSMS - Data load Option

I have recently installed the newer version of SSMS on my system. But the option to load the excel file is grey out. I'm not able to load BULK Load I tried to run DTSWizard.exe, even it doesn't give ...
0
votes
0answers
87 views

Loading 'Image Service Package' crashes Management Studio

I'm getting the following error on my SQL Server when I log into the system: I ran a repair on SSMS successfully, but it did not resolve the issue. The following error message is recorded in Event ...
0
votes
2answers
90 views

How to grant or allow a particular SQL Server Login/User to always view a Column Level Encrypted data?

I used Column Level Encryption to encrypt one of the columns in my SQL Server database. Now everytime I want to SELECT to see that encrypted data, I have to open the symmetric key to decrypt the ...
0
votes
2answers
56 views

Disk Separation DB installation and data files

I am wondering whether it is a good idea to separate the database installation media from the actual data files. In our current environment we have: C: - Windows Server D: - MS SQL Installation &...
0
votes
1answer
314 views

SELECT failed because the following SET options have incorrect settings: 'QUOTED_IDENTIFIER'

Whats wrong with this statement? why it gives below error message Error Message: SELECT failed because the following SET options have incorrect settings: 'QUOTED_IDENTIFIER'. Verify that SET ...
-1
votes
1answer
35 views

SQL Admission Count using row_number

I'm new in SQL Server learner and I'm stuck in simple problem to count the admission using SQL Server in healthcare data set. Sample table: create table admissions ( HIC char(1), DateFrom date, ...
0
votes
1answer
31 views

Joining on empty rows

I've got two tables. | tbAccountValues | +-----------------+ | Branch | Month | Values | +--------+---------+--------+ | 0001 | January | 1000 | +--------+---------+--------+ | tbMonths | +----...
0
votes
2answers
281 views

Using Cursor to loop through a Table variable in SQL Server

I have a parameter in the Stored Prod which gets some data in the format 1/1/2018-2/1/2018,2/1/2018-3/1/2018,3/1/2018-4/1/2018,4/1/2018-5/1/2018,5/1/2018-6/1/2018,6/1/2018-7/1/2018,7/1/2018-8/1/2018,...