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

Free space to the rest of the database from a single table

$
0
0

Hi,

I have a table where we did a compression the JPG that make up the LOB data. This made the table about 70% smaller. However, I can see that the unused space for the table is 56GB vs 41GB of actual data in the table.

I'm trying to release that unused space so that the space is not assigned just to this table but available to the whole database. I do not need to shrink the physical files.

Is this something that can be done?

SQL Server 2008 SP3 is what I'm running.

The index size is only 624K, the majority of the data is the LOB.

Is there a property of the table that is telling it to keep this much free space to itself? Or some other factor?

(we have Merge replication in use which makes it impossible for me to simple recreate the table, I really need another option).

Thank you.


Issue running procedures through SQL Server Agent

$
0
0

Hello,

We have a 2 stored procedures that runs will load data and will make use of cmdshell to move the files across the server.<o:p></o:p>

These procs runs fine when executed manually but do not run when it runs through the SQL Agent  job and throws the error<o:p></o:p>

Column name or number of supplied values does not match table definition.<o:p></o:p>

Any idea on this behavior ?? Why would it run manually and not through the Job .

Thanks !


trigger sql agent upon a data load completion

$
0
0

hi all,

i insert/update data from server A to server B

once the above step is successful, i want to try to start the sql agent job on server B.

how can i set the sql agent job on server b to check and make sure that that data load has been completed for that day and then start executing the job steps.

pleasse guide

nik

Error while restoring database

$
0
0

Hi all,

 I am getting the blow error message while restoring one Transaction log backup.

"The log or differential backup cannot be restored because no files are ready to rollforward. "


I was trying to understand the backup and restore in sql server especially how the  log back up can help to restore the data if the database is crashed. the following steps I have followed:

1)Created one database called "TEST" and created one table "T1" and inserted one record "r1"
2)Took backup and restored into other server.
3)Inserted record "r2" on the first server's"TEST" database and took transaction log backup
4)Tried to restore into second server, got the above error

Please help me to under stand the error and resolve.

Database trigger and backup restore.

$
0
0

SQL 2008 SP1 Standard edition.

I have noticed that DDL database triggers are not restored from full database backup.

Are they stored in master database?

Error: 18056, Severity: 20, State: 29.

$
0
0

Hi All,

I am getting fowling error on Windows 2008 R2 Server/SQL 2008 R2 Service Pack 1 (Build 7601). Server is production for last eight month never had any error. This first time we had error and all user went down until whole server rebooted. It didnt failed on Mirror server. Any resolution /help/ suggestion is appreciated.

Error: 18056, Severity: 20, State: 29.

2012-04-20 06:20:08.42 spid235     The client was unable to reuse a session with SPID 235, which had been reset for connection pooling. The failure ID is 29. This error may have been caused by an earlier operation failing. Check the error logs for failed operations immediately before this error message.
2012-04-20 06:20:08.42 spid231     Error: 18056, Severity: 20, State: 29.
2012-04-20 06:20:08.42 spid231     The client was unable to reuse a session with SPID 231, which had been reset for connection pooling. The failure ID is 29. This error may have been caused by an earlier operation failing. Check the error logs for failed operations immediately before this error message.
2012-04-20 06:20:13.88 spid140     Error: 18056, Severity: 20, State: 29.
2012-04-20 06:20:13.88 spid140     The client was unable to reuse a session with SPID 140, which had been reset for connection pooling. The failure ID is 29. This error may have been caused by an earlier operation failing. Check the error logs for failed operations immediately before this error message.
2012-04-20 06:20:47.41 spid175     Error: 18056, Severity: 20, State: 29.
2012-04-20 06:20:47.41 spid175     The client was unable to reuse a session with SPID 175, which had been reset for connection pooling. The failure ID is 29. This error may have been caused by an earlier operation failing. Check the error logs for failed operations immediately before this error message.
2012-04-20 06:20:49.68 spid93      Error: 18056, Severity: 20, State: 29.
2012-04-20 06:20:49.68 spid93      The client was unable to reuse a session with SPID 93, which had been reset for connection pooling. The failure ID is 29. This error may have been caused by an earlier operation failing. Check the error logs for failed operations immediately before this error message.
2012-04-20 06:21:31.87 Logon       Error: 18456, Severity: 14, State: 46.
2012-04-20 06:21:31.87 Logon       Login failed for user 'sems'. Reason: Failed to open the database configured in the login object while revalidating the login on the connection. [CLIENT: 192.168.10.39]
2012-04-20 06:21:31.87 spid140     Error: 18056, Severity: 20, State: 46.
2012-04-20 06:21:31.87 spid140     The client was unable to reuse a session with SPID 140, which had been reset for connection pooling. The failure ID is 46. This error may have been caused by an earlier operation failing. Check the error logs for failed operations immediately before this error message.
2012-04-20 06:23:18.83 Logon       Error: 18456, Severity: 14, State: 51.
2012-04-20 06:23:18.83 Logon       Login failed for user 'sems'. Reason: Failed to send an environment change notification to a log shipping partner node while revalidating the login. [CLIENT: 192.168.10.38]
2012-04-20 06:23:18.83 spid198     Error: 18056, Severity: 20, State: 51.
2012-04-20 06:23:18.83 spid198     The client was unable to reuse a session with SPID 198, which had been reset for connection pooling. The failure ID is 51. This error may have been caused by an earlier operation failing. Check the error logs for failed operations immediately before this error message.
2012-04-20 06:23:53.32 Logon       Error: 18456, Severity: 14, State: 51.
2012-04-20 06:23:53.32 Logon       Login failed for user 'sems'. Reason: Failed to send an environment change notification to a log shipping partner node while revalidating the login. [CLIENT: 192.168.10.38]
2012-04-20 06:23:53.32 spid136     Error: 18056, Severity: 20, State: 51.
2012-04-20 06:23:53.32 spid136     The client was unable to reuse a session with SPID 136, which had been reset for connection pooling. The failure ID is 51. This error may have been caused by an earlier operation failing. Check the error logs for failed operations immediately before this error message.
2012-04-20 06:24:19.48 Logon       Error: 18456, Severity: 14, State: 51.
2012-04-20 06:24:19.48 Logon       Login failed for user 'sems'. Reason: Failed to send an environment change notification to a log shipping partner node while revalidating the login. [CLIENT: 192.168.10.39]
2012-04-20 06:24:19.48 Logon       Error: 18456, Severity: 14, State: 51.

Many Thanks

Rupesh

Using SQL Azure for session state throws a cast error

$
0
0

I have a web application running on an Azure VM using SQL Azure for persistence. I just added a second SQL Azure database for ASPState. I believe that I have set up the ASPState database correctly but certain transaction cause aUnable to cast object of type 'System.DBNull' to type 'System.Byte[]'.

Here is the TempSessions table schema

CREATE

TABLE[dbo].[ASPStateTempSessions](


[SessionId]

NVARCHAR(88)   NOTNULL,


    [Created]         

DATETIME        DEFAULT(getutcdate())NOTNULL,


    [Expires]         

DATETIME        NOTNULL,


    [LockDate]        

DATETIME        NOTNULL,


    [LockDateLocal]   

DATETIME        NOTNULL,


    [LockCookie]      

INT             NOTNULL,


    [Timeout]         

INT             NOTNULL,


    [Locked]          

BIT             NOTNULL,


    [SessionItemShort]

VARBINARY(7000)NULL,


    [SessionItemLong] 

IMAGE           NULL,


    [Flags]           

INT             DEFAULT((0))NOTNULL,


   

PRIMARYKEYCLUSTERED([SessionId]ASC)

);


 


GO

CREATE

NONCLUSTEREDINDEX[Index_Expires]

   

ON[dbo].[ASPStateTempSessions]([Expires]ASC);


First Time Connection From Windows 7 to SQL Server 2005 Fails

$
0
0

Hi Everyone,

I have an application that connects to a SQL Server 2005 Standard Edition server. Most of the machines are running on Windows XP and can connect to the database successfully. But recently, I added machines that are running on Windows 7. These new machines fail to connect to SQL Server. But if I ignore the errors and continue (within the same  application), subsequent connections are OK. 

This is my connection string for all clients (XP and Windows 7)

Server=192.168.1.253;Failover Partner=192.168.1.252;Integrated Security=SSPI;Database=<mydbname>

I hope someone can help me.

Thanks,

Noob


Can i write blogs in MSDN related to SQL Server?

$
0
0

I am very passionate when it comes about SQL Server.

From the past 10 months i am writing blogs in SQL Server, and still i consider myself to be in a learning phase, which keeps me improving day by day.

You can see my blogs at: www.sqlservergeeks.com/blogs/piyush.bajaj.2007

So now i also want to contribute to MSDN with my knowledge, and i feel that it be my pleasure to write for Microsoft.

Thanks

Piyush

Tempdb mdf file is full

$
0
0

Hi All,

my tempdb mdf file is full .it occupies 85Gb out-of 90Gb

Server:Sql server2008R2

Please help me in this issue.


Maheshwar Reddy

Why updates on some tables with always on synchronize mode take * 100 than when asynchronize mode

$
0
0

I have Always-On synchronization on some databases, We want to change from asynchronize mode to synchronize mode, I tested to see what the  change in performance between the two, and found that in general the select statements keep the same duration with and without synchronize mode, most of the update\insert usually take around * 4 times from the asynchronize mode, BUT some updates take much longer. I would like to understand why things take MUCH longer (I understand that working with synchronize mode is a 2 phase commit and should take * 4 times, but I can't understand why some of them take 50 - 100 times more).

1. One query is an update made on a table with few records (up to 40 records), this update run 250K times a day, and a very simple update on this table takes * 98 than without synchronize mode

1. An update on a big table with 2 million records, using a query that specify the unique column in the primary cluster key, takes 50 times more.

What are  the factors that have dramatic influence on performance when 2 phase commit (asynchronize mode) is used?

I get one or the other error when i install SQL server 2012 SP1 in my Lab server

$
0
0

I get multiple errors when i install SQL server 2012 SP1 In my lab server.

Not sure why i keep getting different errors all the time when i install SQL server 2012 & 2012 SP1.

Below are error codes, screen shots and also a log of the error.

1.  Eror code 0X84B40000

Also dint understand any thing from this article related to the above error 

http://social.technet.microsoft.com/Forums/sqlserver/en-US/5b6cc928-0db8-4fe4-a5d3-21672225f0ca/i-get-error-code-0x84b40000-when-trying-to-install-sql-server-mgmt-studio-to-an-existing-sql?forum=sqlexpress

2. Eror code 0x851A001A

Can any one plz help as i always get one or the other error.

====================================

Screen shot: 

Please note the below screen shot has given the error code 0x851A001A which is same in case of failure of all the other features which have failed during this installation. Hence i have uploaded only one screen shot.



2. Log file content.

=================================

Overall summary:
  Final result:                  Failed: see details below
  Exit code (Decimal):           -2061893606
  Start time:                    2014-05-04 21:15:35
  End time:                      2014-05-04 21:51:45
  Requested action:              Install

Setup completed with required actions for features.
Troubleshooting information for those features:
  Next step for RS:              Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
  Next step for SQLEngine:       Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
  Next step for FullText:        Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
  Next step for Replication:     Use the following information to resolve the error, uninstall this feature, and then run the setup process again.


Machine Properties:
  Machine name:                  SERVER1
  Machine processor count:       2
  OS version:                    Windows Server 2008 R2
  OS service pack:               Service Pack 1
  OS region:                     United States
  OS language:                   English (United States)
  OS architecture:               x64
  Process architecture:          64 Bit
  OS clustered:                  No

Product features discovered:
  Product              Instance             Instance ID                    Feature                                 Language             Edition              Version         Clustered 
  SQL Server 2012      MSSQLSERVER          MSSQL11.MSSQLSERVER            Database Engine Services                 1033                Enterprise Edition   11.0.2100.60    No        
  SQL Server 2012      MSSQLSERVER          MSSQL11.MSSQLSERVER            SQL Server Replication                   1033                Enterprise Edition   11.0.2100.60    No        
  SQL Server 2012      MSSQLSERVER          MSSQL11.MSSQLSERVER            Full-Text and Semantic Extractions for Search 1033                 Enterprise Edition   11.0.2100.60    No        
  SQL Server 2012      MSSQLSERVER          MSSQL11.MSSQLSERVER            Data Quality Services                    1033                Enterprise Edition   11.0.2100.60    No        
  SQL Server 2012      MSSQLSERVER          MSAS11.MSSQLSERVER             Analysis Services                        1033                Enterprise Edition   11.0.2100.60    No        
  SQL Server 2012      MSSQLSERVER          MSRS11.MSSQLSERVER             Reporting Services - Native              1033                Enterprise Edition   11.0.2100.60    No        
  SQL Server 2012                                                          Management Tools - Basic                1033                 Enterprise Edition   11.0.2100.60    No        
  SQL Server 2012                                                          Management Tools - Complete             1033                 Enterprise Edition   11.0.2100.60    No        
  SQL Server 2012                                                          Client Tools Connectivity               1033                 Enterprise Edition   11.0.2100.60    No        
  SQL Server 2012                                                          Client Tools Backwards Compatibility    1033                 Enterprise Edition   11.0.2100.60    No        
  SQL Server 2012                                                          Client Tools SDK                        1033                 Enterprise Edition   11.0.2100.60    No        
  SQL Server 2012                                                          Integration Services                    1033                 Enterprise Edition   11.0.2100.60    No        
  SQL Server 2012                                                          Reporting Services - SharePoint                                                   11.0.2100.60    No        

Package properties:
  Description:                   Microsoft SQL Server 2012 Service Pack 1
  ProductName:                   SQL Server 2012
  Type:                          RTM
  Version:                       11
  SPLevel:                       0
  Installation location:         F:\x64\setup\
  Installation edition:          Enterprise

Product Update Status:
  None discovered.

User Input Settings:
  ACTION:                        Install
  ADDCURRENTUSERASSQLADMIN:      false
  AGTSVCACCOUNT:                 ms\sql
  AGTSVCPASSWORD:                *****
  AGTSVCSTARTUPTYPE:             Automatic
  ASBACKUPDIR:                   Backup
  ASCOLLATION:                   Latin1_General_CI_AS
  ASCONFIGDIR:                   Config
  ASDATADIR:                     Data
  ASLOGDIR:                      Log
  ASPROVIDERMSOLAP:              1
  ASSERVERMODE:                  MULTIDIMENSIONAL
  ASSVCACCOUNT:                  <empty>
  ASSVCPASSWORD:                 <empty>
  ASSVCSTARTUPTYPE:              Automatic
  ASSYSADMINACCOUNTS:            <empty>
  ASTEMPDIR:                     Temp
  BROWSERSVCSTARTUPTYPE:         Disabled
  CLTCTLRNAME:                   <empty>
  CLTRESULTDIR:                  <empty>
  CLTSTARTUPTYPE:                0
  CLTSVCACCOUNT:                 <empty>
  CLTSVCPASSWORD:                <empty>
  CLTWORKINGDIR:                 <empty>
  COMMFABRICENCRYPTION:          0
  COMMFABRICNETWORKLEVEL:        0
  COMMFABRICPORT:                0
  CONFIGURATIONFILE:             C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20140504_204851\ConfigurationFile.ini
  CTLRSTARTUPTYPE:               0
  CTLRSVCACCOUNT:                <empty>
  CTLRSVCPASSWORD:               <empty>
  CTLRUSERS:                     <empty>
  ENABLERANU:                    false
  ENU:                           true
  ERRORREPORTING:                true
  FEATURES:                      SQLENGINE, REPLICATION, FULLTEXT, RS
  FILESTREAMLEVEL:               0
  FILESTREAMSHARENAME:           <empty>
  FTSVCACCOUNT:                  NT Service\MSSQLFDLauncher$SCOM
  FTSVCPASSWORD:                 <empty>
  HELP:                          false
  IACCEPTSQLSERVERLICENSETERMS:  true
  INDICATEPROGRESS:              false
  INSTALLSHAREDDIR:              C:\Program Files\Microsoft SQL Server\
  INSTALLSHAREDWOWDIR:           C:\Program Files (x86)\Microsoft SQL Server\
  INSTALLSQLDATADIR:             <empty>
  INSTANCEDIR:                   C:\Program Files\Microsoft SQL Server\
  INSTANCEID:                    SCOM
  INSTANCENAME:                  SCOM
  ISSVCACCOUNT:                  NT AUTHORITY\Network Service
  ISSVCPASSWORD:                 <empty>
  ISSVCSTARTUPTYPE:              Automatic
  MATRIXCMBRICKCOMMPORT:         0
  MATRIXCMSERVERNAME:            <empty>
  MATRIXNAME:                    <empty>
  NPENABLED:                     0
  PID:                           *****
  QUIET:                         false
  QUIETSIMPLE:                   false
  ROLE:                          <empty>
  RSINSTALLMODE:                 DefaultNativeMode
  RSSHPINSTALLMODE:              DefaultSharePointMode
  RSSVCACCOUNT:                  NT Service\ReportServer$SCOM
  RSSVCPASSWORD:                 <empty>
  RSSVCSTARTUPTYPE:              Automatic
  SAPWD:                         <empty>
  SECURITYMODE:                  <empty>
  SQLBACKUPDIR:                  <empty>
  SQLCOLLATION:                  SQL_Latin1_General_CP1_CI_AS
  SQLSVCACCOUNT:                 ms\sql
  SQLSVCPASSWORD:                *****
  SQLSVCSTARTUPTYPE:             Automatic
  SQLSYSADMINACCOUNTS:           MS\Gautam, MS\SCOM Users
  SQLTEMPDBDIR:                  <empty>
  SQLTEMPDBLOGDIR:               <empty>
  SQLUSERDBDIR:                  <empty>
  SQLUSERDBLOGDIR:               <empty>
  SQMREPORTING:                  false
  TCPENABLED:                    1
  UIMODE:                        Normal
  UpdateEnabled:                 true
  UpdateSource:                  MU
  X86:                           false

  Configuration file:            C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20140504_204851\ConfigurationFile.ini

Detailed results:
  Feature:                       Reporting Services - Native
  Status:                        Failed: see logs for details
  Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
  Next Step:                     Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
  Component name:                SQL Server Database Engine Services Instance Features
  Component error code:          0x851A001A
  Error description:             Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.
  Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.3128.0&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026

  Feature:                       Database Engine Services
  Status:                        Failed: see logs for details
  Reason for failure:            An error occurred during the setup process of the feature.
  Next Step:                     Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
  Component name:                SQL Server Database Engine Services Instance Features
  Component error code:          0x851A001A
  Error description:             Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.
  Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.3128.0&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026

  Feature:                       Full-Text and Semantic Extractions for Search
  Status:                        Failed: see logs for details
  Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
  Next Step:                     Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
  Component name:                SQL Server Database Engine Services Instance Features
  Component error code:          0x851A001A
  Error description:             Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.
  Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.3128.0&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026

  Feature:                       SQL Server Replication
  Status:                        Failed: see logs for details
  Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
  Next Step:                     Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
  Component name:                SQL Server Database Engine Services Instance Features
  Component error code:          0x851A001A
  Error description:             Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.
  Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.3128.0&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026

  Feature:                       SQL Browser
  Status:                        Passed

  Feature:                       SQL Writer
  Status:                        Passed

Rules with failures:

Global rules:

Scenario specific rules:

Rules report file:               C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20140504_204851\SystemConfigurationCheck_Report.htm


temp tables not dropped SQL Server 2012

$
0
0

I have a server that houses a database application that makes heavy use of temp tables. It appears that temp tables are not getting dropped from the tempdb.  In perfmon the temp table count is hanging around 1000 and is not going down over time.

Even if the programmers are not using drop table at the end of their sps, shouldn't these temp tables be cleaned up when they go out of scope?


Jeff

Create linked server to MS-Access database from MS-Sql server

$
0
0

Hi,

I need to create linked server from MS-Sql server to MS-Access database. Unfortunately Sql server is 64-bit version, But MS-Access is 32-bit. 

can anyone please suggest how to connect MS-Access from Sql server

Thanks in Advance.

Naveen.P

SQL agent proxy account for Powershell

$
0
0

I am trying to use a sql agent proxy account for PowerShell. Created the ad account, credential and the proxy but because the PowerShell accesses a bunch o sql servers it errors out.Even when I created a login for all the sql servers the powershell is trying to access it still failed so next I'd need to look at what permissions the powershell ad account needs to the objects it accesses. Is this the correct approach?

What is the best way to go here and avoid using a sysadmin account to run the sql agent powershell job? Thanks!


Paula


Restore an SQL 2008 full backup to SQL Serveer 2005

$
0
0

 

Dear All,

 

I have been working on a database on my laptop that has SQL Server 2008 Ktma installed.

The database was restored from a full backup that I had taken from the production SQL 2005 server.

 

Now that I have finished my job I want to restore it back to the production Server (SQL 2005). I took the backup with "No compression" on a disk file through the SQL 2008 Management studio.

 

However when trying to restore the SQL 2008 backup onto the SQL server 2005 I get an error:

 

The media family on device xxxx is incorreclty formed ....

 

Can someone help me on this. Is it possible that sql 2008 backups are not compatible to the sql 2005 structure?

Is there anyway to have my database restored back on the sql server 2005?

 

Thank you in advance,

 

S. Menegos

 

PS: It is not an issue of malformed file since I did the process several times (taking the backup, coping to the sql server 2005 machine).

 

 

Problem to create database after Drop

$
0
0

Hi,

I need to create automatically a lot of databases but sometimes I get errors. So, I drop the database and try to recreate them but, when I try to recreate them, SQL Server says : "impossible, database already exist, change the name".

So after 5 tries with a 100ms pause in between each, I use DBCC FREEPROCCACHE and it's ok.

But, using FREEPROCCACCHE beeing very violent I trying to find how to manage that in a better way.

Is it possible to do something else ?

Thanks


SQL Server Communication Issues

$
0
0

I have a VMWare machine running MS SQL Server 2008 STD and for some reason it keep dropping communications to my shop floor application every night at 12:07 AM. This outage lasts 4 to 5 seconds and everything returns to normal. Other than that, it runs fine.

I know these details are sparse. I'm just looking for some feedback on how to pose a more intelligent question.

Thanks.



Cannot Shrink the tempdb Mdf

$
0
0

Hi 

I have a serious problem here. I have a production SQL 2005. Tempdb has grown  80 GB when I was doing the important operation in one of the tables in a database in this machine. Now everything finished. I saw tempdb has grown to 80GB I don't much space on this Server. I am left with 100 GB free space on the server. I tried shrinking the mdf file of tempdb. It executes successfully but no space is released to OS. Is restarting the SQL Server the only way to release the space. Can you please help me to release the space ? Is there any way i can do it without restarting the SQL service. 

Please need some help here.

 

Thanks 

How to get rid of _WA_sys statistics ?

$
0
0

Hi,

 

I am on SQL 2008.

 

On one of our main databases, Auto Create statistics is set to True. On certain tables, we have _WA_sys statistics generated on many columns. Many of those columns are part of an index (but not the leading column). Recently we have migrated to SQL 2008 from a different database.

In many of our performance issues, my theory is, due to these _WA_sys stats, we are not getting the plan, we expect from the query.

What I want to try is, get rid of some of the _WA_sys stats and try running the queries. I tried doing,

 

drop statistics [my_table_name].[_WA_Sys_00000003_060DEAE8]

 

The command ran successfully, but when I refresh SSMS, I can still see the _WA_sys stats there. Why is that?

Do I need to set Auto create statistics to False first, before deleting these stats?

How can get rid of these stats? How can I stop generation of _WA_sys stats for certain tables? Or do I have to do that at database level?

 

One might say, MSSQL is creating that for a reason. I agree. But in our particular application, there are very few very huge tables and we exactly know how to use them, really :)

 

Thanks in advance.

Viewing all 6624 articles
Browse latest View live


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