Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

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
2
votes
0answers
12 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
21 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.
-1
votes
0answers
48 views

Incorrect syntax near the keyword 'CASE' [on hold]

When I ran my procedure, it got created successfully without any error. But when I try to execute it, I am getting an error. Error in executing bspCDRExtract in bspDynamicCDRExtract. Details: ...
0
votes
1answer
23 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
25 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
40 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
69 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 ...
0
votes
0answers
19 views

How to pass table valued parameter to sql server stored procedure from c# asp.net core [migrated]

I have made a Table valued type in sql server stored procedure and now I want to pass table valued parameter from c# to sql server. Please do let me know how can I achieve this? CREATE TYPE ...
2
votes
3answers
322 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
40 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
42 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
11 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
57 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
111 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
44 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
59 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
20 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
46 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
176 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
93 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
95 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
62 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
89 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
54 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
77 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
107 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
26 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
77 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 ...
-1
votes
1answer
58 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
315 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
49 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
99 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
105 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
352 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
54 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 ...
14
votes
2answers
652 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
63 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
27 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
123 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
1k 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 * ...