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

Web Site Admin Tool problem in VS2005

$
0
0
All,

When I create a new project and try to use the WSAT security tab, I get the following :

There is a problem with your selected data store. This can be caused by an invalid server name or credentials, or by insufficient permission. It can also be caused by the role manager feature not being enabled. Click the button below to be redirected to a page where you can choose a new data store.

The following message may help in diagnosing the problem: Unable to connect to SQL Server database.

I am using VS2005 beta2 with a local copy of SQL Server Express.

I am new to all of this so a little help would be great

Thx
jonpfl

SQL Network Interfaces, error: 26 ,How to overcome this error?

$
0
0

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

please help me

How t minimize the loging in sql server

$
0
0

Hi friends,

  I am looking to minimize the loging in sql server 2012. My process is I have many base tables, once data will get procced we are moving these all data into their respective history table but here the problem is Deleting huge data from multiple time from multiple table  base table making Log full. Can we minimize the loging.

Thanks,


Regards Vikas Pathak


how to up the performance

$
0
0

Hello , everybody,

Well I dont understand why to execute a stored procedure is very slow the execution... I have a question  for anyone, why is veru slowwww? thanks for your feedback.

how to make .bak up file of a database in SQL server 2008 R2 ?

$
0
0

Greetings,

I want to know what is the procedure to take .bak file of a database of sql server 2008 R2 and also how to restore that file , without running any sql query.

Investigate slow running query

$
0
0

Hi All,

I have a stored proc which inside simply joins a view and 3 tables. The SP takes less than 1 sec in my DEV environment but it takes almost 10 secs most of the time in my SIT environment.

1) The tables involved has same number of records in both envs and also the tables have same indexes in both environments

2) Max server memory is not set in both environments(is it mandatory even if we set a dedicated page file) and rebuild index and statistics update plans are running on a weekly basis.

where should i start investigating?

Thanks

Optimizer costings for hash join versus nest loop

$
0
0

I have been looking at a query that involves a join between two reasonably large tables. The optimizer picks a hash join rather than a nested loop, but when I force a nested loop it uses significantly less CPU (although a lot more I/O). The elapsed time is far better for the nested loop join - so I am trying to understand how the optimizer calculates the difference between these plans and ends up selecting the poorer plan.

The example I created involved the following scenario:

* A larger table with about 8 million rows in it, and a non-clustered index on three columns that are going to be used in the join, as well as the column used in the aggregate (see below)

* A smaller table with 80,000 rows in it (1% of the larger table), with a unique clustered index on the three columns used in the join

The query is as follows:

SELECT max(l.colZ), l.colA, l.colB, l.colC
FROM SMALLER s
INNER JOIN
LARGER l
ON s.colA = l.colA
AND s.colB = l.colB
AND s.colC = l.colC
GROUP BY
l.colA, l.colB, l.colC

The query plan that is picked uses a hash join. This has relatively low logical I/O on the larger table - 28,192 but the CPU time is over 7 seconds. On my 8 core laptop this results in an elapsed time of around 1800ms. If I force a loop join, the CPU time is just over 600ms with an elapsed time of just under 800ms. The logical I/O is far higher with the nested loop - 254k but even if I drop the buffers and force physical I/O, the loop always results in a lower elapsed time than the hash join.

The real-word production example from which I extracted this sample was even more marked - in that scenario the large table had over 92 million rows and the difference between a loop and a hash join was 25 seconds.

I am trying to understand what might be going on here? The subtree cost in the plan of the hash join is far lower than the subtree cost of the nested loop, yet the actual CPU time suggests the optimizer is completely wrong here.

I am running SQL 2012 SP1 11.0.3349.0. I have also tried this on SQL 2008 with the same result.

Any insights most welcome.

Thanks,

Robert


Unable to connect from SQL server 2008(Sp2) version client to SQL Server2012(SP1)

$
0
0

Our requirement is to connect to dtatabse server from .net application sitting on application server to invoke and run the sql agent job in database server.

But there is different version of SQL server installed on both the application and databse server.

Database server(sql server 2012) is higher version of sql server than the application server(sql server 2008)

We have two servers:

1) Application server- with SQL server 2008(SP2) where our client window application will be running.

2) Database server- with SQL server 2012(SP1) where our sql agent job will be running .

The application server cannot be upgraded to new version of sql server as presently the client application will not support the latter version of sql server. It is compatible only with SQL server 2008(SP2) version.

when we tried to connect to database server from application server using managemet studio it gives the message "Index was out of bounds of array(microsoft.sqlserver.smo)", but still it allows me to connect to database server instance and run our job using the sp_start_job <'job_name'>

From our client windows application which sits on application server(with sql server 2008) we try to connect to database server using connection string in .net code and tries to execute the job sitting on the databse server(sql server 2012) by calling the same sp in .net code, but the log file gives connection error, and hence application is not allowed to establish connection to databse server with Microsoft sql Client 10.0.

Please assist on the above issue.


sql server 2012 transaction log file

$
0
0

Is it ok if we shift transaction log file to some other place?? (SQL server 2012)

if i have say abc_log file in D:\mssql11.mssqlserver\mssql\data, 

if i want to shift that to say c: is it possible? 

if yes what are proper steps to do that or simply cut and paste


h2007

shrink transaction log in sql server

$
0
0

DBCC SHRINKDATABASE (db_name, size)

1 Is this mean i am shrinking whole database or only transaction log file ??

2 If i am shrinking whole db then is it good to shrink only log file ?? By using ssms

(right click db -> tasks -> shrink -> files -> log) and not by this command.

3 If i want to use above command how to determine the size to specify ?

4 Is there any other way to reduce log file size other than shrink ? i took backup of

log file but it never reduced the size.


h2007

Multiple TempDB files disappear on restart

$
0
0

1. Added 2 extra tempDB files across 2 logical drives.

2. Restarted SQL Service or the server

3. The 2 extra files disappear from tempDB.  However, they still on the hard drive.

??? Why did they disappear and is there a way to tell SQL to keep them around?

I noticed also that sys.sysaltfiles still has the file names so they can't be added back in under the same names.

I have MSSQL 2012 and windows 2012

from dt column how to get the data into 2 separate columns as intime and outtime where inout column defines the dt either intime or outtime in sql server 2005

$
0
0

emp_ID card_ID dt inout desc

275144271992011-03-2321:25:57.0000 Successful 275144271992011-03-2321:26:04.0001 Successful275144271992011-03-2321:35:00.0001 Successful 270144277962011-03-2321:53:55.0001 Successful 270144277962011-03-2321:54:02.0000 Successful

I want the output like this:

empID   Card ID            dt              intime                  outtime275144271992011-03-232011-03-2321:25:57275144271992011-03-232011-03-2321:26:04275144271992011-03-232011-03-2321:35:00270144277962011-03-232011-03-2321:53:552011-03-2321:54:02

bcp fails for trusted connection

$
0
0

Hi!

This is a baffling one - we have a batch process extracting data on a remote machine from the SQL server using bcp -T and has been running without any issues until last weekend. Since last weekend, we started receiving error: [Microsoft][SQL Server Native Client 10.0]Unable to complete login process due to delay in opening server connection.

We tried running bcp with -U/P bypassing trusted connection on the remote machine and it works, therefore SQL connectivity appears fine. What could possibly go wrong with the trusted connectivity over the weekend?

Any thoughts would be much appreciated.

Thanks in advance.

Regards,

Nirupam

SS2014 CTP1: table variable target causing columnstore access from batch to row mode

$
0
0

While testing the clustered columnstore indexes in SS2014 CTP1, I found the following strange behavior: a SELECT statement accessing several clustered columnstore indexes that uses batch mode if used by itself switches completely to row mode as soon as I insert it into a table variable:

SELECT <complex logic accessing CS indexes>

uses batch mode, while the same select statement, if used in the following context uses row mode:

BEGIN

  DECLARE @a as table(...);

  INSERT into @a  SELECT <complex logic accessing CS indexes>;

END

Inserting into a temp table instead of a table variable keeps using batch mode.

Can I assume this will be fixed in the final version?

Table variable and collation

$
0
0

Hi,

A table variable e.g. declare @table_1 ( userid int, username varchar(128)) ;

If a database x collation is SQL_Latin1_General_CP1_CI_AS

But tempdb system database collation is Danish_Norwegian_CI_AS

What is the collation that @table_1 using in the stored procedure under database x ?

Thanks ! 


Detect Windows server memory from SQL Server SSMS

$
0
0

Hello

Is there a way to detect what is the memory on a particular server by querying from SSMS? I am not looking for 'max server memory' of SQL, but trying to find out if there is a way to find out what the total Windows server memory is from SSMS without having to log into the server and look at 'Properties' of 'My Computer'

Thanks!


SQL Server Reported to be "Shut Down" Automatically

$
0
0

Hi,
3 days back, a support engineer notified us that all the services of 2 Database Servers at our data center had Mysteriously Shutdown. and they had to restart them manually. well, we had a look in the Error Logs, SQL Server Logs and even Event Logs. but couldn't find anything strongly suspicious. the 2 servers had shutdown almost at the same time ( apprix. 2 mins difference between the shutdown times). yesterday, there was another server with the same symptoms.

here are the facts i found. Date : 4/12/2011
Event Log - Application Log
8:50:00 AM - The MS DTC service is stopping.
8:50:00 AM - The connection has been lost with Microsoft Distributed Transaction Coordinator (MS DTC).
8:50:02 AM - Configuration option 'show advanced options' changed from 0 to 1. Run the RECONFIGURE statement to install.
8:50:02 AM - Configuration option 'Agent XPs' changed from 1 to 0. Run the RECONFIGURE statement to install.
8:50:03 AM - SQLServerAgent service successfully stopped.
8:50:04 AM - Service Broker manager has shut down.
8:50:04 AM - SQL Server is terminating in response to a 'stop' request from Service Control Manager. This is an informational message only. No user action is required.
8:50:04 AM - SQL Trace was stopped due to server shutdown. Trace ID = '1'. This is an informational message only; no user action is required.
8:50:04 AM - (SOURCE - ESENT) svchost (796) The database engine 5.02.3790.3959 started.

Event Viewer - System
8:50:00 AM - (source - Service Control Manager) The Distributed Transaction Coordinator service was successfully sent a stop control.
8:50:00 AM - (source - Service Control Manager) The SQL Server Agent (MSSQLSERVER) service was successfully sent a stop control.
8:50:03 AM - (source - Service Control Manager) The SQL Server (MSSQLSERVER) service was successfully sent a stop control.
8:51:17 AM - (source - Service Control Manager) The Distributed Transaction Coordinator service was successfully sent a start control.

ERROR LOG - SQL SERVER AGENT
4/12/2011 8:50:00 AM - SQLSERVERAGENT service stopping due to a stop request from a user, process, or the OS..

SQL Server Log
04/12/2011 08:50:04,spid5s,Unknown,SQL Trace was stopped due to server shutdown. Trace ID = '1'. This is an informational message only; no user action is required.
04/12/2011 08:50:04,spid5s,Unknown,SQL Server is terminating in response to a 'stop' request from Service Control Manager. This is an informational message only. No user action is required.
04/12/2011 08:50:03,spid12s,Unknown,Service Broker manager has shut down.
04/12/2011 08:50:02,spid89,Unknown,Configuration option 'show advanced options' changed from 1 to 0. Run the RECONFIGURE statement to install.
04/12/2011 08:50:02,spid89,Unknown,Configuration option 'Agent XPs' changed from 1 to 0. Run the RECONFIGURE statement to install.
04/12/2011 08:50:02,spid89,Unknown,Configuration option 'show advanced options' changed from 0 to 1. Run the RECONFIGURE statement to install.
04/12/2011 08:50:00,Server,Unknown,The connection has been lost with Microsoft Distributed Transaction Coordinator (MS DTC). Recovery of any in-doubt distributed transactions involving Microsoft Distributed Transaction Coordinator (MS DTC) will begin once the connection is re-established. This is an informational message only. No user action is required.

All the Servers are Running Windows Server 2003 SP2 and Microsoft SQL Server 2005 SP4.

i am bit in a confused mode on whats going on.

can u folks reply ur ideas on this please ?

 

thanks in advance

noviceDBA


Could not load file or assembly

$
0
0

When opening  SQL Server Management Studio on the SQL 2008 R2 server or any remote machine I get the following error:

Microsoft.sqlserver.mangement.reports, version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. Invalid pointer (Exception from hrsesult: 0x80004003 (E_POINTER)

I'm sure more info is needed so just let me know what you need.

Thanks in advance for any help.

Marc

Change SQL minimum Query memory setting

$
0
0

We are on SQL Server 2008 R2 enterprise edition and there is 128GB physical RAM installed on production server .The max SQL memory is setup to 112GB and the current setting of SQL minimum Query memory is 4096 KB .Recently, our production SQL server was evaluated by Microsoft MPV SQL DBA and he recommends to change the setting of minimum Query memory from 4096 to default 1024kb.

Now, I would like to measure SQL performance before I will change the minimum Query memory to 1024 KB and I also would like to measure the SQL performance after the change, but I am not sure what performance counters should I measure before and after the change? What is the best technique should I use to compare the results to prove that the change is beneficial and how much SQL performance is improved the change ?

Would someone please guide me from where do I start ?

Thanks ,

Daizy

Impact of trace flag 272 on SQL Server 2012 apart from disabling identity jump

$
0
0

I am upgrading my application's SQL Server from 2008 R2 to 2012.

As discussed in the below URL I am able to see the Identity jump after I upgrade and the server is restarted.

Now since I cannot afford this and at this moment I do not have the time to create a sequence with NOCACHE and test it again I have to go ahead and add trace flag 272 in the start up parameter as this is the only solution which I can implement and even rollback without much hassles.

http://connect.microsoft.com/SQLServer/feedback/details/739013/alwayson-failover-results-in-reseed-of-identity

I have searched a lot but nowhere I found any kind of documentation around this flag. What I got to know by reading several web literatures is, this flag will disable the new feature of IDENTITY property that has been implemented as part of SQL Server 2012 and will make it work like it was doing in SQL Server 2008 R2.

But I want to know implementing this flag would impact any other feature or performance (except the performance of IDENTITY, that I can bear with) of SQL Server.

Thanks
Soumyadeb

Viewing all 15264 articles
Browse latest View live