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

SQL server 2000, 2005, 2008R2 compatibility with Windows 2012

$
0
0

We have an environment with SQL 2000, 2005, 2008 R2. Now it has been decided to upgrade all the OS to Windows 2012.

Now is these versions are compatible with windows 2012?

Can any one refer some links also so that we can justify the compatibility level.

Thanks in advance.


SQL Server 2008 Express/SQL Server 2008 I'd like to remove the Express Instance

$
0
0

I have a server where both SQL Server 2008 and 2008 Express are installed. I would like to uninstall the Express version. When I go to Control Panel/Programs and Features, I don't see where I can uninstall only the Express version. Any suggestions? Thank you in advance for the help.

Mark

SQL SERVER 2012 - Stored Procedure not returning dataset (No columns are coming)

$
0
0

Hi All,

We are facing an issue while executing a stored procedure which uses a table of current database with INNER JOIN a table of another database in same instance.

Per our requirement, we are inserting select statement output in table variable. Then applying business logic and finally showing the data from table variable.

This scenario is working exactly fine in Dev environment. But when we deployed the code in quality environment. Stored procedure does not returning OUTPUT/ (No column names) from table variable.

During initial investigation, we found that collation of these two databases are different but we added DATABASE_DEFAULT collation in the JOIN.

Could somebody help us in resolving the issue.

Thanks,

Vishal Jharwade

Trace -T272, Also need use it in SQL Server 2014?

$
0
0
In the version of SQL 2012, it had to  use flag -t272 to retrieve the AutoNumber  behavior and prevent the problem of jump 1000 numbers of identity field...
SQL  2014 corrects that? Or is it the same? Do  I need use T272 also in 2014?


Could not login to database

$
0
0

Hi all,

I have SQL Server 2008 R2 on Windows Server 2008 R2 Enterprise 64-bit, on this server has three instances are running.
For several months ago it runs smoothly. But on this month user often could not login for all instances. I tried to restart service "SQL Server Browser" then user could login successful for all instances.
But I think it is not a good solution because now a day this problem often happens.

Please help me !

What is cause of the problem?

How to solve it?

Best regards,
Phea

Does logon trigger create internal temporary objects?

$
0
0

I create a logon trigger on a sql server 2008 r2 instance,the trigger is very simple,like this:

CREATE TRIGGER tg_login
ON ALL SERVER
FOR LOGON
AS
IF ORIGINAL_LOGIN() IN('sa') AND HOST_NAME()='TestHost1'
BEGIN
    ROLLBACK
    IF OBJECT_ID('master.dbo.LoginRecord') IS NOT NULL
    BEGIN
        INSERT INTO master.dbo.LoginRecord(LoginName,HostName)
        SELECT ORIGINAL_LOGIN(),HOST_NAME()
    END
END   

I use master.dbo.LoginRecord  table to record the bad logon.

When the trigger is working ,latches produced sometimes,wait type is PAGELATCH_UP  and wait resource is 2:1:3.At this time, a large number of logon failed ,error message is  "Logon failed for login 'login name' due to trigger execution."

I think  logon trigger create internal temporary objects maybe,it is right?



Logical CPU usage

$
0
0

I have a very strange situation. I have 6 logical core in the server, however only 4 cpu

I am use sql 2008 R2 standard 32bits

Linked Server to Oracle / decimal place truncation

$
0
0

Hey guys,

We're currently setting up a new production server with SQL Server 2014 SP 1 (old server: SQL Server 2008 R2). In both server we have a Linked Server to an Oracle database. We took Oracle Client 12.1 (old server: Oracle Client 11.1). Now, when I execute the following statement on both servers, the old one returns NUMBER(10,2) columns WITH decimal places, the new server cuts them off.

 SELECT * FROM OPENQUERY(MYLINKEDSERVER,
	'SELECT * FROM MYTABLE'
) AS UserSelection

Another strange thing:

  • when I use "SELECT CAST(MYCOLUMN AS NUMBER(10,2) ..." I get these decimal places on the new server.
  • when I use SQLPlus with "SELECT * FROM MYTABLE" I get the decimal places on the new server as well

Any idea why this would happen?

Thanks for your help...

Manuel


University of Applied Sciences of Eastern Switzerland (Rapperswil) | Microsoft Innovation Center Rapperswil


SQL Server Core Licensing - Server only using half of the logical processors

$
0
0

We have a server that has 4 sockets, 10 cores per socket and 20 logical processors per socket, giving us 80 total logical processors. However, the SQL Server is only using 40 logical processors. How do we change our licensing so the SQL Server uses all 80 logical processors.

Thank you for the assistance.

Mark

SQL produces wrong plan with existing FK

$
0
0

Hello,

We faced a very interesting issue that can't figure out why and how to check it.  A query takes about an hour in production server but takes only 2 sec in testing machines.  Yes, the production server is way, way better than testing machines.  We spent long time and finally found the culprit, which is a FK on a table.  We had to script it out, drop it and then recreate it to solve the issue. 

Now, I wonder why, without doing anything else, this fixed the issue.  With this FK, SQL produced a wrong plan but corrected it after recreated it.  Both checkdb and checktable didn't return any errors.

Anyone knows or faced this issue or knows how to check (or validate) FK? 

Thanks much for your help.

Truncate & Load a table with FullText Index

$
0
0

Hi,

I am using SSIS to replace set of tables daily. One of the table has primary, unique, foreign keys and full-text index. Before truncating, I am dropping the foreign key constraints (to truncate the parent table), truncating the tables and recreating the foreign keys.

I have few questions:

1) Do I need to drop and recreate the unique key as well? (I am not dropping the primary key) - Unique key is identity column created just for the full-text indexing since it was mentioned that key on integer is better than key on varchar and my pk is a varchar.

2) Do I need to drop and recreate the full-text index or just rebuild/repopulate it every time the table is loaded.

This is the first time i am using  full text index and I was able to learn a lot about it from the sites. I would like to understand the correct approach while loading the tables.

Thanks,

Arul


Arul

Need to create read-only database from production and restore on a different SQL server

$
0
0

Hello,

We have a production 2012 R2 SQL server that is not part of a domain. I have a database called CSSDC. I need to backup this database and make the BAK file available to a user on a different SQL server. Security is a concern. In order for this user to restore the database, they will have to be in the fixed server role sysadmins. I know I am going to have to use the Move with replace for the filegroups for the restore. Once the database is restored it will have to be altered to read-only. I would also like to remove the existing security and only have this new user access the read-only database. What would be the best approach?

SET READ_COMMITTED_SNAPSHOT ON

$
0
0

Hi all,

I've enabled snaphot isolation on my database with the following code:

ALTER DATABASE [MyDB] SET OFFLINE WITH ROLLBACK IMMEDIATE
ALTER DATABASE [MyDB] SET ONLINE
ALTER DATABASE [MyDB] SET SINGLE_USER
ALTER DATABASE [MyDB] SET READ_COMMITTED_SNAPSHOT ON
ALTER DATABASE [MyDB] SET MULTI_USER

the operation completes with no errors.

Then I run this query to check snapshot isolation:

select snapshot_isolation_state_desc,name from sys.databases where name ='MyDB'

I get 

snapshot_isolation_state_descname
OFFMyDB

Am I missing something?

SQL fragmentation for SharePoint 2013

$
0
0

Hello,

I want to ask about disk fragmentation for data its will be 64k but what is the best practice for Log and temporary storage do we use all 64k or there are some other specification ?

Regards,

Ayesh.

Failed to initialize sqlcmd library with error number -2147024809

$
0
0

I have searched around but cannot find an answer to this so any help is appreciated.  I have a 2014 server with dual instances.  When I execute the following query , it succeeds on one instance but fails on the other with the above error.  This is not related to SQL Agent, this fails on query execution within SSMS as well (on instance 2, succeeds on instance 1).  Names have been changed to generic below.  I have tried with/without various options in the call, nothing seems to work on instance 2, but works fine on instance 1.  IF I remove the @query parameter, I DO receive the email.

EXEC msdb.dbo.sp_send_dbmail

   @profile_name ='Profile1',

    @recipients = 'recipientlist',   

    @subject ='Error in rules-PLEASE INVESTIGATE-',

    @body ='There is an error in rules, a rule calls itself. Please fix.  The broken rule id is:',

    @query='select fields from table WHERE [RuleOnSuccess] = [RuleID] OR [RuleOnFailure] = [RuleID] ',

       @attach_query_result_as_file = 0;



statistics time different than sys.dm_exec_query_stats

$
0
0

Hi,

I'm doing some tests with the following query in adventure works: 

set statistics time on
select * from production.TransactionHistory 
order by modifiedDate desc
option (maxdop 1)

While statistics time shows something between 400/500 ms, when I query sys.dm_exec_query_stats I find a value of more than 1000 ms (in microseconds, I already converted the value).

The difference is even worse if I take out maxdop 1, statistics time shows 719ms while sys.dm_exe_query_stats shows more than 1600 ms. I identified my query used two cores, can I suppose the value of statistics time is per core ? But why the difference is more than the double ? And why the difference happens with maxdop 1 ?

Thank you !


Dennes - Se resolveu, classifique a mensagem, por favor - [http://www.bufaloinfo.com.br] NOVO DVD Segurança no ASP.NET : http://www.bufaloinfo.com.br/LearingSeriesSegurancaASPNET2.asp

Version Store and memory

$
0
0

I am stuck with a software which keeps transactions open on purpose!!!  As a result, my version store fills up to astronomical proportions.

To quantify the situation, the transaction may stay open for weeks (until we stop the service of the application to cleanly stop the transaction) and the version store can reach over 100GB which is unsustainable.

Versions store being in tempdb, is there a way to know if and how much of the memory is occupied by the version store. (quantify the impact)  i.e. if in addition to the knowledge that I am losing precious space on my LUN, can I quantify my waste of memory due to this ridiculous situation?

Cant remove key lookup from Execution plan

$
0
0
 

i am not sure how to eliminate a key lookup from the execution plan

  SET TRANSACTION ISOLATION LEVEL READ COMMITTED    
    SET NOCOUNT ON  

    SELECT COUNT(ph.lid) AS Total  
    FROM   PLB ph  
    WHERE  ph.lPhysician = @Physician  
    AND  ph.BSF = CAST(0 AS bit)  
    AND  ph.nRecordStatus = 1  
    AND EXISTS ( SELECT t.lLabReport  
     FROM PLBTests t  
     WHERE t.lLabReport = ph.lID  
                 AND (t.szFlag NOT IN ('', 'N') and t.szFlag IS NOT NULL))                

   SET NOCOUNT OFF 

        

k

Update stats ASYNC option

$
0
0

In our server (SQL 2014) we are frequently facing problems with table statistics. So we implemented a job to update stats with full scan on database level, but still we are facing the same problem with few tables.

When I tried to check tuning options, I just came to know about AUTO_UPDATE_STATISTICS_ASYNCoption which is in disabled state on the databases.

Enabling this option will help us to solve the table statistics problem ?

And Its  a huge database and also more transaction changes are happening on the database.

Thanks,


Vinodh Selvaraj

Short way to reach to issues?

$
0
0

When any issue came then I open mstsc connect login into server and then open ssms then open query window.

Is It a short way of all this?

Viewing all 12554 articles
Browse latest View live


Latest Images

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