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

issue regarding schema and SP

$
0
0

Hello All,

One of our client have issue related to schema and Stored procedure.

on a database, when we check the stored procedure by using (select * from sys.procedures where name='logout') it gives 2 rows with 2 different schema id , 1 and 36.

But when we run (select * from sys.schemas where schema_id = 36),  it given no result.

also when we tried to expand the stored procedure tab under programmability it gives below error.

A severe error occurred on the current command. The results, if any, should be discarded.
A severe error occurred on the current command. The results, if any, should be discarded. (Microsoft SQL Server, Error: 0)

We have SQL server 2008R2 with SP3.

We have run the integrity check but no error also restarted the server but the problem still persist.

Can someone please assist me on this.


Microsoft SQL server error:233

$
0
0

I am getting this error when connecting to sql. I cant get into my databases now- its pretty ugly.

 

"A connection was succesfulyl established with the server, but then an error occured during the login process.

(provider: Shared Memeory Provoder, error: 0 - No Process is on the other end of the pipe.)Microsoft SQL server error:233

 

Anyone who knows what is going on soem help would be much appreciated.

Mat

Sql Server 2012 error log message information

$
0
0

Hi Team,

i am installed  sql server 2012 two months back, to day i check the sql server error log it showing below error message.

Note : I my SQL server there is no SSIDB.

error log message:

2014-12-02 06:05:49.830 spid54     Using 'xpsqlbot.dll' version '2011.110.2100' to execute extended stored procedure 'xp_qv'. This is a

2014-12-02 06:05:49.830 spid54     Attempting to load library 'xpsqlbot.dll' into memory. This is an informational message only. No use

2014-12-02 06:05:48.770 spid4s     Recovery is complete. This is an informational message only. No user action is required.           

2014-12-02 06:05:48.770 spid4s     SQL Server is now ready for client connections. This is an informational message; no user action is

2014-12-02 06:05:48.760 spid4s     ------------------------------------------------------                                             

2014-12-02 06:05:48.760 spid4s     Execution of SSIS_HOTFIX_INSTALL.SQL completed                                                     

2014-12-02 06:05:48.760 spid4s     ------------------------------------------------------                                             

2014-12-02 06:05:48.760 spid4s     Database SSISDB was not patched.                                                                   

2014-12-02 06:05:48.760 spid4s     Database SSISDB does not exist in current SQL Server instance                                       

2014-12-02 06:05:48.760 spid4s     ------------------------------------------------------                                             

2014-12-02 06:05:48.760 spid4s     Starting execution of SSIS_HOTFIX_INSTALL.SQL                                                       

2014-12-02 06:05:48.760 spid4s     ------------------------------------------------------                                             

2014-12-02 06:05:48.740 spid4s     Database 'master' is upgrading script 'SSIS_hotfix_install.sql' from level 184552376 to level 184552

2014-12-02 06:05:48.660 spid4s     ------------------------------------------------------                                             

2014-12-02 06:05:48.660 spid4s     Execution of SSIS_DISCOVERY.SQL completed                                                          

2014-12-02 06:05:48.660 spid4s     ------------------------------------------------------                                             

2014-12-02 06:05:48.660 spid4s     Database SSISDB could not be upgraded successfully.                                                

2014-12-02 06:05:48.660 spid4s     User 'sa' is changing database script level entry 17 to a value of 500.                            

2014-12-02 06:05:48.660 spid4s     Database SSISDB does not exist in current SQL Server instance                                      

2014-12-02 06:05:48.630 spid4s     ------------------------------------------------------                                             

2014-12-02 06:05:48.630 spid4s     Starting execution of SSIS_DISCOVERY.SQL                                                           

2014-12-02 06:05:48.630 spid4s     ------------------------------------------------------                                             

2014-12-02 06:05:48.630 spid4s     Database 'master' is upgrading script 'ssis_discovery' from level 184552376 to level 184552715.    

2014-12-02 06:05:48.590 Logon      Login failed for user 'test'. Reason: Server is in script upgrade mode. Only administrator can

what are the reason we getting those type of messages.

 

Finding the owner of server and database objects created by the actual user when user is member of Windows group login

$
0
0

Hello,

So, we've got users who don't have SQL logins or database users that map to their actual Windows account.  Instead, we've got a number of Windows groups with SQL logins created that are mapped and provided access accordingly.  There recently came to be an issue where a member of one of these groups who recently left the company owned a SQL job.  Because the job was configured by default to run under his account which had since been disabled the job failed, which created it's own controversy.

I was able to identify the individual Windows accounts who were members of these groups and created jobs by using thesysjobs_view system view in msdb.  However, I'm not sure how else I'd identify objects owned by actual users and not the Windows groups of which they're a member.  So, my question is:

How do you the actual Windows account used to create a server/database objects when that user is a member of a Windows group login?

cant connect to an old MSDE db through code

$
0
0

hi all,

in our product there is an old software which has this installer, it installs MSDE 2000 with no password for SA user. Then after the installation there is another exe someone coded, which connects to this db server instance and sets the password for sa along with some other configuration.

Here are few images that maybe relevant:

http://picpaste.com/Capture1-8bTcl5lq.PNG

connection properties:

http://picpaste.com/Capture2-IRYjjcQY.PNG

few other properties:

http://picpaste.com/Capture3-bif0D4cx.PNG

This all is done in Windows 7 (32 or 64 bit can be anything). This software is being used after sometime and team members have forgot how this all works. But what is confusing is, that this sa password-less instance just wont let me connect to it from the c# code (vs2010).

string serverName = System.Environment.MachineName + "\\DB_SERVERINSTANCE_HERE";
conn = new SqlConnection("Data Source=" + serverName + ";User ID=sa;");
conn.Open(); // this fails 

Even the "connect to database" of visual studio dialog box cant connect to this db instance. The only thing that does connect is the sql managemet studio (management gui that was already there on my machine cuz i also have 2008 r2 on my machine).

remote connection is allowed : http://picpaste.com/Capture4-v2n3jlDL.PNG

Now this is all happening on my dev machine, vs2010, windows 7 64 bit pc. Can someone plz guide me on why my c# code is not connecting to this db instance when management studio connects just fine?

thanks!


Ab

Cannot release the unallocated space in database file

$
0
0
Database Details

DatabaseDatabase SizeUnallocated Space
My_Database292250.00 MB35906.95

ReservedDataIndex_SizeUnused
262392888 KB232028144 KB30308840 KB55904 KB

NameFileIDFileNameFileGroupSizeMaxSizeGrowthUsage
My_Database1My_Database_FileSystem_PathPrimary299161600 KBUnlimited51200 KBData Only
My_Database_Log2My_Database_Log_FileSystem_PathNULL102400 KB2147483648 KB10%Log Only

I cannot release the unallocated space in my database, i have tried executing the following t-sql commands but still the unallocated space is still the same

DBCC SHRINKFILE ('My_Database', TRUNCATEONLY)

DBCC SHRINKDATABASE ('My_Database', TRUNCATEONLY)

is it still possible to shrink my Database File even though the filesize is now 232 GB?

Error 18456 Severity 14 State 38

$
0
0

Hi,

I am using SQL Server 2012. I find below messages popping up in my error log after every minute.

Login Failed for user "domain\abc": Reason failed to open the explicitly specified database AAZ [Client XXXXXX].

Error 18456 Severity 14 State 38.

But this database AAZ does not exist. Even I start SQL Profiler, but could not get any sufficient information on it.

Pleas suggest.

Regards




I need to over write the job outcome

$
0
0

Hi,

I am calling a job 'x' from job step of another job 'Y'. As the the purpose of the job step is to call another job, I included the below

code in the job step to wait until the job completes.

EXEC msdb.dbo.sp_start_job @job_name ='X' 

WHILE( 
SELECT count(1) 
FROM msdb.dbo.sysjobactivity aj 
JOIN msdb.dbo.sysjobs sj on sj.job_id = aj.job_id 
WHERE aj.stop_execution_date IS NULL -- job hasn''t stopped running 
AND aj.start_execution_date IS NOT NULL -- job is currently running 
AND name='X'
AND NOT EXISTS( -- make sure this is the most recent run 
SELECT 1 
from msdb.dbo.sysjobactivity new 
WHERE new.job_id = aj.job_id 
AND new.start_execution_date > aj.start_execution_date))>0 
WAITFOR DELAY '00:00:30'

The step waits until the job complete but, i want my job 'Y' to report failure when job X failed. I mean, Please share the script that resolves my problem.

An one more question is, can we over write the outcome of the job?

Thanks

Lakshman


Msg 3013, Level 16, State 1, Line 3 BACKUP DATABASE is terminating abnormally

$
0
0

Hi All,

This is on sql server 12.0.2254. I started getting error messages when our maintenance plan for backups ran. Digging through the backup plan log file yielded the following info:

Failed:(-1073548784) Executing the query "BACKUP DATABASE [master] TO  DISK = N'E:\\sql_backu..." failed with the following error: "BACKUP DATABASE is terminating abnormally.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

I then tried to create a backup using t-sql:

USE [ReportServer];
GO
BACKUP DATABASE [ReportServer]
TO DISK = 'c:\reportserver.Bak'

This resulted in the following error message:

Msg 3013, Level 16, State 1, Line 3
BACKUP DATABASE is terminating abnormally.

I did notice that when the maintenance plan was run a sqldump.mdmp, sqldump.log and sqldump.txt files were created. This is a portion from the sqldump.txt file:

***Stack Dump being sent to D:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\LOG\SQLDump0016.tx
t                                                                                                               
SqlDumpExceptionHandler: Process 2828 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server i
s terminating this process.                                                                                     
* *******************************************************************************                                
*                                                                                                               
* BEGIN STACK DUMP:                                                                                             
*   12/02/14 14:03:36 spid 2828                                                                                 
* Private server build.                                                                                         
*                                                                                                               
*                                                                                                               
*   Exception Address = 000007FEF23FB6B7 Module(sqlmin+0000000002C8B6B7)                                         
*   Exception Code    = c0000005 EXCEPTION_ACCESS_VIOLATION                                                     
*   Access Violation occurred reading address 00000000403AEB09                                                   
* Input Buffer 510 bytes -                                                                                      
*             BACKUP DATABASE [ReportServer_MKTG_INTELTempDB] TO  DISK = N'                                      
*  E:\sql_backups\ReportServer_MKTG_INTELTempDB\ReportServer_MKTG_INTELTemp                                      
*  DB_backup_2014_12_02_140323_2336797.bak' WITH NOFORMAT, NOINIT,  NAME =                                       
*  N'ReportServer_MKTG_INTELTempDB_backup_2014_12_02_140323_2336797', SKIP,                                      
*   REWIND, NOUNLOAD, COMPRESSION,  STATS = 10 

Any help/guidance would be greatly appreciated.



Delete All Data Collector objects in Database

$
0
0

Hi

     i need to desactivate and delete all objects (Jobs, procedures,...) on a database that were created when is activated the data collector.

   can someone describe all the things that i have to do in order to put the database in it´s original state before the data collector was activated.

regards, Javier

COLUMNPROPERTY on a vew does not show ID column as identity

$
0
0

Hi everyone,

I am trying to figure out why COLUMNPROPERTY'IsIdentity' for a view is not equal to 1 when for the underlying tables it is returned correctly =1.

SELECT COLUMNPROPERTY( OBJECT_ID('TestDB.TestView'),'ID', 'IsIdentity') AS 'Is Identity'; --this returns 0
SELECT COLUMNPROPERTY( OBJECT_ID('TestDB.TestTable'),'ID', 'IsIdentity') AS 'Is Identity'; --this returns 1

I need a workaround on this - to get SQL server to interpret this column as Identity.This is because MS Access needs an Identity column to be able to work with SQL views.

Thank you in advance

The gap between "Max Server (MB)" and sys.dm_os_memory_clerks?and sum memory usage from sys.dm_os_memory_clerks?

$
0
0

Hello,

I have a SQL 2012 instance, i want to know is there a dmv (or from dbcc memorystatus ) i can check how sql server use memroy accurately? 

There is still a gap between "max server memory (mb)" and sum memory usage from sys.dm_os_memory_clerks,for example:

exec sp_configure 'max server memory (MB)'
-- 239000
select sum (pages_kb)/1024 as mb from sys.dm_os_memory_clerks
-- 204608

SQL Server Version:

Microsoft SQL Server 2012 - 11.0.5532.0 (X64) 
Jul 14 2014 15:00:27 
Copyright (c) Microsoft Corporation
Enterprise Edition: Core-based Licensing (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1)

The Windows box physical memory is 256gb.

Many thanks.


Log Shipping Vs Mirroring

$
0
0

Define Log shipping and mirroring ?

What are the main differences between Log shipping and Database Mirroring?


bhagee

Calling All Wise Men! SS DBE Gurus Needed! Apply Within! No One Turned Away!

$
0
0

Calling all wise men!

Join us and rejoice!

The time for giving is upon us again!

A time for family (community) and gifts of knowledge!

Why not wrap up a little something extra special this year.

After all, tis the season to be generous!

Remember the reason for the season!

All you have to do is add an article to TechNet Wiki from your own specialist field. Something that fits into one of the categories listed on the submissions page. Copy in your own blog posts, a forum solution, a white paper, or just something you had to solve for your own day's work today.

Drop us some nifty knowledge, or superb snippets, and become MICROSOFT TECHNOLOGY GURU OF THE MONTH!

This is an official Microsoft TechNet recognition, where people such as yourselves can truly get noticed!

HOW TO WIN

1) Please copy over your Microsoft technical solutions and revelations toTechNet Wiki.

2) Add a link to it on THIS WIKI COMPETITION PAGE (so we know you've contributed)

3) Every month, we will highlight your contributions, and select a "Guru of the Month" in each technology.

If you win, we will sing your praises in blogs and forums, similar to the weekly contributor awards. Once "on our radar" and making your mark, you will probably be interviewed for your greatness, and maybe eventually even invited into other inner TechNet/MSDN circles!

Winning this award in your favoured technology will help us learn the active members in each community.

Feel free to ask any questions below.

More about TechNet Guru Awards

Thanks in advance!
Pete Laker


#PEJL
Got any nice code? If you invest time in coding an elegant, novel or impressive answer on MSDN forums, why not copy it over toTechNet Wiki, for future generations to benefit from! You'll never get archived again, and you could win weekly awards!

Have you got what it takes o become this month's TechNet Technical Guru? Join a long list of well known community big hitters, show your knowledge and prowess in your favoured technologies!

"SysAdmin" server role

$
0
0

Hello,

I am reading that the "Sysadmin" server role can perform any activity on the server.

I am almost new to SQL-Server and was wondering if this means that the Sysadmin can access any database or I should place the user in a database-level role such as "db_owner" ?

Thanks in advance!


Luis Olías Técnico/Admon Sistemas . Sevilla (España - Spain)


How to Identify the SPID of a Job currently running in the server.

$
0
0

Hello Experts,

One of the job is running in my server longer period of time. The server is very bg with at least 500 connections. The production was stopped and I was even trying to kill to that job process but I couldn't identify the spid of that job currently running in the server. The owner of job is Sa. Could anybody please help me to identify SPID of that Job.

Thanks in advance

"Orphaned" Foreign Keys

$
0
0
I am currently working with two SQLServer databases whose origins are WAY before my time.  Actually, at one time I believe the two databases were one, but were then divided.  I don't know which version(s) of SQLServer was used to create them.  Over time there have been many modifications to the data model.  While trying to identify the foreign key relationships in each database, I compiled a list that apparently shows many "orphaned" foreign keys.  Selecting the rows from sys.objects where the type='F', I receive a list of over 200 rows where many of the rows contain a parent_object_id, but the OBJECT_NAME(parent_object_id) is NULL.  This occurs in both databases.  Shouldn't this be impossible?  How do I go about cleaning it up?  We are currently using both SQLServer 2005 and 2008 environments.

Migrating from diffrent instances of sql to a new server

$
0
0

Hello,

I have 3 instances of Sql (2008 R2) on 3 different servers. The versions are (10.50.2550.0                SP1 Standard Edition (64-bit), 10.50.2550.0 SP1 Standard Edition (64-bit)). The goal is to migrate all the databases and logins to new server, we just purchase with Sql server 2012. I don’t know how to approach, I tried to use the copy database wizard and it keep failing. If I decide to backup each database and restore them to new the servers, I don’t know how to migrate the logins. What is the best approach to deal with the situation?

Thx

syntax error for option(maxrecursion 0)

$
0
0

hi all,

i have a function and if i execute it within sp i'm getting recursion error 

The statement terminated. The maximum recursion 100 has been exhausted before statement completion.

when i included option(maxrecursion 0) i'm getting syntax error 

as Incorrect syntax near the keyword 'OPTION

..can anybody tell me where to place this option() 

thanks in advance

my function looks like


lucky

INSERT ... EXECUTE - How to add additional data

$
0
0

Hi community,

I have a SQL that consolidates blocks of records with into a larger records. These rows are inserted into a new database. The consolidation is rather complex. So I wrote a CLR Stored Procedure to consolidate these blocks. The new rows contain more columns. Many of them contain the consolidated data from these blocks. The CLR SP return a row into an INSERT ... EXECUTE. pls. refer to the code shown.

To avoid channeling additional column data thru the Stored Procedure I would like to INSERT some data after the SP has returned. Is there any coding to add value for additional columns with the INSERT ... EXEC? Or would you solve a task totally different?

Many thanks in advance!

WHILE @@fetch_status = 0
BEGIN
	SET @AnlagenschlüsselLast = @Anlagenschlüssel
	SET @Count = 0
	BEGIN TRY
			INSERT INTO dbo.pamSQLFinalWind (
			Anlagenschlüssel, [Originating ÜNB], [Abrechnungsjahr], [Energie kWh], [EEG Subvention EUR])
			EXECUTE dbo.pamEEGDecomposition @Anlagenschlüssel, @ÜNB, @Abrechnungsjahr,  @COUNT OUTPUT;
	END TRY
	BEGIN CATCH
		INSERT INTO dbo.pamSQLFinalWindErrors (
			Anlagenschlüssel, [Originating ÜNB], Nummer, Severity, [Stored Procedure], Zeile, Fehlerbeschreibung)
			VALUES (@AnlagenschlüsselLast, @ÜNB, ERROR_NUMBER(), ERROR_SEVERITY(), ERROR_PROCEDURE(), ERROR_LINE(), ERROR_MESSAGE());
	END CATCH
	FETCH RELATIVE @Count FROM Cursor_Anlagenschlüssel INTO @Anlagenschlüssel, @Menge, @Subvention, @ÜNB
	SET @TotalCount += @Count
	SET @BatchCount += 1;
END


Regards Uwe

Viewing all 12963 articles
Browse latest View live


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