[SQL 2012] Condition positioning in where clause |
- Condition positioning in where clause
- Issue with Like Statement
- Problem with agent service accounts?
- SQL 2012 AlwaysOn with SQL 2008 Failover Cluster?
- SQL Cluster goes to sleep?
- SQL server 2012 CDC operation code for update are not correct
- Best practice for SQL UPDATE / INSERT for huge amount of data
Condition positioning in where clause Posted: 07 Aug 2013 02:47 AM PDT Hi.Can anyone please explain me this.When running a query on a table with 3 conditions in the where clause, if I change the position of the conditions in the where clause it could take 2 minutes while's if i leave the conditions positions it could take 2 seconds.For example: Table 1 contains a list of contacts.Table 2 contains a list of phone calls.Table 3 contains a list of email messages.When searching for a contact in table1 where not is (table2) and is in(table3) it could take 1 second for results.But when searching for the same a contact, where is in (table3) and is not in (table2) (the same query as above just now we search with table3 first) it could take 2 minutes.Please advice. |
Posted: 06 Aug 2013 09:54 AM PDT Hello,I have a textbox in my application which allows the user to type any criteria in this will then be fired to the DB to return matching records that are LIKE the criteria i've passed in.Now im my database table there are two records which differ these are as followsKipling Road Alexandra ParkWhen I type in the letter k both of them are returned yet only one has the letter k in?below is my stored procedure[code="sql"]ALTER PROCEDURE [dbo].[sp_GetMapLocations] @SearchText varchar (20)ASBEGIN SET NOCOUNT ON; Select LocationName, Latitude, Longitude from Locations where ((@SearchText is null) or ( LocationName like '%' + @SearchText + '%' ))END[/code]This is the part thats going wrong (which im sure you new anyway)[code="sql"]( LocationName like '%' + @SearchText + '%' )[/code]Any help would be appreciated. |
Problem with agent service accounts? Posted: 06 Aug 2013 07:33 AM PDT Hey guys. Ive never had this problem with SQL2008 /R2. But I cant get the SQL Agent to log in with anything but local system or a local user that has admin rights on the server. Generally, I would make a SQL_svc_agent_user and grant no rights and and using the sql installer it would grant any permissions including log on a service and add NT SERVICE\SQLSERVERAGENT as SA. Now even with all that in place this user cannot log on in 2012. Even if I granted SQL_svc_agent_user SA rights in Management Studio this still does not work. Seems like something changed in 2012? What am i missing here? The service account for SQL runs just fine but not the agent. This is a local account, but the machine is connected to a domain. Its driving me nuts!:hehe: |
SQL 2012 AlwaysOn with SQL 2008 Failover Cluster? Posted: 07 Aug 2013 01:31 AM PDT Does anyone know if you can have an availability group that has databases on a SQL 2008 R2 failover clustered instance and a 2012 standalone SQL server?Here is the scenario we want as most of our old applications will not be supported on 2012. We still have some on 2005. [u]Site 1 (Primary Site):[b][/b][/u]Failover Cluster 1: Two nodes each running Windows SQL Server 2008 R2 Enterprise Edition This is the traditional cluster with shared storage (active/passive) - we can only afford one replica on the site in terms of storageThis will be automatic failoverFailover Cluster 2: Two nodes each running Windows SQL Server 2012 Enterprise Edition This is the traditional cluster with shared storage (active/passive) - we can only afford one replica on the site in terms of storageThis will be automatic failover [u]Site 2 (Remote Site):[b][/b][/u] - Planned for DR scenario using alwaysON availability groupsStandalone SQL Server (which of course will be made part of the Windows FC indicated above): Single server running Windows SQL 2012 Enterprise EditionWe want to use alwaysON to create availability groups for manual failover between sites. Now, manual failover for Cluster 2 from site 1 to site 2 I believe is feasible. However, my concern is whether or not 2008 R2 FC is supported with 2012 alwaysOn. Is it possible to create availability groups so I can manually fail from my 2008 clustered instance to site 2?Thanks You. |
Posted: 06 Aug 2013 11:21 PM PDT I have two Windows 2012/SQL 2012 failover clusters that seem to go to sleep at night. I can connect to then with no issues all day long, but when I try in the morning I can not connect to them remotely. If I RDP to the server and run SSMS, they are fine, but from my desktop I get a "did not respond in a timely manor" I simply fail the instances to another node and then they are fine. There is nothing in the system logs that indicate any issues. We have the firewalls turned off. Any ideas? |
SQL server 2012 CDC operation code for update are not correct Posted: 06 Aug 2013 05:51 PM PDT HiHas anyone tried CDC on SQL server 2012The operation code for update is created as 1 and 2 but it should be 3 and 4Any guessAshish Shevale |
Best practice for SQL UPDATE / INSERT for huge amount of data Posted: 06 Aug 2013 03:29 AM PDT Hi Experts -I am using SQL MERGE for Update / Insert in my script for a table which has around 40 Millions of data and everyday, can expect up to 10 - 15 Lacs of data. Please suggest if MERGE is the best way to update / insert large volume of data. If not, please suggest.Thank You! |
You are subscribed to email updates from SQLServerCentral / SQL Server 2012 / SQL 2012 - General To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google Inc., 20 West Kinzie, Chicago IL USA 60610 |
No comments:
Post a Comment