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

TEMPDB.mdf out of control 30 GB

$
0
0

Hello,

I tried the three methods from http://support.microsoft.com/default.aspx?scid=kb;en-us;307487 to decrease the size of the TEMPDB files but they remain at the same size even saying 98% free space nothing is released...

What could I do? Rebuild the TEMPDB ? Hopw?

Thanks,
Dom


System Center Operations Manager 2007 / System Center Configuration Manager 2007 R2 / Forefront Client Security / Forefront Identity Manager

using PowerShell Functions in t-SQL scripts

$
0
0

experts,

Can I use a power shell function that gets file size given file path by cross applying it to a table in SQL Server that holds file path of files?

fileID    filepath
1         L:\DemoWebPages\About.cshtml.txt
2         L:\DemoWebPages\default.cshtml.txt.txt
3         L:\DemoWebPages\Layout.cshtml.txt
4         L:\DemoWebPages\Site.css.txt

if the above if the table in SQL Server, can I cross apply a power shell function that gets the file size when file path is passed from the table above?

Help Much Appreciated!


ebro

Problem sending Large (> 2MB) Email attachments in Sp_send_dbmail in SQL server 2012 (SP1)

$
0
0

We have a stored procedure which calls in "Sp_send_dbmail" Stored Procedure in MSDB database to send out email attachments.

Sp_send_dbmail seems to work for attachments 2 MB or less, but for more than 2 MB it throws up a generic error message saying - 

"

The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2014-04-15T19:44:00). Exception Message: Cannot send mails to mail server. (The operation has timed out.).
)

"

The messages are being queued for delivery, but are failing later on.

We tried to stop and re-start DB services on SQL server, but that has not solved the problem. 

We have also set the "File Attachement size limit" to the maximum (100 MB).

This only seems to happen on our Dev and Production servers, when configured on my local instance of SQL server , it seems to even send attachments as big as 5-6 MB in size.

The Dev and production servers have the following version of SQL installed - 

Microsoft SQL Server 2012 (SP1) - 11.0.3000.0 (X64) 
Oct 19 2012 13:38:57 
Copyright (c) Microsoft Corporation
Enterprise Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1) (Hypervisor)

Any help highly appreciated. 

Thank You

P





Testing SQL By Edition e.g. SQL Standard Edition Mode

$
0
0

Hi all,

I'm running SQL 2012 developer edition. Is there any way I can run my version in SQL standard edition 'mode'.

I would like to be able to test my database scripts for client running those versions....

Thanks.

Clay

sql server 2012 login transfer to 2012

$
0
0

hi,

i have 2 mssql server one is std and another is ent edition.  i created 3 database and transfer them from one sql server to another . it was successfully transfered.now i tried to transfer the login from old server to new one with their respective permission on each database. how can i perform this task. please tell me the simplest way. coz i am very new to sql server. don't know scripting.

plz help.

Server Sizing for SQL Server 2005

$
0
0

Hi Experts,

We are having a SQL Server 2005 Enterprise Edition, we are planning to do a sizing of the server.

Do we have any standard tool or criteria which can be used to come up with an assessment of the hardware enhancement which can be proposed for the server which host SQL server 2005.

Also is there any standard recommendation when setting up a production environment which would host SQL Server



Joji

Is it possible to add Sa as a user for Database(user defined) Security

$
0
0

When am adding login SA   as user for database am getting this error ,

How can i fix this errror.

Emergency.

thanks in advance....


TEMPDB.mdf out of control 100 GB

$
0
0

Hello,

using my previous thread and the answers proposed:

http://social.technet.microsoft.com/Forums/en-US/99f34dc7-93fc-4f8d-b72a-48096707169f/tempdbmdf-out-of-control-30-gb?forum=sqldatabaseengine

session_id database_id	user_objects_alloc_page_count	user_objects_dealloc_page_count	internal_objects_alloc_page_count	internal_objects_dealloc_page_count
119	   2	        0	                        363	                        12150896	                        12152552
78	   2	        0	                        0	                        96	                                88
84	   2	        0	                        0	                        48	                                88
102	   2	        0	                        0	                        16	                                8
57	   2	        10	                        0	                        0	                                0
69	   2	        6	                        0	                        0	                                0
66         2	        4	                        0	                        0	                                0
65	   2	        2	                        0	                        0	                                0
67	   2	        2	                        0	                        0	                                0
73	   2	        2	                        0	                        0	                                0


I have identified the Session Id, user and database using the session 119 ...

what should I do next:

restart SQL Service for this instance?

kill the session?

Thanks,

DOm


System Center Operations Manager 2007 / System Center Configuration Manager 2007 R2 / Forefront Client Security / Forefront Identity Manager



AppDomain mssqlsystemresource.dbo[ddl] unloaded

$
0
0

clr enabled is zero

SQL error log flooded with these. I couldn't make much sense of the articles I read. Each says something different.

Help? Thanks

2014-04-13 01:47:34.310 spid25s AppDomain 2 (mssqlsystemresource.dbo[ddl].1) unloaded.
2014-04-13 01:47:35.040 spid74 AppDomain 3 (mssqlsystemresource.dbo[runtime].2) created.
2014-04-13 01:47:39.590 spid21s AppDomain 4 (mssqlsystemresource.dbo[ddl].3) unloaded.
2014-04-13 01:47:42.980 spid18s AppDomain 5 (mssqlsystemresource.dbo[ddl].4) unloaded.
2014-04-13 01:47:45.560 spid22s AppDomain 6 (mssqlsystemresource.dbo[ddl].5) unloaded.
2014-04-13 01:47:49.450 spid19s AppDomain 7 (mssqlsystemresource.dbo[ddl].6) unloaded.
2014-04-13 01:47:51.330 spid27s AppDomain 8 (mssqlsystemresource.dbo[ddl].7) unloaded.
2014-04-13 01:47:53.630 spid23s AppDomain 9 (mssqlsystemresource.dbo[ddl].8) unloaded.
2014-04-13 01:47:55.320 spid21s AppDomain 10 (mssqlsystemresource.dbo[ddl].9) unloaded.
2014-04-13 01:48:14.340 spid23s AppDomain 11 (mssqlsystemresource.dbo[ddl].10) unloaded.
2014-04-13 01:48:15.710 spid27s AppDomain 12 (mssqlsystemresource.dbo[ddl].11) unloaded.
2014-04-13 01:48:19.380 spid18s AppDomain 13 (mssqlsystemresource.dbo[ddl].12) unloaded.
2014-04-13 01:48:22.570 spid24s AppDomain 14 (mssqlsystemresource.dbo[ddl].13) unloaded.
2014-04-13 01:48:27.360 spid21s AppDomain 15 (mssqlsystemresource.dbo[ddl].14) unloaded.
2014-04-13 01:48:31.180 spid28s AppDomain 16 (mssqlsystemresource.dbo[ddl].15) unloaded.
2014-04-13 01:48:33.880 spid26s AppDomain 17 (mssqlsystemresource.dbo[ddl].16) unloaded.
2014-04-13 01:48:37.190 spid26s AppDomain 18 (mssqlsystemresource.dbo[ddl].17) unloaded.
2014-04-13 01:48:39.150 spid23s AppDomain 19 (mssqlsystemresource.dbo[ddl].18) unloaded.
2014-04-13 01:48:53.930 spid26s AppDomain 20 (mssqlsystemresource.dbo[ddl].19) unloaded.
2014-04-13 01:48:56.060 spid20s AppDomain 21 (mssqlsystemresource.dbo[ddl].20) unloaded.
2014-04-13 01:48:57.870 spid26s AppDomain 22 (mssqlsystemresource.dbo[ddl].21) unloaded.
2014-04-13 01:48:59.130 spid18s AppDomain 23 (mssqlsystemresource.dbo[ddl].22) unloaded.
2014-04-13 01:49:01.800 spid19s AppDomain 24 (mssqlsystemresource.dbo[ddl].23) unloaded.
2014-04-13 01:49:04.100 spid20s AppDomain 25 (mssqlsystemresource.dbo[ddl].24) unloaded.
2014-04-13 01:49:05.790 spid18s AppDomain 26 (mssqlsystemresource.dbo[ddl].25) unloaded.
2014-04-13 01:49:07.910 spid20s AppDomain 27 (mssqlsystemresource.dbo[ddl].26) unloaded.
2014-04-13 01:49:10.310 spid26s AppDomain 28 (mssqlsystemresource.dbo[ddl].27) unloaded.
2014-04-13 01:49:12.550 spid27s AppDomain 29 (mssqlsystemresource.dbo[ddl].28) unloaded.
2014-04-14 01:46:50.460 spid19s AppDomain 30 (mssqlsystemresource.dbo[ddl].29) unloaded.
2014-04-14 01:46:53.910 spid24s AppDomain 31 (mssqlsystemresource.dbo[ddl].30) unloaded.
2014-04-14 01:46:56.870 spid20s AppDomain 32 (mssqlsystemresource.dbo[ddl].31) unloaded.
2014-04-14 01:46:58.940 spid21s AppDomain 33 (mssqlsystemresource.dbo[ddl].32) unloaded.
2014-04-14 01:47:01.790 spid22s AppDomain 34 (mssqlsystemresource.dbo[ddl].33) unloaded.
2014-04-14 01:47:03.390 spid21s AppDomain 35 (mssqlsystemresource.dbo[ddl].34) unloaded.
2014-04-14 01:47:05.260 spid22s AppDomain 36 (mssqlsystemresource.dbo[ddl].35) unloaded.
2014-04-14 01:47:06.660 spid21s AppDomain 37 (mssqlsystemresource.dbo[ddl].36) unloaded.
2014-04-14 01:47:38.510 spid24s AppDomain 38 (mssqlsystemresource.dbo[ddl].37) unloaded.
2014-04-14 01:47:40.300 spid18s AppDomain 39 (mssqlsystemresource.dbo[ddl].38) unloaded.
2014-04-14 01:47:44.570 spid24s AppDomain 40 (mssqlsystemresource.dbo[ddl].39) unloaded.
2014-04-14 01:47:52.300 spid26s AppDomain 41 (mssqlsystemresource.dbo[ddl].40) unloaded.
2014-04-14 01:48:03.430 spid19s AppDomain 42 (mssqlsystemresource.dbo[ddl].41) unloaded.
2014-04-14 01:48:05.640 spid19s AppDomain 43 (mssqlsystemresource.dbo[ddl].42) unloaded.
2014-04-14 01:48:07.500 spid25s AppDomain 44 (mssqlsystemresource.dbo[ddl].43) unloaded.
2014-04-14 01:48:10.440 spid22s AppDomain 45 (mssqlsystemresource.dbo[ddl].44) unloaded.
2014-04-14 01:48:29.650 spid24s AppDomain 46 (mssqlsystemresource.dbo[ddl].45) unloaded.
2014-04-14 01:48:45.100 spid25s AppDomain 47 (mssqlsystemresource.dbo[ddl].46) unloaded.
2014-04-14 01:48:46.890 spid20s AppDomain 48 (mssqlsystemresource.dbo[ddl].47) unloaded.
2014-04-14 01:48:48.930 spid24s AppDomain 49 (mssqlsystemresource.dbo[ddl].48) unloaded.
2014-04-14 01:48:50.030 spid25s AppDomain 50 (mssqlsystemresource.dbo[ddl].49) unloaded.
2014-04-14 01:48:52.660 spid28s AppDomain 51 (mssqlsystemresource.dbo[ddl].50) unloaded.
2014-04-14 01:48:56.340 spid25s AppDomain 52 (mssqlsystemresource.dbo[ddl].51) unloaded.
2014-04-14 01:48:58.370 spid27s AppDomain 53 (mssqlsystemresource.dbo[ddl].52) unloaded.
2014-04-14 01:49:00.570 spid25s AppDomain 54 (mssqlsystemresource.dbo[ddl].53) unloaded.
2014-04-14 01:49:03.150 spid24s AppDomain 55 (mssqlsystemresource.dbo[ddl].54) unloaded.
2014-04-14 01:49:05.670 spid18s AppDomain 56 (mssqlsystemresource.dbo[ddl].55) unloaded.
2014-04-15 01:56:57.930 spid27s AppDomain 57 (mssqlsystemresource.dbo[ddl].56) unloaded.
2014-04-15 01:57:01.730 spid24s AppDomain 58 (mssqlsystemresource.dbo[ddl].57) unloaded.
2014-04-15 01:57:05.150 spid28s AppDomain 59 (mssqlsystemresource.dbo[ddl].58) unloaded.
2014-04-15 01:57:07.590 spid19s AppDomain 60 (mssqlsystemresource.dbo[ddl].59) unloaded.
2014-04-15 01:57:10.760 spid24s AppDomain 61 (mssqlsystemresource.dbo[ddl].60) unloaded.
2014-04-15 01:57:12.830 spid28s AppDomain 62 (mssqlsystemresource.dbo[ddl].61) unloaded.
2014-04-15 01:57:15.110 spid22s AppDomain 63 (mssqlsystemresource.dbo[ddl].62) unloaded.
2014-04-15 01:57:16.710 spid27s AppDomain 64 (mssqlsystemresource.dbo[ddl].63) unloaded.
2014-04-15 01:57:36.090 spid21s AppDomain 65 (mssqlsystemresource.dbo[ddl].64) unloaded.
2014-04-15 01:57:37.560 spid22s AppDomain 66 (mssqlsystemresource.dbo[ddl].65) unloaded.
2014-04-15 01:57:40.780 spid28s AppDomain 67 (mssqlsystemresource.dbo[ddl].66) unloaded.
2014-04-15 01:57:43.760 spid18s AppDomain 68 (mssqlsystemresource.dbo[ddl].67) unloaded.
2014-04-15 01:57:47.610 spid18s AppDomain 69 (mssqlsystemresource.dbo[ddl].68) unloaded.
2014-04-15 01:57:49.980 spid19s AppDomain 70 (mssqlsystemresource.dbo[ddl].69) unloaded.
2014-04-15 01:57:52.050 spid20s AppDomain 71 (mssqlsystemresource.dbo[ddl].70) unloaded.
2014-04-15 01:57:55.460 spid20s AppDomain 72 (mssqlsystemresource.dbo[ddl].71) unloaded.
2014-04-15 01:57:57.830 spid18s AppDomain 73 (mssqlsystemresource.dbo[ddl].72) unloaded.
2014-04-15 01:58:14.300 spid18s AppDomain 74 (mssqlsystemresource.dbo[ddl].73) unloaded.
2014-04-15 01:58:16.430 spid28s AppDomain 75 (mssqlsystemresource.dbo[ddl].74) unloaded.
2014-04-15 01:58:18.770 spid24s AppDomain 76 (mssqlsystemresource.dbo[ddl].75) unloaded.
2014-04-15 01:58:19.920 spid23s AppDomain 77 (mssqlsystemresource.dbo[ddl].76) unloaded.
2014-04-15 01:58:23.210 spid23s AppDomain 78 (mssqlsystemresource.dbo[ddl].77) unloaded.
2014-04-15 01:58:26.620 spid28s AppDomain 79 (mssqlsystemresource.dbo[ddl].78) unloaded.
2014-04-15 01:58:29.030 spid28s AppDomain 80 (mssqlsystemresource.dbo[ddl].79) unloaded.
2014-04-15 01:58:31.700 spid21s AppDomain 81 (mssqlsystemresource.dbo[ddl].80) unloaded.
2014-04-15 01:58:34.480 spid24s AppDomain 82 (mssqlsystemresource.dbo[ddl].81) unloaded.
2014-04-15 01:58:36.480 spid27s AppDomain 83 (mssqlsystemresource.dbo[ddl].82) unloaded.
2014-04-16 01:13:52.110 spid24s AppDomain 84 (mssqlsystemresource.dbo[ddl].83) unloaded.
2014-04-16 01:13:59.100 spid25s AppDomain 85 (mssqlsystemresource.dbo[ddl].84) unloaded.
2014-04-16 01:14:03.270 spid25s AppDomain 86 (mssqlsystemresource.dbo[ddl].85) unloaded.
2014-04-16 01:14:05.790 spid18s AppDomain 87 (mssqlsystemresource.dbo[ddl].86) unloaded.
2014-04-16 01:14:09.710 spid21s AppDomain 88 (mssqlsystemresource.dbo[ddl].87) unloaded.
2014-04-16 01:14:13.190 spid18s AppDomain 89 (mssqlsystemresource.dbo[ddl].88) unloaded.
2014-04-16 01:14:16.760 spid22s AppDomain 90 (mssqlsystemresource.dbo[ddl].89) unloaded.
2014-04-16 01:14:20.320 spid19s AppDomain 91 (mssqlsystemresource.dbo[ddl].90) unloaded.
2014-04-16 01:14:45.570 spid22s AppDomain 92 (mssqlsystemresource.dbo[ddl].91) unloaded.
2014-04-16 01:14:48.890 spid24s AppDomain 93 (mssqlsystemresource.dbo[ddl].92) unloaded.
2014-04-16 01:14:55.010 spid24s AppDomain 94 (mssqlsystemresource.dbo[ddl].93) unloaded.
2014-04-16 01:14:59.850 spid21s AppDomain 95 (mssqlsystemresource.dbo[ddl].94) unloaded.
2014-04-16 01:15:05.250 spid21s AppDomain 96 (mssqlsystemresource.dbo[ddl].95) unloaded.
2014-04-16 01:15:08.930 spid21s AppDomain 97 (mssqlsystemresource.dbo[ddl].96) unloaded.
2014-04-16 01:15:12.660 spid23s AppDomain 98 (mssqlsystemresource.dbo[ddl].97) unloaded.
2014-04-16 01:15:16.940 spid25s AppDomain 99 (mssqlsystemresource.dbo[ddl].98) unloaded.
2014-04-16 01:15:20.330 spid24s AppDomain 100 (mssqlsystemresource.dbo[ddl].99) unloaded.
2014-04-16 01:15:34.940 spid24s AppDomain 101 (mssqlsystemresource.dbo[ddl].100) unloaded.
2014-04-16 01:15:36.700 spid24s AppDomain 102 (mssqlsystemresource.dbo[ddl].101) unloaded.
2014-04-16 01:15:39.510 spid18s AppDomain 103 (mssqlsystemresource.dbo[ddl].102) unloaded.
2014-04-16 01:15:40.710 spid20s AppDomain 104 (mssqlsystemresource.dbo[ddl].103) unloaded.
2014-04-16 01:15:44.530 spid18s AppDomain 105 (mssqlsystemresource.dbo[ddl].104) unloaded.
2014-04-16 01:15:48.880 spid24s AppDomain 106 (mssqlsystemresource.dbo[ddl].105) unloaded.
2014-04-16 01:15:50.920 spid18s AppDomain 107 (mssqlsystemresource.dbo[ddl].106) unloaded.
2014-04-16 01:15:53.520 spid19s AppDomain 108 (mssqlsystemresource.dbo[ddl].107) unloaded.
2014-04-16 01:15:56.170 spid25s AppDomain 109 (mssqlsystemresource.dbo[ddl].108) unloaded.
2014-04-16 01:15:59.280 spid23s AppDomain 110 (mssqlsystemresource.dbo[ddl].109) unloaded.
2014-04-16 05:39:42.450 spid2s AppDomain 3 (mssqlsystemresource.dbo[runtime].2) is marked for unload due to memory pressure.
2014-04-16 05:39:42.650 spid24s AppDomain 3 (mssqlsystemresource.dbo[runtime].2) unloaded.


Paula

SQL 2008 Maintenance Plan Backup to UNC drive

$
0
0

I have a SQL 2008 maintenance plan backing up to a shared drive \\servername\folder but I am not able to backup databases to that shared drive.  My sql server and sql agent accounts are using service accounts and I don't want to use a domain account (which I understand can backup to a shared drive).  I don't want to use the net use commands (can cause account lockouts on failures) or a backup device (since you have to specify the exact file name and I want to dynamically create the name with a time stamp for multiple days of backups).  Is there anything that I can have my network admins do on the shared drive (which has full control for the sql server/agent service accounts) to allow the maintenance plan to backup the databases? Do I need a third party tool like red gate for this?  If there is a well-established custom script I can use that but I'm trying to get away from custom scripts if possible. 

Thanks in advance

sql server 2008 service pack

$
0
0

hello, I have sql server 2008 and 2012 installed on my windows 8 machine.

but sql server configuration manager is showing up only for ver 2008.

on 2008 configuration manager, SQL Server Services is showing error "The remote procedure call failed".

So I am not able to see the sql server services running on the host.

I googled the issue and saw the installing sql server 2008 service pack might resolve the issue.

there seem to be atleast 3 service packs for 2008. so which do I install?

also where do I download the service pack from?

appreciate the feedback. thanks.

powershell error

$
0
0

Hey Tech Bros,

Not sure whether this is the right forum.I get error while executing the job status report script.

#Create a new Excel object using COM 
$Excel = New-Object -ComObject Excel.Application
$Excel.visible = $True

$Excel = $Excel.Workbooks.Add()
$Sheet = $Excel.Worksheets.Item(1)

#Counter variable for rows
$intRow = 1

#Read thru the contents of the SQL_Servers.txt file
foreach ($instance in get-content "C:\SQLCheck\Serverlist.txt")
{

     #Create column headers
     $Sheet.Cells.Item($intRow,1) = "INSTANCE NAME:"
     $Sheet.Cells.Item($intRow,2) = $instance
     $Sheet.Cells.Item($intRow,1).Font.Bold = $True
     $Sheet.Cells.Item($intRow,2).Font.Bold = $True

     $intRow++

      $Sheet.Cells.Item($intRow,1) = "JOB NAME"
      $Sheet.Cells.Item($intRow,2) = "LAST RUN OUTCOME"
      $Sheet.Cells.Item($intRow,3) = "LAST RUN DATE"

     #Format the column headers
     for ($col = 1; $col –le 3; $col++)
     {
          $Sheet.Cells.Item($intRow,$col).Font.Bold = $True
          $Sheet.Cells.Item($intRow,$col).Interior.ColorIndex = 48
          $Sheet.Cells.Item($intRow,$col).Font.ColorIndex = 34
     }

     $intRow++
      #######################################################
     #This script gets SQL Server Agent job status information using PowerShell

     [System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SqlServer.SMO') | out-null

     # Create an SMO connection to the instance
     $srv = New-Object ('Microsoft.SqlServer.Management.Smo.Server') $instance

     $jobs=$srv.JobServer.Jobs -like "TCB*"

     #Formatting using Excel





ForEach ($job in $jobs)  
{ 

       # Formatting for the failed jobs 
       if ($job.LastRunOutcome -eq 0) 
       { 
           $fgColor = 3 
       } 
       else 
       { 
           $fgColor = 0 
       } 
   

       $Sheet.Cells.Item($intRow, 1) =  $job.Name 
       $Sheet.Cells.Item($intRow, 2) = $job.LastRunOutcome.ToString() 
       $Sheet.Cells.item($intRow, 2).Interior.ColorIndex = $fgColor 
       $Sheet.Cells.Item($intRow, 3) =  $job.LastRunDate

    
            
       $intRow ++ 
} 
   $intRow ++ 


}

$Sheet.UsedRange.EntireColumn.AutoFit()
cls




Best Regards, Arun http://whynotsql.blogspot.com/

Automated database restore from Production to Development

$
0
0
Hello,
Please guide me for Automate Database restore from Production to Development for daily basis. New to this task. Please guide me that would be appreciate. 

xp_create_subdir() returned error 183, 'Cannot create a file when that file already exists.'

$
0
0

I have an unusual question (error) to resolve.  I have a 2008R2 SQL Server which has localsystem as it's SQL Server Service and SQL Server Agent.  I cannot change this to a domain account due to the application integration (don't ask).  I created a credential using an AD domain account.  I added this domain account to SQL Server Logins and made it 'sa'.  I also mapped the credential to it.

I then created a proxy and linked it with the credential.  I created both T-SQL SQL agent job and a Maintenance Plan job to create backups to our NAS.  I've given the AD Domain account mapped with the cridential full write permissions to the NAS folder.  But I'm getting permission errors.  I've tested the SQL from my workstation, using 'Run As' the service account on SSMS mentioned above and it works fine, so I know the service account can write to the NAS folder.  It's permissions on the server that is using localsystem for it's two SQL service accounts.

I've changed the job step on the Maintenance job from SQL Server Agent to the Proxy.  Proxy is not available on the T-SQL SQL agent job.   

Msg 22048, Level 16, State 1, Line 0
xp_create_subdir() returned error 183, 'Cannot create a file when that file already exists.'
Msg 3201, Level 16, State 1, Line 1
Cannot open backup device '\\someServerName\SomeDirectories\someDatabaseFiles_TodaysDate.full.bak'. Operating system error 5(Access is denied.).
Msg 3013, Level 16, State 1, Line 1
BACKUP DATABASE is terminating abnormally.
Msg 22048, Level 16, State 1, Line 0
xp_create_subdir() returned error 183, 'Cannot create a file when that file already exists.'
Msg 3201, Level 16, State 1, Line 1
Cannot open backup device '\\someServerName\SomeDirectories\someDatabaseFiles_TodaysDate.full.bak'. Operating system error 5(Access is denied.).
Msg 3013, Level 16, State 1, Line 1
BACKUP DATABASE is terminating abnormally.
Msg 22048, Level 16, State 1, Line 0
xp_create_subdir() returned error 183, 'Cannot create a file when that file already exists.'
Msg 3201, Level 16, State 1, Line 1
Cannot open backup device '\\someServerName\SomeDirectories\someDatabaseFiles_TodaysDate.full.bak'. Operating system error 5(Access is denied.).
Msg 3013, Level 16, State 1, Line 1
BACKUP DATABASE is terminating abnormally.
Msg 22048, Level 16, State 1, Line 0
xp_create_subdir() returned error 183, 'Cannot create a file when that file already exists.'
Msg 3201, Level 16, State 1, Line 1
Cannot open backup device '\\someServerName\SomeDirectories\someDatabaseFiles_TodaysDate.full.bak'. Operating system error 5(Access is denied.).
Msg 3013, Level 16, State 1, Line 1
BACKUP DATABASE is terminating abnormally.
Msg 22048, Level 16, State 1, Line 0
xp_create_subdir() returned error 183, 'Cannot create a file when that file already exists.'
Msg 3201, Level 16, State 1, Line 1
Cannot open backup device '\\someServerName\SomeDirectories\someDatabaseFiles_TodaysDate.full.bak'. Operating system error 5(Access is denied.).
Msg 3013, Level 16, State 1, Line 1
BACKUP DATABASE is terminating abnormally.
Msg 22048, Level 16, State 1, Line 0
xp_create_subdir() returned error 183, 'Cannot create a file when that file already exists.'
Msg 3201, Level 16, State 1, Line 1
Cannot open backup device '\\someServerName\SomeDirectories\someDatabaseFiles_TodaysDate.full.bak'. Operating system error 5(Access is denied.).
Msg 3013, Level 16, State 1, Line 1
BACKUP DATABASE is terminating abnormally.

Things I've tried:

Changed ownership of SQL jobs to the domain account
Changed Maintenance Plan Ownership to domain account
Added domain account to Backup Operators
Added domain account to SQLServerMSSQLUser$....local group

Added domain account to SQLServerAgentUser$.....local group
Added domain account to local admin group

Everything I am finding says to change the service accounts to AD accounts.  I cannot do that.  Any suggestions would be greatly appreciated.

looking for a query to find first/last dates in overlapping dates...

$
0
0

Hi,

I'm looking for a query to find the first dates and last dates in a table conaining overlapping dates.

I have a subscription table which has for each Customer start and end date for different subscriptions.

I want to know the different ranges of date where there is subscriptions active.

so if the table has this:

CustID, Start date, end date

1, 2008-01-01, 2012-06-06

1 ,2009-01-01, 2011-01-01

1, 2011-01-01, 2013-02-02

1, 2013-01-01, 2013-08-08

1, 2014-01-01, 2014-04-04

I want to produce this result:

custid, range start, range end

1, 2008-01-01, 2013-08-08

1, 2014-01-01, 2014-04-04

the first row is the range identified from the 4 rows in my subscription table.

thanks :)


How to update the identity_column value in sql server 2008

$
0
0

Hi Team,

I have identity column based table. In the table i use insert the name as per the requirement and for ID i use to set the identity now i need to update the particular row id.

when i use to trying i'm getting the below error.

Msg 8102, Level 16, State 1, Line 4
Cannot update identity column 'CategoryID'.

Kindly help me out regarding this.

Thanks & Regards,

Ramesh R

Cleaning out bad DateTime data in Staging Table

$
0
0



I am trying to remove bad data from a table.  The data is imported from flat files that is often dirty.  It is easy to spot this bad data from the column that has the date field.  The staging table has the following schema.

TableA
ColumnAVARCHAR(255)
ColumnBVARCHAR(255)
TimeStampVARCHAR(255)

How can I delete all of the bad rows based on data that does not fit / convert properly to the datetime format?

Sample data:

TableA
ColumnAColumnBTimeStamp
Good Data Good Data Apr 18 2014  5:48PM
Good Data Good Data Apr 18 2014  5:48PM
Good Data Good Data Apr 18 2014  5:48PM
Good Data Good Data Apr 18 2014  5:48PM
Good Data Good Data Apr 18 2014  5:48PM
Good Data Good Data Apr 18 2014  5:48PM
Bad Data Bad Data Bad Data
Good Data Good Data Apr 18 2014  5:48PM
Good Data Good Data Apr 18 2014  5:48PM
Good Data Good Data Apr 18 2014  5:48PM
Good Data Good Data Apr 18 2014  5:48PM
Good Data Good Data Apr 18 2014  5:48PM
Good Data Good Data Apr 18 2014  5:48PM
Good Data Good Data Apr 18 2014  5:48PM
Good Data Good Data Apr 18 2014  5:48PM
Bad Data Bad Data Is Scattered
Good Data Good Data Apr 18 2014  5:48PM
Good Data Good Data Apr 18 2014  5:48PM
Good Data Good Data Apr 18 2014  5:48PM
Good Data Good Data Apr 18 2014  5:48PM
Good Data Good Data Apr 18 2014  5:48PM
Good Data Good Data Apr 18 2014  5:48PM
Good Data Good Data Apr 18 2014  5:48PM
Good Data Good Data Apr 18 2014  5:48PM
Good Data Good Data Apr 18 2014  5:48PM
Bad Data Bad Data Throughout
Good Data Good Data Apr 18 2014  5:48PM
Good Data Good Data Apr 18 2014  5:48PM
Good Data Good Data Apr 18 2014  5:48PM
Good Data Good Data Apr 18 2014  5:48PM
Good Data Good Data Apr 18 2014  5:48PM
Good Data Good Data Apr 18 2014  5:48PM
Bad Data Bad Data This column
Good Data Good Data Apr 18 2014  5:48PM
Good Data Good Data Apr 18 2014  5:48PM
Good Data Good Data Apr 18 2014  5:48PM
Good Data Good Data Apr 18 2014  5:48PM
Good Data Good Data Apr 18 2014  5:48PM
Good Data Good Data Apr 18 2014  5:48PM
Good Data Good Data Apr 18 2014  5:48PM
Bad Data Bad Data 
Good Data Good Data Apr 18 2014  5:48PM
Good Data Good Data Apr 18 2014  5:48PM
Good Data Good Data Apr 18 2014  5:48PM
Good Data Good Data Apr 18 2014  5:48PM
Good Data Good Data Apr 18 2014  5:48PM
Good Data Good Data Apr 18 2014  5:48PM
Good Data Good Data Apr 18 2014  5:48PM
Good Data Good Data Apr 18 2014  5:49PM

Can't find out why my DB is that big

$
0
0

I've got a database which is 260 GB in size. Since I know the application behind the DB, I know the DB should never be that big. Even more, one night I noticed that the DB has increased 30 GB where no obviously activity in the application happened.

The database has multiple tables, but only one of them has the big size of ~260 GB (checked trough Object Explorer Details and by various TSQL-queries). So I know the table for sure, but not the reason of the size of it. It's actual not possible the data inside it needs the storage, because the table has only 120'000 rows and only 17 columns. Non of the columns are LOBs, there are only datatypes of uniqueidentifier, int, varchar, nvarchar and datetime. Even when I take the max of 8 KB for a row and multiplicate it by 120'000 rows, the database should be smaler than 1 GB.

I already raised suspiction the index or the statistic could be that big as some queries a had run results a Index-size of 220 GB. Other queries on the other hand results a small index.

However, meanwhile I've dropped that Index (moreover, the Primary Key behind it) and also dropped the statistics. There is no index at all at moment (I will recreate the PK_Index after the size issue is solved). I tried to shrink the database several times, but I doesn't work. The size remains 260 GB. Yesterday I run the sp_clean_db_file_free_space which took 6 hours (!) but also doesen't decrease the database file. At moment I run the sp_clean_db_free_space SP, but I don't believe this will help me.

So my questions are:

* How to find out why the database is that big?
* How to decrease it?

Has somebody an idea? Thanks...

The target, “CE79811F-1A80-40E1-8F5D-7445A3F375E7.package0.asynchronous_file_target”, encountered a configuration error during initialization

$
0
0

I had a following error when I start event session>

The target, "CE79811F-1A80-40E1-8F5D-7445A3F375E7.package0.asynchronous_file_target", encountered a configuration error during initialization. Object cannot be added to the event session.

Im using this code...

create event session session_waits on server
add event sqlos.wait_info
(WHERE sqlserver.session_id=61 and duration>0)
, add event sqlos.wait_info_external
(WHERE sqlserver.session_id=61 and duration>0)
add target package0.asynchronous_file_target
  (SET filename=N'c:\wait_stats.xel', metadatafile=N'c:\wait_stats.xem');
go

all of this code completed successfully and when I execute following code, It throw me this error...

alter event session session_waits on server state = start;
go

How can I fix this error? The target, "CE79811F-1A80-40E1-8F5D-7445A3F375E7.package0.asynchronous_file_target", encountered a configuration error during initialization. Object cannot be added to the event session.

Thx.


Best practices for batch processing without SSIS

$
0
0

Hi,

The gist of this question is in general how should a C# client insert/update batches records using stored procedures. The ideas I can think of are:

1) create 1 SP with a parameter of type XML, and pass say 100 records at a time, on 1 thread.  The SP reads the XML as a table and does a single INSERT.

2) create 1 SP with many parameters, that inserts 1 records.  I can either build a big block of EXEC statements for say 100 records at a time, or call the SP 1 and a time, on 1 thread.  Obviously this seems the slowest.

3) Parallel processing version of either of the above: Pass 100 records at a time via XML parameter, big block of EXEC statements, or 1 at a time, and use PLINQ to make multiple connections to the database.

The records will be fairly wide, substantial records.

Which scenario is likely to be fastest and avoid lock contention?

(We are doing batch processing and there is not a current SSIS infrastructure, so it's manual: fetch data, call web services, update batches.  I need a batch strategy that doesn't involve SSIS - yet).

Thanks.

Viewing all 6624 articles
Browse latest View live


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