Quantcast
Channel: SQL Server Database Engine forum
Viewing all 15264 articles
Browse latest View live

SQL Server 2016: Alter in-memory table throwing error during parallel execution

$
0
0

Hello,

We ran into a weird issue with the SQL Server 2016 environment, our Application Upgrade is failing, that was handling the "Alter Table" to add a new column, for one of the in-memory tables.

In our SQL Server Instance, we have ~10 same application databases. When we run the upgrade sequentially one after another, it succeeds without any issues. 

But we are getting the below error when we try to upgrade all the DB's in parallel (to save time). Historically we haven't had any issues with the parallel upgrades (of course there's no parameter of In-Memory tables then).

"A user transaction that accesses memory optimized tables or natively compiled modules cannot access more than one user database or databases model and msdb, and it cannot write to master"

This is kind of a blocker for us, and any help in steps to resolve this, would help.

Thanks a lot.

Regds,

Kumar


Thanks, Kumar



Installing Visual Studio 2010 and SQL Server 2012 on Win7 X64 machine

$
0
0

Hello There, I am troubled installing SQL Server 2012 and Visual Studio 2010 on my development PC. 

If I install the SQL Server first and then the Visual Studio, it installs, but neither the Visual Studio nor the SQL Server Management Studio runs, claiming: Not all components of VS2010 are upgraded to SP1, and it provides a link where to download it.

When I browse to the link, it says that the address is not working now. It is permanently moved.

When I try to install SP1 from VS10SP1-KB2736182, it fails saying "Installation is blocked due to issues on your computer ... ". 

When I try to install SP1 from VS10SP1-KB983509 which I get from the SQL Server installation media, it starts and fails (rolls back)

If I install visual studio first, and then try to install SQL Server,  it say that Prior Visual Studio installation requires updates and the installation wizard doesn't progress anymore.

In the mean time, re-installed windows and then installed VS first, then applied VS10SP1-KB2736182, and then VS10SP1-KB983509. SQL Server 2012 installation wizard still claims that I need to apply updates to VS2010.

Are these two softwares not compatible with each other?

What is really happening?

Please Help, Help

Can you execute an extend stored proc from 64 bit sql 2008 r2 to access 32 bit windows 2000 machine

$
0
0
I realize all this is all bad, all legacy stuff which is the current production landscape I am trying to eliminate one step at a time. To get to more current hardware we are moving from a SQL 2000 machine to a SQL 2008 R2 machine and we have an issue with an extend proc not seeming to work. The proc was upgraded from a 32 bit dll to a 64 bit dll written in c++. The code does a number of things on the windows 2000 client which is 32 bit using windows sockets. My question is it regarding the 64 bit to 32 bit, since the call is from a 64 bit machine is this even possible? I am not the developer here and have no experience with using windows sockets which is what this DLL is doing.

handle text qualifier in bulk import xml format file

$
0
0

I have a csv file that I need to bulk import using an xml format file . I cannot use SSIS since I will have hundreds of csv files all different and already have the table metadata . I figured should be simpler to script format files based on the table schema ex:

Csv file is

"column 1","column 2","column 3","column 4","column 5","column 6"

"John","Doe","fieldJohn","valJohn","2.45","1"

"Mary","Jay","fieldMary","valMary","2.45","1"

"Roger","Moore","fieldRoger","valRoger","2.45","1"

Can generate an xml format file from table running bcp however this will not handle the “ for the text qualifiers before and after every column value but just the comma, how do I add the “ text qualifier before and after in the xml format file? even worse the import is incorrect if there are commas inside the column value . I cannot change the source export.

Thank you,

<?xml version="1.0"?>

<BCPFORMAT xmlns="http://schemas.microsoft.com/sqlserver/2004/bulkload/format" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

 <RECORD>

  <FIELD ID="1" xsi:type="CharTerm" TERMINATOR="," MAX_LENGTH="500" COLLATION="Latin1_General_CI_AS"/>

  <FIELD ID="2" xsi:type="CharTerm" TERMINATOR="," MAX_LENGTH="500" COLLATION="Latin1_General_CI_AS"/>

  <FIELD ID="3" xsi:type="CharTerm" TERMINATOR="," MAX_LENGTH="500" COLLATION="Latin1_General_CI_AS"/>

  <FIELD ID="4" xsi:type="CharTerm" TERMINATOR="," MAX_LENGTH="500" COLLATION="Latin1_General_CI_AS"/>

  <FIELD ID="5" xsi:type="CharTerm" TERMINATOR="," MAX_LENGTH="500" COLLATION="Latin1_General_CI_AS"/>

  <FIELD ID="6" xsi:type="CharTerm" TERMINATOR="\r\n" MAX_LENGTH="500" COLLATION="Latin1_General_CI_AS"/>

 </RECORD>

 <ROW>

  <COLUMN SOURCE="1" NAME="column 1" xsi:type="SQLVARYCHAR"/>

  <COLUMN SOURCE="2" NAME="column 2" xsi:type="SQLVARYCHAR"/>

  <COLUMN SOURCE="3" NAME="column 3" xsi:type="SQLVARYCHAR"/>

  <COLUMN SOURCE="4" NAME="column 4" xsi:type="SQLVARYCHAR"/>

  <COLUMN SOURCE="5" NAME="column 5" xsi:type="SQLVARYCHAR"/>

  <COLUMN SOURCE="6" NAME="column 6" xsi:type="SQLVARYCHAR"/>

 </ROW>

</BCPFORMAT>

Reg:How to replace the total value present in my column with * in sql server table

$
0
0

Hi Team,

I want to replace one of the column data present in my table with * value in select statement.

How can i achive this?

Thanks in Advance.

SQL setup service account

$
0
0

Hi All

May I know if the service account to startup database engine setup, for example domain\sql_serviceaccount,

it will automatically added to the following local policy group ?

Log on as a service

Bypass traverse checking

Replace a process level token

Data Migration - Oracle database to SQL Server 2016

$
0
0

Hi I am on challenging work migrating Oracle 11 database to SQL Server 2016. This is One:one. Exactly same tables,views,etc should be in SQL Server.  I am explore how best I should do.  source database has following object types.  I have following analysis on Oracle

index 2010

tabes 2101

Views 334

LOB  100

Store procedures 200

Functions 201

Data base size is 600GB, I found some of the tables have over million records.

Task to do:

1. Any migration tool  recommend any.

2. Does it able to migrate BLOB data type data?

3. Its not practical to create tables with relative data types on SQL Server side. Tool would be best .Any suggestions .

4. Any method on system cut over, apply  change data to reduce down time of the system .

I am not sure SSMA(Migration Assistant ) is capable to handle large DBs and migrating BLOB, special   objects as well

Many thanks for golden advise



Problem in configuring Database Mail

$
0
0

Hi guys, 

I am trying to configure the database mail but something is wrong and I don't know how and what to check. For example, when I click on send test email, it puts the mail in the queue but nothing happen. Mail and smtp are correct...what can I check? In the log there is nothing, just blank.

Thanks 


Database Refresh and User Permissions grant

$
0
0

I am  configuring auto fresh process on SQL server 2016 from production to test env. users, permission are different to prod and test.

What I need to do before refresh backup the existing test env. users accounts, permissions and re-run permissions back to newly refresh DBs.

I found a note from google and looks similar to my requirement and save permmsions on master DB. Its a great one. but , grants fail when its exist or something wrong with the script.

https://www.sanssql.com/2013/04/database-refresh-and-user-permissions.html

Basically what iI need to move forward to next step until end if on error the any steps. This note I experience looks like hang.

any one has idea to share. Many thanks

Memory optimized types do not work in Microsoft SQL Server 2017

$
0
0

Memory optimized types do not work in Microsoft SQL Server 2017 Developer (64-bit) version 14.0.3038.14, OS Microsoft Windows Version 1803 (OS Build 17134.320). Steps to reproduce

/*
Memory optimized types does not work in

Microsoft SQL Server 2017 Developer (64-bit), version 14.0.3038.14
OS Microsoft Windows Version 1803 (OS Build 17134.320).

nkuvyrkin
*/
create database [TestDB];
go

use [TestDb];
go

alter database [TestDB]
add filegroup [memory_optimized_data] contains memory_optimized_data;
go

alter database [TestDB] add file (name='memory_optimized_data', filename='C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\DATA\memory_optimized_data') to filegroup [memory_optimized_data];
go


create type [dbo].[Test] as table(
    [id] int not null,
    primary key nonclustered ([id])
)
    with (memory_optimized = on);
go

/*
Result:

Msg 41313, Level 16, State 1, Line 12
The C compiler encountered a failure. The exit code was 2.
*/

C compiler out:

Microsoft (R) C/C++ Optimizing Compiler Version 18.10.40116.18 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

xtp_v_30_981578535_186268456414124_1.c
xtp_v_30_981578535_186268456414124_1.c : fatal error C1001: An internal error has occurred in the compiler.
(compiler file 's:\dd\feature\18point1rel\src\vctools\compiler\cxxfe\sl\p1\c\p0io.c', line 2807)
 To work around this problem, try simplifying or changing the program near the locations listed above.
Please choose the Technical Support command on the Visual C++ 
 Help menu, or open the Technical Support help file for more information

How do you calculate space needed for reindex?

$
0
0

How do you calculate free space that will be needed for a large table and where must the space exist?

Choices of reindex are:

Alter index all on TblName1 rebuild with (fillfactor = 95, online=on)    so not using Tempdb to sort.

Or


Table information from sp_spaceused:

namerows            reserved data          index_sizeunused
tblname1   1076099840 757502152 KB566286752 KB172174904 KB     19040496 KB

Has 1 clustered index and 4 non-clustered indexes.

Issue with Database mail

$
0
0

Dear All,

I have SQL server 2016 SP2 installed along with latest Cumulative Update . Database mail is not working . When I am sending test mail, database mail log showing as "Activation successful" but no mail is getting delivered. Can anyone kindly assist asap.


Best Regards,
Sandy

Strange issue while connecting from SSMS of any client Machine

$
0
0

Dear All,

I am facing a strange  issue while connecting a particular SQL database server from SSMS in any client machine whenever I am changing my SQL server  DB services under a service account , I can't connect from any client machine by SSMS and getting the error message as "The target principal name is incorrect,Can not generate SSPI context" . However, I have no issues while connecting from client using the same service Account for running SQL server database service in three other different servers in same domain , please guide me . SQL server version is 2016 SP2 with latest CU updated.

Best Regards,
Sandy

Instance crashes with error on Tempdb with error code 3316, 3314, 3349

$
0
0

I am getting a strange problem at SQL instance (Version Microsoft SQL Server 2008 R2 (SP3-GDR) (KB4057113)). Server restart unexpectedly with following error:

Error: 3316, Severity: 21, State: 2. During undo of a logged operation in database 'tempdb', an error occurred at log record ID (14236:17637:199). The row was not found. Restore the database from a full backup, or repair the database.

 Error: 3314, Severity: 21, State: 4. During undoing of a logged operation in database 'tempdb', an error occurred at log record ID (14236:17637:199). Typically, the specific failure is logged previously as an error in the Windows Event Log service. Restore the database or file from a backup, or repair the database.

 Error: 3449, Severity: 21, State: 1.SQL Server must shut down in order to recover a database (database ID 2). The database is either a user database that could not be shut down or a system database. Restart SQL Server. If the database fails to recover after another startup, repair or restore the database.

After restart it runs for some time (few minutes or hours) and again restart with same error. There are no errors when DBCC CHECKDB is run on system databases.

Changing location of tempdb files and and recreating it in new location also doesn't work.

Am I missing something? Please suggest.




Application performance issues

$
0
0
Hello, we had a application performance issue few days ago. The SQL version is 2008R2 with latest service pack. We are trying to get the root cause of the issue, but unable to get the root cause. The SQL Server error logs or the windows logs didn't capture much, so wondering where else we can look for the root cause. Any pointers would be helpful. Thanks.

sqldev


SQL Server 2008 R2 SP3 intermittent can't connect to server

$
0
0

Hi,

Anyone please help me with this some weird issue, so i have SQL server 2008 R2 SP3, which these 3 days always occurs below error while i'm trying to connected via SSMS from remote computer / local.

" A severe error occurred on the current command. The results, if any, should be discarded. "

I'am suspecting this error occurs when i'am connected one of the client PC (Just turn on and connected to the LAN cable without open any programs) but it's occurs intermittent, and connection to the SQL server is good (i'm using PING command).

Please someone hep me with this issue.

Reg: How to Suggest SQL Server Database Server Configuration...

$
0
0

Hi Team,

Can i know measurements and key values to suggest the RAM and Numbere of Cores and Hard Disk of the SQL Server Database Server.

is database size play an vital role in this configuration?

Thanks in Advance.

Run Job on Different server and get the results back and go to next step

$
0
0

Hi All,

I have a small query. I have a Server where we run all our job for clients. due to some internal constraints now we need to kick of a job on different server(server b) as part of the job on server(server a).

I need to wait for results(the job to complete on server b) before i go to next step in server a.

Is this possible?


Thanks & Regards,
Manjunath C Bhat,
http://manjunathcbhat.blogspot.com
http://manjunathcbhat.wordpress.com

Restore script T-SQL to new database name on same server

$
0
0

Quick question regarding how to script a restore to a new database name on the same database server host using T-SQL commands/script.

Environment is MS SQL Server 2012 on Windows 2012 Server

1. I have copy only database backups that do a copy only backup to a drive C:\backups\database_date.bak

2. I want to write a T-SQL script to grab the backup file and restore to a new database name from database A to database_newname

so that I don't overwrite the existing database on the server during the restore. Sort of a refresh on same host to new database name for test purposes.

How would I do this in T-SQL?

Network Performance Analysis for SQL Server

$
0
0

Hi Folks,

I need to analyse network performance for one of our SQL database server. I searched many blogs and articles on internet in which I found the perfmon counters need to set for network performance analysis but I didn't find complete threshold values for all the counters. In absence of threshold values I am not able to conclude anything about network performance. Can anyone help me out with threshold values for below network performance counters, also let me know if these counters are sufficient to conclude anything or do I need more counters;

Network InterfaceBytes Total/sec
Network InterfaceBytes Received/sec
Network InterfaceBytes Sent/sec
ServerBytes Total/sec
Processor% Interrupt Time
Network Interface(*)Output Queue Length

Thanks in advance

Viewing all 15264 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>