Quantcast
Channel: SQL Server Database Engine Forum
Viewing all 15872 articles
Browse latest View live

To get the last stop & start time of All SQL Server services(SSRS, SSIS, SSAS, etc.).

$
0
0
To get the last stop & start time of All SQL Server services(SSRS, SSIS, SSAS, etc.). 

PGupta


SQL Error

$
0
0
I have installed a .msi application from internet.I have installed sql server 2005 for that app.Now the problem is when ever i try to open that app i am getting the following error message "Run-Time Error'-2147467259(80004005)': [Microsoft][ODBC Driver Manager]Data source name not found and no default driver specified".How to solve this thing?

Performance Issue - sp_cursorfetch is the culprit

$
0
0

A query that accesses a linked server is causing me issues. 

When I traced the query from the remote server (Server B), I can see that the connection is using a cursor to return results to the remote server (Server A) where the query is run from.  The sp_cursorfetch statement is processing in batches of 100 records, and apparently is generating a round-trip (to Server A) for each completion.  However, when I issue the same query from Server A to Server B using OPENQUERY - no cursor is used, and the results are returned immediately.

I've researched everything I can imagine, but with no results ...

API Server Cursors link: http://msdn2.microsoft.com/en-us/library/aa172588(SQL.80).aspx

It appears that this option is enabled/disabled at the provider level, but where?  I'm using SQLOLEDB, with the following options configured at the server level (Allow Inprocess; Nested Queries).

Any help with this would be great.  I want to ensure that the query does not utilize cursors to fetch the recordset - without requiring changes to database code.  Therefore, this option should be configured at the server level.

Sincerely,

Sean Fitzgerald

SQL 2000 - Blocking Happening again and again

$
0
0

Hi  guys..

on sql 2000 ..from today morning blocking keep happening again and again even though killed SPID .. Reastarted SQL and app server. any one has idea what will be good action item?

also like to know scripts for sql 2000 gives detailed information about which query is blocking .

In sp_who2 shows IIS program name as blocking 

thanks


Please Mark As Answer if it is helpful. \\Aim To Inspire Rather to Teach A.Shah


An error occurred while executing batch. Error message is: The directory name is invalid.

$
0
0

SQL Server Management Studio 2008

Microsoft SQL Server 2008 (SP3) - 10.0.5512.0 (Intel X86)

Aug 22 2012 15:16:00

Copyright (c) 1988-2008 Microsoft Corporation

Enterprise Edition on Windows NT 6.0 <X86> (Build 6002: Service Pack 2) (VM)

When signed into the server using an account other than the local administrator on the machine I try doing a query with the results going to the grid.  I receive the error

An error occurred while executing batch. Error message is: The directory name is invalid.

I have tried uninstalling and reinstalling the client tools with no luck in fixing the issue.  I have also tried changing the directory to the directory of the local machine that I know exists and the user has access to.  This has not solved the issue either.

The server is a Windows Server 2008 Enterprise Edition with a 32-bit operating system.

Any help would be greatly appreciated.

Let me know if you have any questions.

Thanks

SQL 2012 - Error [36, 17, 145]

$
0
0

Hi,

We came across the below error on our SQL 2012 enterprise (64) SP1 database server. This server host around 90 Sharepoint SP2010 databases. Server has around 128GB RAM and 32 logical CPUs. Tempdb is split into 8 data files of equal size. I have run virtualfilestats and identified tempdb files to have the highest latency.

I understand that this was a bug (http://support.microsoft.com/kb/916086/en-us) in SQL 2005 and was wondering if it is a bug in sql 2012 as well. Can someone please advise?

Error [36, 17, 145] occurred while attempting to drop allocation unit ID 432217681690624 belonging to worktable with partition ID 432217681690624

 Appreciate your help.

SQL Server 2012 Developer Edition will not install. Setup files don't even get copied completely. Win 8.1. ACT instance is loaded & can't be deleted. From log file: Error: Action "PreMsiTimingConfigAction" failed during execution.

$
0
0

SQL Server 2012 Developer Edition will not install.  Setup files don't even get copied completely.  Win 8.1.  ACT instance is loaded & can't be deleted. From log file: Error: Action "PreMsiTimingConfigAction" failed during execution.

How to Resent identity values when one of the record is deleted ?

$
0
0

Hi,

I had set a identity to column (s.no) of Table and inserted values into a table . when some of  records are deleted 

Here serial number 1003,1004 is missing in this table . so, i want to reset identity column to an order (i.e 1001,1002,1003,1004,1005) .

please solve this problem


Sharepoint Crawler database went to emergency mode

$
0
0

Hi,

My SharePoint Crawl Database went on Suspect mode suddenly & now i need to bring on Online mode.

For solving this issue, i Google on several sites & came across following steps,

Steps:

  1. EXEC sp_resetstatus 'DBName';
  2. ALTER DATABASE DBName SET EMERGENCY
  3. DBCC checkdb('DBName')
  4. ALTER DATABASE DBName SET SINGLE_USER WITH ROLLBACK IMMEDIATE
  5. DBCC CheckDB ('DBName', REPAIR_ALLOW_DATA_LOSS)
  6. ALTER DATABASE DBName SET MULTI_USER
  7. DBCC CheckDB ('DBName')

Now the problem is Step 1 & 2 completed successfully, but when i tried step 3 it is throwing me below error,

Msg 945, Level 14, State 2, Line 1

Database 'DBName' cannot be opened due to inaccessible files or insufficient memory or disk space.  See the SQL Server errorlog for details.

I am using the service account which has full rights on the server & through which the SQL Server 2012 was configured.

Current status Database is in Emergency mode & I am stuck over there.

Please help.

Regards,

Purvish Shah


The log file for database 'tempdb' is full. Back up the transaction log for the database to free up some log space sql 2005 sp3

$
0
0

tempdb

Database_size 891.44

Unallocated space 871.27 MB

reserved   data          index_size      unused

552kb         160kb     304kb              88kb

My hard disk size 32 GB free and it is in SIMPLE mode.

when i am executing the script it showing "The log file for database 'tempdb' is full. Back up the transaction log for the database to free up some log space"

I am using  SQL 2005 sp3 and XP machine. Can any one help me how to solve this problem ?? urgent please.

Database not getting renamed everywhere

$
0
0
Hello all, Im trying to rename a database from which a program of mine accesses. Ive done this a numer of ways, in the SSMS interface, issueing the rename command , detaching and attaching with a new name AND changing the filename.
Everytime I rename, I can see the new name just find and I can assign that database as a default database of a user and log in with it.


HOWEVER when i move to my program with this connection string ( let us say my new database name is computer and the old name is computer_a).
this code below will NOT let me connect to the database even if it exists. 
<DatabasePath value="Data Source=127.0.0.1;initial catalog=computer;Integrated Security = TRUE"/>
BUT if i rename initalia catalog to  computer_a and i change the name of the database from computer to computer_a.
it connects fine. 
I believe that something somewhere that name counter_a is still buried and I just cannot find where
Would love if someone would give me a little insight on this.

Thanks

 

SQL 2012 SP1 producing deadlocks on sys.query_notification

$
0
0

I have run into a situation on my servers where our service broker setup for query notifications has begun producing deadlocks. The situation is described perfectly in this KB: http://support.microsoft.com/kb/975090, however we're on SQL Server 2012 SP1, not 2005/2008. I can see from the deadlock information that these internal queries for sys.query_notification are most definitely NOT using serializable isolation level, they're all read_committed.

Is there a reason why SQL 2012 has regressed to this type of behaviour?

After Piecemeal Primary FileGroup Restoration, Database Property Window Shows other FileGroups also

$
0
0

Hi,

I have a SQL Server 2008 database with 90 Gigs of Capacity.

The database consists of a huge table with 80 Gigs of Capacity and these entire 80 Gigs of data is Static in nature.

We need the to restore the backup of this database frequently in to the Development environment, so we moved this static data into a Secondary File Group.

Now, the database Consists of 2 Filegroups : Primary & Secondary_fg.

The entire Static table is moved to the Secondary FileGroup.

We have taken the backup of Primary FileGroup using the following Backup Command :

Backup Database MYDB FILEGROUP = 'PRIMARY' to disk = 'E:\SQLBackup\MYDB_Primary_FG_Only.bak'

WITH NOFORMAT, NOINIT, NAME = N'MYDB - Full Filegroup backup', SKIP, NOREWIND, NOUNLOAD

The backup went file with the expected capacity of 10 Gigs.

I have restored this backup in to a New Database : MYDB_PRIMARY_ONLY using the following command

RESTORE DATABASE [MYDB_PRIMARY_ONLY] FILE = 'MYDB_DATA', FILEGROUP = 'PRIMARY'

FROM DISK = 'E:\SQLBackup\MYDB_Primary_FG_Only.bak',

WITH FILE=1,

MOVE 'MYDB_DATA' TO 'E:\SQLDATA\MYDB_PRIMARY_ONLY_DATA.mdf',

MOVE 'MYDB_LOG' TO 'E:\SQLDATA\MYDB_PRIMARY_ONLY_LOG.ldf', NOUNLOAD, PARTIAL

GO

The Restoration also went fine and the size of the Newly Restored Database : "MYDB_PRIMARY_ONLY" is with 10 Gigs in Capacity.

But, the gotcha here is whilst checking the Database Properties of this Newly restored database, on the FILES & FILEGROUPS tab, the files & filegroups related to the SECONDARY FILEGROUP is also showing.

MY ACTUAL QUESTION :

On the PRIMARY FILEGROUP ONLY RESTORATION HOW THIS SECONDARY FILEGROUP IS COMING INTO PICTURE ?

MOREOVER, WHEN I TRIED TO REMOVE THE SECONDARY FILEGROUP AND IT'S RESPECTIVE DATA FILE IT THROUGH THE FOLLOWING ERROR :

COMMAND USED TO REMOVED THE FILE & FILEGROUP :

USE [MYDB_PRIMARY_ONLY]
GO
ALTER DATABASE [MYDB_PRIMARY_ONLY]  REMOVE FILE [SECONDARY_DATA_FILE.ndf]
GO
ALTER DATABASE [MYDB_PRIMARY_ONLY] REMOVE FILEGROUP [SECONDARY_FG]
GO

Error :

Msg 5056, Level 16, State 2, Line 1
Cannot add, remove, or modify a file in filegroup 'SECONDARY_FG' because the filegroup is not online.

Can anyone explain why such this error message ? Thanks in advance for any guidance in this regard.

How to join each row with other in the same table without repeating, please help

$
0
0

Hi,

I have a table say Adjustment having following data

Emp_Id                  Adjustment_id                      Date

1000101               1000300                               2014-02-12 00:00:00.000

1000101               1000301                               2014-02-12 00:00:00.000

1000101               1000302                               2014-02-12 00:00:00.000

1000101               1000303                               2014-02-12 00:00:00.000

 

 

1000102               1000302                               2014-02-12 00:00:00.000

1000102               1000303                               2014-02-12 00:00:00.000

1000102               1000304                               2014-02-12 00:00:00.000

 

And I want following records:

 

Emp_Id                  Adjustment_id     Adjustment_id1                    Date

1000101               1000300                1000301                               2014-02-12 00:00:00.000

1000101               1000300                1000302                               2014-02-12 00:00:00.000

1000101               1000300               1000303                               2014-02-12 00:00:00.000

1000101               1000301                1000302                               2014-02-12 00:00:00.000

1000101               1000301                1000303                               2014-02-12 00:00:00.000

1000101               1000302                1000303                               2014-02-12 00:00:00.000

 

 

1000102               1000302                1000303                               2014-02-12 00:00:00.000

1000102               1000302                1000304                               2014-02-12 00:00:00.000

1000102                    1000303                    1000304                                       2014-02-12 00:00:00.000


Strange results from sys.partitions system view

$
0
0

There is a strange problem on some of new upgraded sql server 2012 servers,for example:

use testDB
go
select partition_id,object_id,index_id,partition_number,rows 
from sys.partitions 
where object_id = object_id ('testtable')
order by index_id 
select partition_id,object_id,index_id,partition_number,row_count
from sys.dm_db_partition_stats 
where object_id = object_id ('testtable')
order by index_id 
-- query results as below

partition_id         object_id   index_id    partition_number rows
-------------------- ----------- ----------- ---------------- --------------------
72057599707119616    158727718   1           1                3957149
72057599732875264    158727718   2           1                3957149
72057599738642432    158727718   2           1                3950892
72057599389859840    158727718   4           1                3957149
72057599714852864    158727718   11          1                3957149
72057599738707968    158727718   11          1                3950892
72057599736283136    158727718   11          1                3945037
72057599728025600    158727718   31          1                3957149
72057599678808064    158727718   48          1                3957149

partition_id         object_id   index_id    partition_number row_count
-------------------- ----------- ----------- ---------------- --------------------
72057599707119616    158727718   1           1                3957149
72057599732875264    158727718   2           1                3957149
72057599389859840    158727718   4           1                3957149
72057599714852864    158727718   11          1                3957149
72057599728025600    158727718   31          1                3957149
72057599678808064    158727718   48          1                3957149

Index 2 and index 11 index columns are:

indexid 22: Hotel(int), onlineDisplay(char(1)), CloseFlag(char(1))
indexid 11: onlineDisplay(char(1)), CloseFlag(char(1)), Room(int), Hotel(int), Currency(char(3)), PrepayReserveType(varchar(5))

So the question are:

1st: Why the two queries got different results?

2nd: Why the two indexes (indexid =2 and indexid=11) have multiple rows from sys.partitions

3rd: And the two indexes (indexid =2 and indexid=11) have different rows?

Many thanks.


trace flag (-T,-t)

$
0
0

hi,

sql server trace flag T(T cap) and t( t small)  is there any different in T and t.

Log backup size information based on database recovery model.

$
0
0

We have two databases those two databases each database size 700 Gb, 1<sup>st</sup> database is full recovery model and 2<sup>nd</sup> database bulk-logged recovery model.

1<sup>st</sup> database having 20% of database fragmentation and 2<sup>nd</sup> database having 80% of fragmentation,

We are rebuilding the both database, after rebuild database we take the log backup of both database.

Those two database log backup size comes to same or if any different based on database recovery model.

Database Restoring (SQL 2008 R2)

$
0
0

Hi

I am trying to restore a database in SQL 2008 R2 and I am what I am getting instead is an error message that reads, "Too many backup devices specified for backup or restore; only 64 are allowed. RESTORE HEADERONLY is terminating abnormally. (Microsoft SQL Server, Error: 3205". 

Any word on how I can get about this one

Symmetric Key

$
0
0

Hi All.

is it possible we can deny 'dbo' of a database to drop an symmetric key ?

Does applying MOSS 2007 SP2 affect the database servers?

Viewing all 15872 articles
Browse latest View live


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