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

Database Compression - Not compressing my Databases on SQL Server 2014.

$
0
0

Can anyone answer why my SQL Server Database Backups don't appear to be applying the Data Compression option when I submit a backup using the Management Studio GUI (?).  I begin by  setting up all my information in the backup General and Media Options. then in the Backup Options I select the "Set Backup Compression"  to  (Compress Backup).   I then execute this  process...  The Backup completes successfully, however it does not compress the (.BAK) file. 

let me also mention that the sys.configuration  value is set to (1) which is enabled:

Results from Select * sys.configuration table: 

configuration_id name value minimum maximum value_in_use description is_dynamic is_advanced
1579 backup compression default 1 0 1 1 Enable compression of backups by default 1 0

The net result is my backup (.BAK) file isn't any smaller by space than my Data File... 

So it appears SQL Server isn't Compressing my Backup... 

Please Help! 

           >Moskogie< 

  

   

iSeries DB2 Msg 15274 Access to the remote server is denied because the current security context is not trusted

$
0
0

We have a linked iSeries DB2 linked server on an SQL 2005 Standard SP2 box.  It is linked using the OLE DB provider for ODBC Drives.  The security context is "Be made using this security context:  Remote Login: pdiftp and the correct password"  When I run  the following stored procedure, it works: 
SELECT * INTO #temp FROM OPENQUERY (PANTRYDV,'SELECT EMPID, STNUM, LASTN, FIRSTN, HRATE, EMPTYP, PAYTYP, JCDESC, JOBCLS, HIREDATE, BIRTHDATE, STATUS FROM HRSTORE WHERE (STATUS = ''A'') OR (TERMDATE >= CURRENT DATE - 14 DAYS) ORDER BY EMPID ')

When I put it in a daily job, sql agent, it fails with:  Job 'AS400 Employee interface for Labor Scheduling' : Step 1, 'Run Stored Proc' : Began Executing 2010-02-08 15:57:44

Msg 15274, Sev 16, State 1, Line 8 : Access to the remote server is denied because the current security context is not trusted. [SQLSTATE 42000]

I created the pdiftp user on the sql box and given it sysadmin privs.

On the job step that executes the stored proc, I've clicked on the advanced tab and "Run as user" is pdiftp.

Just to be clear, I can log into the iSeries box using the pdiftp credentials and I can run the stored procedure inside the MS SQL Server Managment Studio just fine.  It is the agent that is erroring.

Any help will be greatly apprecaited.

Data Types for hyperlink

$
0
0
what is the data type for hyperlink in mssql

Where can I find the .ldf file associated with AdventureWorks 2008R2DW database??

$
0
0
Can anyone help?? Where can I find the .ldf file associated with AdventureWorks 2008R2DW database??  Am I just missing it on CodePlex?  I found the .ldf file for AdventureWorks 2008R2 OLTP, but I can't find it for the "DW" version.  Any help is appreciated.  Thanks.

Convert one column of comma delimited data to multiple columns - dynamic (without using Pivot?)

$
0
0

Currently, I have a table with multiple records for one person/customer. Only one column contain answer values to different questions (some are multiple-select answers to a question with a category data type). For the category data type questions, I need to break this column into several columns so that I will have only one record per person/customer. 

There are thousands of questions so I need a dynamic way to do this, without hard-coding all the answer- they are impossible to know, as some are even free-text answers. Thanks in advance


CustomerBirth Date  Age  Country  Question      Line Answer(Datatype)
Sandra 1/5/1976  40     USA    RedHairColor  Yes(Boolean)
Sandra 1/5/1976  40  USA  PastSurgeries  1  Back (Category) 
Sandra 1/5/1976   40    USA   PastSurgeries Shoulder(Category)



Differenct language setting for a same User in SQL SERVER

$
0
0

Hi All,

I have two web application and storing the information in two different databases in Sql server. I have mapped IUSER for those two databases.

Now, I want to configure the language setting for IUSR as below, So that, I can handle two different datetime settings for those two application by using the same user name.

Language 1 -> Database 1

Language 2 -> Database 2

Anyone suggestion on this? Thanks.

Best regards

Muthu

SQL Server 2012: 'SQLServerAgent' fails to start: not the expected Instance

$
0
0

Hello,

I'm experiences difficulties to get the SQL Server Agent of the main instance (MSSQLSERVER) runing.

It all works well until I added a named instance to my SQL Server installation (Developer edition)

The SQL Server Agent of the named instance runs fine, but I'm unable to start the Agent for the MSSQLSERVER instance.

SQL Server Agent logs this error (SQLAGENT.OUT):

! [000]''SQLServerAgent'' cannot start because the instance of the server(''THX_DEV'') is not the expected instance(''MSSQLSERVER'')

? [000] Configuration option 'Agent XPs' changed from 1 to 0. Run the RECONFIGURE statement to install. [SQLSTATE 01000] (Message 15457)

? [098]''SQLServerAgent'' terminated (normally)

I followed this blog SQL Server Agent cannot start because the instance of the Server Instance is not the expected Instancebut this did not works for me.

I also checked the registry value for HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL11.MSSQLSERVER\SQLServerAgent\ServerHost which is empty (i.e not specified), the same is true for the named instance.

Here is the result off Select @@ServerName on the main instance: THX

on the named instance: THX\THX_DEV

Any help is greatly appreciated.

Thanks Bodo

SQL DOP

$
0
0

Hi Expert

we have some queries when ran on excel,  or application server,  we have large Cxpacket wait in the activity monitor,  but when ran locally,  i check max degree of parrelism is only 2.



Query Plan Recompiles and Cacheing

$
0
0

We have a 2012 enterprise SQL Server instance that has a database with a 2005 compatibility level. We have a stored procedure that is timing out or stalling to fix the issue here are the steps we take.

1)   Uncommented the ‘OPTION(Recompile)’,

2)   Ran the query against it so it rebuilds and uses the new the execution plan

3)   Then uncommented the ‘OPTION(Recompile)’ back again.

Can someone suggest a better way of handling this? We can't move to 2012 compatibility level at this time because there are some deprecated features that other stored procedures are using.

View SSRS reports on web

$
0
0

I have developed SSRS reports.. client want them to view over the web.. they want to have a link where they can access these reports anywhere..

Can you please suggest the right option to perform this..

Thanks


SQL Server Named Instance Starts Slowly - Error with Resource Manager

$
0
0

We have two instances of SQL Server 2005 - SP1 installed on one server.  The default instance starts very slowly.  When looking at the log I can see the delay is due to Resource Manager based upon the following error.

 

Message

Resource Manager Creation Failed: 0x8004d102

(XACT_E_DUPLICATE_GUID)

 

What does this mean?

 

What would cause this to happen?

 

How do I resolve the problem?

 

Thanks,   Dave

Slow log backups with high CPU

$
0
0

Hi there,

We are having considerable pain when performing log backups on a large database with many files and partitions.  The database in question is over 1TB and has approximately 4,000 files (for table partitioning).

The command we use is:

BACKUP LOG [MyDb] TO  DISK = N'E:\MyDb.trn' WITH NOFORMAT, NOINIT,  NAME = N'MyDb', SKIP, NOUNLOAD, NO_COMPRESSION,  STATS = 10

The command takes 73 seconds to run (even when there have been very, very few transactions actually recorded), but the output tells a different story:

100 percent processed.
Processed 63 pages for database 'MyDb', file 'MyDb_Log' on file 1.
BACKUP LOG successfully processed 63 pages in 1.610 seconds (0.301 MB/sec).

SQL Server increases about 30% CPU usage during this 73 seconds.

The log file size itself is only about 50mb (since we regularly backup).

What is the log backup process doing to use so much CPU and take so long?

SQL Server DMV

$
0
0

Greetings All,

I want to retrieve back the past queries in my database while using DMV. My query join with dm_exec_query_stats and found out this dm_exec_query_stats only store today data, how to retrieve previous day data? DMV data will get deleted when perform restart SQL services or is there any other way to clear DMV data? Please advise. Currently I want to get back last week query and I want to know how long does my session being run. Thank you.

Regards,

Justin Wong

Clear Plan Cache on a table

$
0
0

I am running SQL Server 2012 with a compatibility level of 2005. 

I would like to know if there is a way to clear the plan cache on a table instead of the entire database? I know how to do it on a single stored procedure by getting the plan handle, but I want to do it on the table if possible.

 

SQL server Post Validation

$
0
0

Hi All,

I need such query or queries which can show me my SQL server Status as follow

1) All SQL server services are online and running
2) All Databases are online and accessible (sp_helpdb doesn't gives correct result here )
3) SQL agent is up and running
4) All alwaysOn Availability groups are online and running 

In short I need to check status of SQL server after we reboot The Windows server. 


SQL 2016 collation for sharepoint 2016 db

$
0
0
what would be right sql collation for share point 2016 db on sql 2016 instance

change some fields to be anonymous

$
0
0

Hello

Could you please tell me how to change some column and their fields to be anonymous?

(I have a database and i wana give one of its tables to some one else but i dont want them to see some of the columns)

What shoud i do?

software_vendor_id in msdb..Backupset always return 4608

$
0
0
software_vendor_id in msdb..Backupset always return 4608. is bug?

Manish

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;


Update to add a memory grant warning to the Showplan XML in SQL Server 2014 SP2

Viewing all 12844 articles
Browse latest View live


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