Showing posts with label MS SQL Server. Show all posts
Showing posts with label MS SQL Server. Show all posts

Thursday, March 21, 2013

[MS SQL Server] How many instances we can create

[MS SQL Server] How many instances we can create


How many instances we can create

Posted: 20 Mar 2013 06:45 PM PDT

Hi allI have small doubt, how many instances we can create in production environmentand how many databases we can create on each instanceas per my knowledge we can create only one instance in production environment and also we can create multiple databasesif create multiple instances it will effect on performance on os level or system levelis this correct if anything wrong please correct it

Wednesday, March 20, 2013

[MS SQL Server] Replication configuration

[MS SQL Server] Replication configuration


Replication configuration

Posted: 20 Mar 2013 05:02 AM PDT

We have one requirement in Tranactional replication setup, One publisher and three subscriber.. How to configure one pub and three subscriber, and how to schedule data transfer for all subscriber.. Please anyone help to me ... Thanksjerry

Capturing deadlock info

Posted: 19 Mar 2013 11:56 PM PDT

I am looking for advice on capturing deadlock info.Can somebody please address the follwoing points :1. Does enabling trace flags T1204 AND T1222 have any impact on server performance and do i need to restart the sql server service to do this as the boss has said this really isnt an option.2. If i run profiler i understand it will have to be running at the time a deadlock occurs to capture info - what are the events i need to capture ? - Is there anyother way to capture the info - for example is a server side trace a better option ?3.Any links to good advice on troubleshooting deadlocks would be appreciated.Many thanksSteve:-)

SSIS package failing while executing as Agent job

Posted: 20 Mar 2013 01:29 AM PDT

Hi,I had some weird issues while running SSIS package as agent job. I can run SSIS package manually but failing to run as agent job. I thought its permission issues with Agent service account then I RDP into the server using service account login (domain\agentserviceaccount) and run the package and it went fine. any idea? much appreciated :)Thanks

SQL Agent - SQLSTATE 21000 error

Posted: 10 Jan 2010 08:14 PM PST

I have found weird error in my SQL Agent which is produced about every 30 seconds. The message reads as follows[298] SQLServer Error: 512, Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression. [SQLSTATE 21000]Strange thing is I cannot find the process which is causing this error, I have even disabled all SQL Agent jobs and restarted the service and server eventually but it still produces this error message every 30 seconds. Anyone come across this before?

CLR Question

Posted: 19 Mar 2013 09:37 AM PDT

We have a production CLR process that queries Active Directory for User Information and loads it into a table. We had 2 jobs that collided and ended up with blocking and hung jobs accessing the table. In an attempt to stop and restart the process I killed the job, however the process would not rollback as I believe the CLR thread still had a lock on the table. The process was in a rollback state and never moving(this is a small transaction with no more than 100 or so rows)I know this is not an ideal situation, but was curious for opinions on how to get rid of the lock on the table:My understanding is you can use the kpid from the sysprocesses table and map to a process on the server, and kill it there, but you run a likely risk of crashing SQL Server completely.I was thinking the most likely way to clear the process is to restart the SQL Service, however this would have been a large impact to the other databases on the instance.My thought and what I was looking for feedback on was switching the clr enabled function from 1 to 0 and then back to 1. My thought was this would unload the assemblies and kill the process. There was minimal impact as we only have a few databases using CLR assemblies compared to restarting the entire service. Thanks for the feedbackErich

Log shipping and CDC

Posted: 19 Mar 2013 10:41 PM PDT

I come seeking the wisdom of the collective. I have searched to no avail to try and understand the implication of using CDC on a database that uses log shipping. In a weird way I also want to understand if CDC will affect log shipping and vice versa.After much head scratching I am assuming that the truncation point in the log will move if CDC is deployed. So instead of the last commited transaction it will be the last commited transaction that has been harvested?So if I have log shipping every 10 minutes does this mean I need to get the CDC data out of my source system before that 10 minutes cut off. Will it make my log shipping out of date??So many questions. Pointers to good articles gratefully received.Many thanks:w00t:

Doubts on mirroring

Posted: 19 Mar 2013 06:09 PM PDT

Dear AllI need some clarifications on mirroring. please help me out1) After configure the mirroring if the principal is failed and don't have the witness?if witness is there automatically failover will happen and mirror will come onlineif witness is not there how to do the fail over2) if mirror server is fail here no issue for principal after some time principal is also not available how to do the fail overCan anyone please help on this

how to know the delta data volume processed every day in mb

Posted: 07 Mar 2013 05:57 PM PST

Hi I wanted to know if there is a way to figure out how many bytes of data have been processed while performing the delta on a table. I can easily get the delta count of every delta job run, but I'm not aware if there is a way to figure out how many bytes are processed based on the delta row counts or other. We use Informatica for our ETLs if this helps to get the delta data volume info.Please help and suggest of all possible ways to get this info.

Log Shipping Compression

Posted: 19 Mar 2013 09:14 AM PDT

Hello, does anybody know if any versions of SQL have the ability to compress log files before shipping. The plan was to log ship from the local data centre to a SQL instance in EC2 (Amazon Cloud) but due to the high latency we get from here (NZ) to Amazon (Singapore) a large file takes an unrealistic time to copy. Therefore compression would be a help.We are currently using SQL 2008 STD.I think I have read the SQL 2008 Enterprise editions have this feature but I am unsure if SQL 2008 R2 STD or SQL 2012 STD also have this feature as I think normal backup compression was added to these additions....thanks

Auditing a Table for Select Statement By Active Directory User

Posted: 19 Mar 2013 08:10 AM PDT

Hey guys,I'm attempting to set up auditing on a table in my database. Under the database audit specification properties GUI, I have Audit Action Type "Select"Object Class "Object"Object Schema "dbo"Object Name "ImportantTable"Principal Name "OurNetworkDomain\Me"With this current setup, I perform a Select * From ImportantTableHowever the audit log does no logging. If I change the principal name to "Public" or "dbo" it correctly logs my activity and even shows under "Session Server Principal Name" and "Server Principal Name" columns that I am coming from OurNetworkDomain\MeI don't want to use dbo or Public as it will collect way too much information. Any ideas why this doesn't work when I just specify the Active Directory user individually?Thanks!Andrew

Tuesday, March 19, 2013

[MS SQL Server] What are the chances to went a DB offline or Suspect mode?

[MS SQL Server] What are the chances to went a DB offline or Suspect mode?


What are the chances to went a DB offline or Suspect mode?

Posted: 19 Mar 2013 05:17 AM PDT

Hi Frineds,What are the chances to get a DB offline or Suspect mode?give me some examples pleaseThank you in Advance :-)

SSIS ForEach Loop Container - loop through all DB's

Posted: 15 Feb 2013 06:27 AM PST

I am trying to get the FELC to loop through all the databases for my sql server. I want to set up a variable by database_id from the sys.databases table so the FELC knows to loop through all the databases. Has anyone wrote this before or have a different approach that I can try?

Do not log job history

Posted: 19 Mar 2013 12:03 AM PDT

Hi,My SQL Server instances have some jobs that run very frequently ( some execute at every 30 seconds ) and these jobs are consuming all my job history log size and I am losing the history of my main jobs.I already did some research and found how to increase this log size, but the best would be if I could say to not log some jobs' output. I did some some research, but I did not find anything about it.Does anyone know if this is possible?Thanks!

sql not finishing or stuck

Posted: 18 Mar 2013 09:40 PM PDT

I'm on SQL 2008 10.0.4371 with 16 cpus and 24 gigs of RAM. Under some condition, I start getting increasing CPU loads (until about 90% utilization on all 16 cpus) and a website that stops responding that never disappear until I restart SQL Service. During this time, the only thing that seems to jump out is 4 million reads per second. I tried running sp_whoisactive, but nothing seems to be jumping out. Other than everything is waiting on SQL to send the results. The app servers are WebSphere so we're using SQL JDBC along with (eeek) cursors. There are a couple queries that run slow and missing indexes, which I've submitted to IBM. I have four temp dbs (100 meg and three 200 meg--which I want to set all to 100) one on D: the rest on E:. Of course yesterday I noticed the c, d and e drives are all on the same lun. So, I'm think maybe going down to 1 or 2 tempdb instead. The e drive tempdbs have a read stall of 28 seconds while the d is around 8 or less. Also, the other thing is I'm thinking of turning on ad hoc optimization as with the cursors there's no stored procs (ugh). I did notice that SQL was only using 4 gig of ram, and have fixed that.Is there a switch I can turn on to end a command if it does not finish in a certain amount of time? Is that the governor?

Loading Users into instance security

Posted: 19 Mar 2013 12:57 AM PDT

We are moving from a server with SQL server 2005 to one with SQL server 2008. Is there any way to script a bulk load of users into the instance security? I have mounted the databases, from backup, but need to get the users set-up in the instance. With over 1,000 users this would take a while going through the SSMS GUI interface.

Delayed Execute and/or Commit

Posted: 19 Mar 2013 02:30 AM PDT

I have a scheduled job (.Net, WinOS Task Scheduler) which completes shortly after it's called but the SQL work it should accomplish in real time does not happen until several hours later. The .Net scheduled job calls a stored procedure which updates 2 "top level" tables and outputs 3 data readers (that's what they are to the .Net program). Both updated tables have 2 update triggers each (one trigger inserts to a log table & one manages some computed fields in "quick search" tables). One of the fields updated in each table is a datetime field - set to getdate() within the sproc. Temp tables are used to identify the rows to be updated. Quick pseudo-code (showing just one update and select statement):----declare @mydate dateimeset @mydate = getdate()declare @UpdateIDs table(MyID int)insert @UpdateIDsselect CaseID from TopLevelTable1where ...begin transaction update TopLevelTable1 set Flag1 = [new value] , Flag1Date = @mydate where CaseID in (select MyID from @UpdateIDs) -- 2 triggers are fired in conjunction with this statementcommit transactionselect [several fields]from @UpdateIDs tinner join [several joins from temp table]----The problem: the .Net program runs at 11p each night and completes in about 20 seconds. It sends out an email for each row in the select and one to me regarding the ending status. All those emails happen at 11p. The job reports success.But the time stamp (the param @mydate & the field TopLevelTable1.Flag1Date) is 6am the next day. The trigger inserting to TopLevelTable1_Log has a field LogDate which is set to getdate() within the trigger and its value is also 6am.There is no other maintenance work being done at that time. Transaction logs (using sqllogship.exe) are being done and full database backup is done at 1:45am. That full backup has the unmodified rows relating to the this job.What could be happening?

Sql server back ground processes.

Posted: 19 Mar 2013 02:25 AM PDT

I want to know , when i am execute sql select query , what are processes will be running in backgroundPlease

SP3 upgrade on SQL 2008 issue

Posted: 18 Mar 2013 06:11 PM PDT

Hi,Recently we tried upgrading SQL 2008 cluster instance from SP2 to SP3. After patching done on passive node, we tried connecting to SQL instance through SSMS, but got the error "Login failed for user. Server is in script upgrade mode. Only administrator can connect at this time".Can someone please let me know the reason and its solution?Regards.

Monday, March 18, 2013

[MS SQL Server] FileStream backup and restore

[MS SQL Server] FileStream backup and restore


FileStream backup and restore

Posted: 18 Mar 2013 08:57 AM PDT

We're using MS SQLServer 2008 R2 and we are exploring the possibility of using FILESTREAM to store in a separate filegroup our documents and images, mostly PDFs. I have read a few articles on filestream and I'm running a few small tests to convert our existing data. It seems to work pretty good. My question is in regards to backing up and restoring the data and also I'd to make some clarifications. Is there a good article in regards to backing up and restoring filestreams? Can a backup/restore be done independently for each filegroup? For example, if a user deletes some data from the filestream filegroup, can I restored that portion of the database only? I'm running some tests on my development machine and I'm running into some error messages. I'm getting errors where it leaves the DB in restoring mode.

can not find Model after Master restore

Posted: 17 Mar 2013 01:20 PM PDT

I was doing some testing to ensure I had all the version build files required to restore the Master database if the entire server crashed and it had to be restored on another server.I managed to track down the hotfix that gave me the correct version and applied that to the new named instance I had created on my machine for testing [ABC\SQL2008].I got a master backup from a prod server and managed to restore the Master OK.The SQL Service then would not start with the errorI have had the issue trying to restore Master before on a new system where the build was different. I built a named instance and this error happened. After tracking [i]2013-03-18 15:03:39.53 spid7s Error: 15466, Severity: 16, State: 1.2013-03-18 15:03:39.53 spid7s An error occurred during decryption.2013-03-18 15:03:39.55 spid8s Starting up database 'model'.2013-03-18 15:03:39.55 spid7s Server name is 'ABC\SQL2008'. This is an informational message only. No user action is required.2013-03-18 15:03:39.55 spid7s Informational: No full-text supported languages found.2013-03-18 15:03:39.56 spid8s Error: 17204, Severity: 16, State: 1.2013-03-18 15:03:39.56 spid8s FCB::Open failed: Could not open file C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\model.mdf for file number 1. OS error: 2(failed to retrieve text for this error. Reason: 15100).[/i]This location in the error is the location for the production server Model database.There is also an error that it can't create the tempdb (which is in the D:\ of the prod server that does not exist on my machine).Does anybody have any pointers on how to fix this?If a Master is installed on another server does the instance type (in this case default) and file paths have to be exactly the same as the server the Master came from?and do the user databases have to exist on start up (at the Master DB paths) or can these be added later on)thanks

Problem with Database mail

Posted: 02 Mar 2013 06:24 AM PST

We have SQL SERVER 2008 R2,which Database mail does not work properly.When I try to send test mail,it says it has been queued but it does not being delivered.Here are some point about about Database mail configuration1- Database mail is enabled.3- database mail is started4- the status of mail queue is "InActive"5- The size of mail queue is 9025 and status is Inactive and the status queue is empty(length is 0) and it has been actived a long time ago.6- service Broker is enabled.7- When I ran the databasemail.exe manually nothing happened.8- In mail log shows only The mail queue was started or stopped and it does not show any failure or problem.Note : I have one Profile and one account in that profile.I wil be grateful,if someone help me on this.ThanksAspet

Rebuild system database failure

Posted: 14 Jan 2013 09:43 AM PST

I have a situation where all system database (.mdf, .ldf) were wiped out after system recovery from a major outage. I try to follow this link (http://blogs.msdn.com/b/psssql/archive/2008/08/29/how-to-rebuild-system-databases-in-sql-server-2008.aspx)to rebuild system databases but got error that difficult to trouble shoot. OS: window 2008 SP1SQL: 2008 SP2My question1:1. Is the "setup" file is still good to use if my sql server is patched to SP2 after installation?2. What else I can try to recover system files if I have the backup files?ThanksClare

Automate Data Compression

Posted: 18 Mar 2013 04:24 AM PDT

I would like to automate the compression job for every week end by filtering on newly created tables/indexes with more than 10gb size, also would like to run on all tables in the server for the first time. Is there a script already on this forum to share, appreacite your help.Here are the commands i will be using on a SQL Server 2008R2 version, ThanksALTER TABLE dbo.tabEMP REBUILD PARTITION = ALL WITH (DATA_COMPRESSION=ROW);----------------------------------------------------------------------------------------------------ALTER INDEX [index_main] ON [dbo].[tabEMP] REBUILD WITH (DATA_COMPRESSION=ROW);

Database restoration to network mapped path..

Posted: 17 Mar 2013 07:32 PM PDT

As i Don't have enough Space in my server machine.Is it possible to restore DB to a network mapped path? i Got a linkhttp://www.dotnetfunda.com/articles/article1054-database-backup-to-restore-from-remote-server-sql-server.aspxI try the steps to restore my back up in my server to a network mapped path (path is in another machine). But It executed infinitely with 0% progress on SQL server management studio. Is it Possible to restore a DB to network Mapped path? If yes, Please Guide me to restore DB to a network path.

Log shipping in sql server 2000

Posted: 17 Mar 2013 03:35 PM PDT

Hi all I have one doubt about log shippinghere we have two servers one is sql server 2000 and another one is sql server 2005.here i want to configure the log shipping also i want to know whether is it possibleif possible i want to know the process for sql server 2000 log shippingis this same like sql server 2005 or not?Thanks in advance

Saturday, March 16, 2013

[MS SQL Server] Suggestions on TEMPDB Setup

[MS SQL Server] Suggestions on TEMPDB Setup


Suggestions on TEMPDB Setup

Posted: 15 Mar 2013 05:46 AM PDT

I have a teradata environment with database aroudn 3TB. This server has around 40 core processors. Microsoft suggested to Use only 32 processors instead of 40 as there was a bug.So, Inorder to build temp database I am starting with 8 temp data files and 1 log files. I have two solid state drives each of size 290GB, so Total of two drives is 580 GB . So, I am diving my files in the following way. I need your suggestionin dividing the files.My environment uses lot of tempdb. Please suggest with my ideas.T1: 70 GBT2:70 GBT3:70 GBT4:70 GBT5:70 GBT6:70 GBT7:70 GBT8:70 GBTlog: 10 GB.By dividing into this way do I across any problems.

access named instance from SSMS

Posted: 15 Mar 2013 05:46 AM PDT

To access a named instance from SSMS it is SERVER\INSTANCE_NAME or SERVER$INSTANCE_NAME? I have tried both, for SERVER\INSTANCE_NAME I get an immediate "Login Failed" message so I tend to think that is it and I just don't have access? But I need a way to confirm. I can not open the SQL SERVER Configuration Manager, I get a "Cannot connect tp WMI provider, you don't have permission or the service is unreachable". I am trying to access a Reporting server database that had a named instance of sql server installed for it but whoever did this didn't add permissions for our sqlAdmins group.... hmmm.. Any advice on this? Thank you.

Log File Shrink

Posted: 15 Mar 2013 05:42 AM PDT

Now that we got the log file backups under control, now it's time to shrink the log file. I'm going to start with the Test DB which is only 56 gig, and when they (consultants) created the log file initialy, they set the log file size to 59 gig. See below the results of DBCC SQLPERF(logspace). It looks as though I can really shrink this sucker. What do you think would be an appropriate size, remembering this is a test DB with not a lot of transactions going through. [img]http://i1359.photobucket.com/albums/q791/midnight251/LogFileSize_zps62bd6b1a.jpg[/img]

Friday, March 15, 2013

[MS SQL Server] The distribution agent failed to create temporary files

[MS SQL Server] The distribution agent failed to create temporary files


The distribution agent failed to create temporary files

Posted: 26 Sep 2012 03:42 AM PDT

HiI'm getting this error with a transactional replication setup on SQL 2008R2 Standard (SP1): The distribution agent failed to create temporary files in 'C:\Program Files\Microsoft SQL Server\100\COM' directory. System returned errorcode 5. (Source: MSSQL_REPL, Error number: MSSQL_REPL21100)I've been to [url]http://support.microsoft.com/kb/956032/en-us[/url] amongst other places, and as a result given full control to Everyone on the C:\Program Files\Microsoft SQL Server\100\COM folder (I tried the SQL Agent and Distribution agent accounts first). I've also disabled on-access scanning for the anti-virus software. It's a 2-node cluster so I've done this for both nodes.Is there anything else I can try in order to troubleshoot further? - only this one has got me completely stumped.Thanks everyone,Duncan

Transact-SQL job step to run under proxy

Posted: 14 Mar 2013 10:35 AM PDT

HelloI have a Transact-SQL job step that I want to run under a proxy however I cannot get it to work. I have created the credential then created the proxy to run under all subsytems however when I try and choose the proxy in the 'run as' drop down it does not appear. I am running sql server 2008 enterprise edition

Thursday, March 14, 2013

[MS SQL Server] SQL 08R2 SP2 - did not update!!

[MS SQL Server] SQL 08R2 SP2 - did not update!!


SQL 08R2 SP2 - did not update!!

Posted: 14 Mar 2013 01:55 AM PDT

Hello SQL peeps, I installed SQL 08R2 SP2 last week on about 20 servers however one did not update. (All where being updated from SQL 08R2 SP1)The install ran just fine, all 5 times, but it did not update the server on restart, shut down, power off and on. I did the normal @@version and it never updated. Has anyone else seen this, before I call MS?Many Thanks,:cool:

Question about clustering

Posted: 13 Mar 2013 11:30 PM PDT

Hello,I would like to ask for some insights about SQL Server Clustering. When you fail over an instance to another node, does the cache also gets reset?Thank you.

\Microsoft SQL Server\100\COM directory filling up with .err files

Posted: 13 Mar 2013 09:12 PM PDT

The C:\Program Files\Microsoft SQL Server\100\COM\ directory on some of my replication subscriber servers is filling with .err files over time - some are 0.5 GB.The files are named in the format [Publisher]-[Publication]-[Subscriber]-UniqueIdentifier.[b]err[/b]Is the location of these error files configuration i.e. can I get them off the C: drive so it doesn't fill up?Is there any cleanup job that goes with these?Any advice appreciated. Google only throws up issues where "temporary" files can't be written to this directory due to security, but these .err files are hanging around too long to be temporary.

SQL Ring Buffers

Posted: 13 Mar 2013 07:24 PM PDT

Hi AllWhen analyzing SQL's ring buffers using the below[code="sql"]SET QUOTED_IDENTIFIER ONSELECT EventTime, n.value('(Pool)[1]', 'int') AS [Pool], n.value('(Broker)[1]', 'varchar(40)') AS [Broker], n.value('(Notification)[1]', 'varchar(40)') AS [Notification], n.value('(MemoryRatio)[1]', 'int') AS [MemoryRatio], n.value('(NewTarget)[1]', 'int') AS [NewTarget], n.value('(Overall)[1]', 'int') AS [Overall], n.value('(Rate)[1]', 'int') AS [Rate], n.value('(CurrentlyPredicted)[1]', 'int') AS [CurrentlyPredicted], n.value('(CurrentlyAllocated)[1]', 'int') AS [CurrentlyAllocated]FROM ( SELECT DATEADD (ss, (-1 * ((cpu_ticks / CONVERT (float, ( cpu_ticks / ms_ticks ))) - [timestamp])/1000), GETDATE()) AS EventTime, CONVERT (xml, record) AS record FROM sys.dm_os_ring_buffers CROSS JOIN sys.dm_os_sys_info WHERE ring_buffer_type = 'RING_BUFFER_MEMORY_BROKER') AS tCROSS APPLY record.nodes('/Record/MemoryBroker') AS x(n)ORDER BY EventTime DESC;[/code]Which broker would indicate pressure in the data cache portion of the buffer pool?I think that the MEMORYBROKER_FOR_CACHE reports on the plan cache portion of the buffer pool, is this right?Thanks

Wednesday, March 13, 2013

[MS SQL Server] Grant persmissions to database

[MS SQL Server] Grant persmissions to database


Grant persmissions to database

Posted: 13 Mar 2013 05:09 AM PDT

We have 5 small in-house developed applications whose databases are hosted on a SQL server.For each application we have an execute account that is used by application to access back end SQL databasesSo I create the logins in SQL server. Now come to the users security part.Shall I simplely grant db_owner for these five accounts for their application databases respectively?They may need to read and write and also execute stored procedures in the databases. So I think db_owner should be simple and fine.Thanks

Cannot connect after change Service Account

Posted: 13 Mar 2013 04:42 AM PDT

I have a 2008 R2 SQL Server that is not clustered. I changed the SQL Service Account username and password. All SQL Services start up but I am unable to connect using Windows Authentication. I can connect using a SQL Account with sysadmin rights. Admin rights are granted to a Domain Security Group (which I am a member). Is there a step I'm missing? I have changed the Service Account and passwords on other Servers without any errors.

How to find cause of Replication delay?

Posted: 12 Mar 2013 10:59 PM PDT

Hi everyone,I just have a quick question about finding the cause of a delay I saw with one of my subscriptions today. I noticed that data was not being published to the subscription when I tried accessing a report and began looking for the issue. I did the usual checks with the replication monitor and I checked the connection between both servers, looked at the job history, checked the sync history etc. But I found no errors or warnings. The only thing I could see was that the sync status said that the subscription was waiting on a reply from the server but thats all the info I could find :ermm: Any help on where to look to find the cause of this delay would be really helpful, and as a side note should I apply alerts to notify me if there is a delay again? Thanks in advance for all your help,Kindest Regards,Craig Specs:Windows Server 2008SQL Server 2008 R2

Tuesday, March 12, 2013

[MS SQL Server] SSIS Job fails using Domain Account

[MS SQL Server] SSIS Job fails using Domain Account


SSIS Job fails using Domain Account

Posted: 12 Mar 2013 09:51 AM PDT

I get this error when I attempt to run the Package using the Domain Account, SQLServerAgent.[quote]MessageExecuted as user: MyDomain\SQLServerAgent. Microsoft (R) SQL Server Execute Package Utility Version 10.50.2500.0 for 64-bit Copyright (C) Microsoft Corporation 2010. All rights reserved. Started: 01:29:42 PM Could not load package "\Dev\AS400\CYP_Staging_Load_Truncate_Nightly" because of error 0xC0014062. Description: The LoadFromSQLServer method has encountered OLE DB error code 0x80040E4D (Login failed for user 'MyDomain\SQLServerAgent'.). The SQL statement that was issued has failed. Source: Started: 01:29:42 PM Finished: 01:29:42 PM Elapsed: 0.046 seconds. The package could not be loaded. The step failed.[/quote]The package is stored in MSDB.I added the Account to sysadmin and made it a local admin.It works with my login.It is totally weird.I granted permissions to the Temp Folder for the SQLServerAgent but no dice.Any ideas?Thanks.

Monitoring error

Posted: 11 Mar 2013 07:47 AM PDT

I'm using Red-Gate Monitor tool to help me in managing our SQL Server. I see very frequently these two messages: Monitoring error (SQL Server data collection) and Monitoring Error (host machine data collection). I know there could be almost an infinite number of reasons for these error but I was wondering how would it be best to try to find out the reasons why I'm getting notified on these. I looked at our existing backup jobs and schedule jobs as well as the logs to see if I can find a reason why this is happening. Any other ideas or a direction that I need to go to get more information on this it would be very appreciated.

Find SPID of Linked Server Call

Posted: 12 Mar 2013 07:14 AM PDT

Hi SCC,I have a stored procedure on server A that makes a linked server call to server B.... on server A I see the wait type is OLEDB so I want to look at the SPID on server B... is there a way to identify the remote SPID other than connecting to the server and doing an sp_who2 and looking for the client who made the connection and then username of the linked server?Thanks!

Reporting Services Logs not being deleted

Posted: 08 Feb 2011 06:16 AM PST

We have a server running SQL 2008 SP1, Standard. We recently discovered that SSRS isn't cleaning up it's log files. Checking the in the ReportingServicesService.exe.config file and Service configuration confirms the service is configured to the default of 14 days, and the the log file locations are also default.Does anyone have an idea why SSRS would keep over a years worth of log files, or what could stop the cleanup. We aren't seeing anything fail in the environment but the drive fills up.CheersLeo

Big table

Posted: 11 Mar 2013 07:59 AM PDT

We have a lookup table GeographicLookup table with a primary key called gisGeorgraphicLookup.It now has 2 million records, with each year we have about 550000 rows records ranging year 2010-2014 .Could many records like this reduce performance or reduce the speed for lookup?If we only use most recently a couple years data, should we archive other records into another table?or any other recommendations, we are using SQL 2008 standard edition.

DR/HA proposal

Posted: 11 Mar 2013 10:59 AM PDT

I need to write DR/HA proposal any suggestions?

SSMS showing local DBs not remote DBs when editing remote maint package

Posted: 12 Mar 2013 12:11 AM PDT

Hi AllWhen I open an Integrity check task from a server (SQL 2008 R2) with my SSMS(SQL2012) on my PC the task shows loacal DBs in the database drop down. Any ideas.:w00t:

dadication and shared connection in sql

Posted: 12 Mar 2013 12:09 AM PDT

is there a concept of dadicated connection and shared connection in sql similar to oracle.if yes, how it has to be configured can anybody explain about this.Thanks in advance

Replication from SQL 2008R2 to SQL 2012

Posted: 11 Mar 2013 05:41 PM PDT

Gurus, I have weird replication issue. Can't figure out what the issue is here. Please help me with ideas/known bugs(if any):w00t:Publisher: SRVA - SQL 2008R2Distributor: SRVB - SQL 2008R2Subscribers: SRV1 - SQL 2008R2 SRV2 - SQL 2008R2 SRV3 - SQL 2008R2 SRV4 - SQL 2012Number of Publications: 3originally, replication was set-up from backup. later on, we had to add couple of articles to Publication-3. we followed an article which said to switch off "immediate_sync" and "allow_anonymous" to false and re-snap. This way, we will take snap of only the two articles we have to add.Now, the issue is, we had to add two more articles today, when we followed same procedure, snapshot agent has created drop and re-create scripts for the two articles. However, create table scripts were not applied to the SRV4. Rest of all the procs for repl insert, update, delete were created on this instance. Just the tables and thier pks weren't created.Fixed the issue by manually creating the table and Pk. Stopped and re-started Distributed agent and everything started to work fine.:pinch:Checked the permissions for snapshot, distributed agents. Everything is normal with regards to permissions. Can't find a root cause of the issue. Please help!!:crying:ThanksJagan K

Wednesday, March 6, 2013

[SQL Server] Stuck on new fault with my update

[SQL Server] Stuck on new fault with my update


Stuck on new fault with my update

Posted: 06 Mar 2013 10:57 AM PST

Hi Professionals I am running the following query as advised previously which updates the source table based on a column from the reference table matching...BEGIN TRANSACTION Inner1;GOUPDATE dbsource SET software_name_raw = dbref.software_name_amended FROM dbo.BigTable dbsourceINNER JOIN ( SELECT software_name_raw,software_name_amended FROM RefTable GROUP BY software_name_raw,software_name_amended) dbref ON dbref.software_name_raw = dbsource.software_name_rawgoCOMMIT TRANSACTION Inner1;I have run into a problem which is. If they dont match I need to update the reference tables 2 columns with the new unmatched record to reference something like thisELSE INSERT INTO RefTable(software_name_raw,software_name_amended)Values BigTable(software_name_raw,'Needs Updating')How can or can this be amended easily.

Command(s) completed successfully. only output set parseonly NOT checked

Posted: 06 Mar 2013 04:18 AM PST

Hello,I have been trying to solve this for hours. I know it's very likely something really basic but...When I run a built in stored procedure, for example sp_helppublication, in SSMS, I just see this:Command(s) completed successfully.No output. I have checked so many settings. I think I have looked everywhere in the settings for SSMS but maybe not. I definitely don't have the set parseonly checked. Could someone please help? Thanks in advance.

The SSIS package keeps forgetting the password

Posted: 06 Mar 2013 03:57 AM PST

I have a SSIS Package that is giving me an error connection'Test connection failed because of an error in initializing provider. Login failed for user.....The package does not remember password.Im connecting to a SQL Server 2005 box using its user_password with sysadmin role.The SSIS package runs fine when you first set up the connection in bidsThe bottom line is that SSIS keeps forgetting the password I feed intothe two Connections that I'm using. I double-click a connection,type the password in, check "Save my password" and hit "OK" but thepassword disappears from there whenever I run the package ordouble-click the connection again.Is anyone know what to do!! please help!! I have a very short time to deploy this package in production.

combine multiple rows into one dynamically query question

Posted: 02 Sep 2009 05:20 AM PDT

Hi, I have the below table, and I need to combine theminto one records dynamically (I'm not sure I'm clear on this,so maybe you look at the below table is better).create table Test( id int, name varchar(30), counts int)insert into Testselect 1, 'Math', 5unionselect 1, 'Literature', 3unionselect 1, 'Cooking', 1unionselect 1, 'Reading', 2I would like the result to look like this below, id categorycounts1 Cooking (1), Literature (3), Math(5), Reading(2) the challenge I have is the id can have multiple values like this, how do I know to combine them all dynamically and correctly. thanks a lot if you could help and give any input.

Splitting a string into fields

Posted: 06 Mar 2013 12:46 AM PST

Hi AllI have a field called Defects which contain strings like the following. The string makeup is always the same.Scrap : Part Assembly : Surface Defects : ScratchScrap : Part Assembly : Components : Wrong ComponentsScrap : Part Assembly : Other : Change OverRepair : Punching : Surface Damages : CrackWhat I would like to do is create a view that splits the string by the : and have them displayed as individual fields.I started of using CharIndex to find the : and then use left and the charindex to strip the first part out, but I felt doing it this way would involve a lot of LEFTs and RIGHTs to split up the whole string, is there an easier way to accomplish this?CheersDJ

The absolute basics of coding SQL Server in VB.net

Posted: 05 Mar 2013 07:56 PM PST

I am trying my best to get my head around SQL Server but seem to be going around in circles. Everything I google is either way too complicated for my simple means or else I find half a dozen different ways to do the same thing.Can somebody please point me to a site, an article or a video where, in clear, plain, simple English, it explains the differences and the relationships between a datatable, a dataset, a dataadapter, a datastream & various other options I keep getting presented with ?!?The sooner I can grasp the concepts and the differences, the sooner I can spend my time actually coding rather than asking questions ;-) !!!

Invalid precision value

Posted: 05 Mar 2013 07:42 PM PST

Hi,I am new to MS SQL and the project need arose to bind an OUTPUT blob. Towards that I created a stored procedure which returns a nvarchar(max) type. I do not know what will be the length of this blob as this is constructed by the stored procedure.The SQL Server that I am running this on is 2005.I am binding in my C++ application using SQLBindParameter. This is how I am doing it. retcode = SQLBindParameter(hStmtHandle, output_blobs_[i].cur_pos, SQL_PARAM_OUTPUT, SQL_WCHAR, SQL_WLONGVARCHAR, 0, 0, (SQLPOINTER)output_blobs_[i].cur_blob, 0, (SQLINTEGER*)&size );This is how my stored procedure looks likecreate proc ujo_delete_box @del_dep_list nvarchar(max) OUT, @job_name varchar(64), @joid int, @rstr_del_job int, @rstr_del_depjob int, @ref_integrity int, @stamp int, @del_box int, @user varchar(80)No matter what I do I don't seem to get past the bind stage. With the way SQLBindParamter is depicted, I always end up with the below error when I try to bind the nvarchar(max) field. Error from SQLBindParameter() Failed for stored procedure. SQLSTATE: HY104, Native error: 0, Message: [Microsoft][ODBC SQL Server Driver]Invalid precision valuePlease let me know what am I doing wrong.Regards,Rajesh

Patching OS for SQL Boxes Advice

Posted: 05 Mar 2013 08:21 PM PST

Hi all, Anyone have any advice for patching windows on SQL boxes. We have dev environments for about 50% of our live servers. So will patch dev confirm its ok then live (They should be the Same OS, SQL version) I was just planning on doing all high priority updates and leaving software, where its windows search or IE etc. The thing im really not sure on about is .NET, IF SQL needs 3.5 to install should i ignore .NET 4? or upgrade to it? There always seems to be a lot lo .NET patches. so im interested to know what poeple normally do about them. Regards

Search This Blog