Search Results

Search found 37012 results on 1481 pages for 'sql query'.

Page 162/1481 | < Previous Page | 158 159 160 161 162 163 164 165 166 167 168 169  | Next Page >

  • SQL Server 2005 Blocking Problem (ASYNC_NETWORK_IO)

    - by ivankolo
    I am responsible for a third-party application (no access to source) running on IIS and SQL Server 2005 (500 concurrent users, 1TB data, 8 IIS servers). We have recently started to see significant blocking on the database (after months of running this application in production with no problems). This occurs at random intervals during the day, approximately every 30 minutes, and affects between 20 and 100 sessions each time. All of the sessions eventually hit the application time out and the sessions abort. The problem disappears and then gradually re-emerges. The SPID responsible for the blocking always has the following features: WAIT TYPE = ASYNC_NETWORK_IO The SQL being run is “(@claimid varchar(15))SELECT claimid, enrollid, status, orgclaimid, resubclaimid, primaryclaimid FROM claim WHERE primaryclaimid = @claimid AND primaryclaimid < claimid)”. This is relatively innocuous SQL that should only return one or two records, not a large dataset. NO OTHER SQL statements have been implicated in the blocking, only this SQL statement. This is parameterized SQL for which an execution plan is cached in sys.dm_exec_cached_plans. This SPID has an object-level S lock on the claim table, so all UPDATEs/INSERTs to the claim table are also blocked. HOST ID varies. Different web servers are responsible for the blocking sessions. E.g., sometimes we trace back to web server 1, sometimes web server 2. When we trace back to the web server implicated in the blocking, we see the following: There is always some sort of application related error in the Event Log on the web server, linked to the Host ID and Host Process ID from the SQL Session. The error messages vary, usually some sort of SystemOutofMemory. (These error messages seem to be similar to error messages that we have seen in the past without such dramatic consequences. We think was happening before, but didn’t lead to blocking. Why now?) No known problems with the network adapters on either the web servers or the SQL server. (In any event the record set returned by the offending query would be small.) Things ruled out: Indexes are regularly defragmented. Statistics regularly updated. Increased sample size of statistics on claim.primaryclaimid. Forced recompilation of the cached execution plan. Created a compound index with primaryclaimid, claimid. No networking problems. No known issues on the web server. No changes to application software on web servers. We hypothesize that the chain of events goes something like this: Web server process submits SQL above. SQL server executes the SQL, during which it acquires a lock on the claim table. Web server process gets an error and dies. SQL server session is hung waiting for the web server process to read the data set. SQL Server sessions that need to get X locks on parts of the claim table (anyone processing claims) are blocked by the lock on the claim table and remain blocked until they all hit the application time out. Any suggestions for troubleshooting while waiting for the vendor's assistance would be most welcome. Is there a way to force SQL Server to lock at the row/page level for this particular SQL statement only? Is there a way to set a threshold on ASYNC_NETWORK_IO waits only?

    Read the article

  • pl/sql Oracle syntax

    - by Paul
    I have a query in pl/sql that i need to migrate to ms sql. select count(*) from table1 t1 where (conditions1) and (conditions2) and variable = t1.column1(+) Could anyone tell me what the (+) after the column means ? (is it sort of a sum ?)

    Read the article

  • sql: Group by x,y,z; return grouped by x,y with lowest f(z)

    - by Sai Emrys
    This is for http://cssfingerprint.com I collect timing stats about how fast the different methods I use perform on different browsers, etc., so that I can optimize the scraping speed. Separately, I have a report about what each method returns for a handful of URLs with known-correct values, so that I can tell which methods are bogus on which browsers. (Each is different, alas.) The related tables look like this: CREATE TABLE `browser_tests` ( `id` int(11) NOT NULL AUTO_INCREMENT, `bogus` tinyint(1) DEFAULT NULL, `result` tinyint(1) DEFAULT NULL, `method` varchar(255) DEFAULT NULL, `url` varchar(255) DEFAULT NULL, `os` varchar(255) DEFAULT NULL, `browser` varchar(255) DEFAULT NULL, `version` varchar(255) DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, `user_agent` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=33784 DEFAULT CHARSET=latin1 CREATE TABLE `method_timings` ( `id` int(11) NOT NULL AUTO_INCREMENT, `method` varchar(255) DEFAULT NULL, `batch_size` int(11) DEFAULT NULL, `timing` int(11) DEFAULT NULL, `os` varchar(255) DEFAULT NULL, `browser` varchar(255) DEFAULT NULL, `version` varchar(255) DEFAULT NULL, `user_agent` varchar(255) DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=28849 DEFAULT CHARSET=latin1 (user_agent is broken down pre-insert into browser, version, and os from a small list of recognized values using regex; I keep the original user-agent string just in case.) I have a query like this that tells me the average timing for every non-bogus browser / version / method tuple: select c, avg(bogus) as bog, timing, method, browser, version from browser_tests as b inner join ( select count(*) as c, round(avg(timing)) as timing, method, browser, version from method_timings group by browser, version, method having c > 10 order by browser, version, timing ) as t using (browser, version, method) group by browser, version, method having bog < 1 order by browser, version, timing; Which returns something like: c bog tim method browser version 88 0.8333 184 reuse_insert Chrome 4.0.249.89 18 0.0000 238 mass_insert_width Chrome 4.0.249.89 70 0.0400 246 mass_insert Chrome 4.0.249.89 70 0.0400 327 mass_noinsert Chrome 4.0.249.89 88 0.0556 367 reuse_reinsert Chrome 4.0.249.89 88 0.0556 383 jquery Chrome 4.0.249.89 88 0.0556 863 full_reinsert Chrome 4.0.249.89 187 0.0000 105 jquery Chrome 5.0.307.11 187 0.8806 109 reuse_insert Chrome 5.0.307.11 123 0.0000 110 mass_insert_width Chrome 5.0.307.11 176 0.0000 231 mass_noinsert Chrome 5.0.307.11 176 0.0000 237 mass_insert Chrome 5.0.307.11 187 0.0000 314 reuse_reinsert Chrome 5.0.307.11 187 0.0000 372 full_reinsert Chrome 5.0.307.11 12 0.7500 82 reuse_insert Chrome 5.0.335.0 12 0.2500 102 jquery Chrome 5.0.335.0 [...] I want to modify this query to return only the browser/version/method with the lowest timing - i.e. something like: 88 0.8333 184 reuse_insert Chrome 4.0.249.89 187 0.0000 105 jquery Chrome 5.0.307.11 12 0.7500 82 reuse_insert Chrome 5.0.335.0 [...] How can I do this, while still returning the method that goes with that lowest timing? I could filter it app-side, but I'd rather do this in mysql since it'd work better with my caching.

    Read the article

  • How to formulate a SQL Server indexed view that aggregates distinct values?

    - by Jeremy Lew
    I have a schema that includes tables like the following (pseudo schema): TABLE ItemCollection { ItemCollectionId ...etc... } TABLE Item { ItemId, ItemCollectionId, ContributorId } I need to aggregate the number of distinct contributors per ItemCollectionId. This is possible with a query like: SELECT ItemCollectionId, COUNT(DISTINCT ContributorId) FROM Item GROUP BY ItemCollectionId I further want to pre-calculate this aggregation using an indexed (materialized) view. The DISTINCT prevents an index being placed on this view. Is there any way to reformulate this which will not violate SQL Server's indexed view constraints?

    Read the article

  • How to get max of composite data in SQL?

    - by Siddharth Sinha
    SELECT "Name""Month","Year","Value" from Table WHERE "Name" LIKE '%JERRY%' AND "Year" = (SELECT MAX("Year") FROM Table where "Name" LIKE '%JERRY%') AND "Month"= (SELECT MAX("Month") FROM Table where "Name" LIKE '%JERRY%' AND "Year"= (SELECT MAX("Year") FROM Table where "Name" LIKE '%JERRY%')) Table -- Name | Year | Month | Value ----------------------------- JERRY 2012 9 100 JERRY 2012 9 120 JERRY 2012 9 130 JERRY 2012 8 20 JERRY 2011 12 50 So i want the first three rows as output. As for the latest month for the latest year i need all the values. Can someone suggest a better cleaner query?

    Read the article

  • SQL Cluster on Hyper V Failover Cluster

    - by Chris W
    We have a VM running SQL Server on a 6 node cluster of blades. The VM's data files are stored a SAN attached using a direct iSCSI connection. As this SQL server will be running a number of important databases we're debating whether we should be clustering the SQL Server or will the fact that the VM is running in the cluster itself sufficient to give us high availability. I'm used to running SQL clusters when dealing with physical servers but I'm a bit sketchy on what is best practice when all the servers are just VMs sat on Hyper V. If a blade running the VM fails I presume the VM will be started up on another load. I'm guessing the only benefit that adding a SQL cluster to the setup will give us it that the recovery time after a failure will be a little quicker? Are there any other benefits?

    Read the article

  • User Provisioning Tool for SQL Server 2008?

    - by Rob Sanders
    Yesterday I moved my machine from one domain to another - foolishly forgetting the implications for my local instance of SQL Server! Mixed Mode authentication is not enabled, and the only local account login has only "public" permissions. SQL Server 2005 Service Pack 2 had a tool called the User Provisioning Tool for Windows Vista (sqlprov.exe) which allowed you to add Domain Users to a local SQL 2005 instance (it doesn't work against SQL 2008 btw) - my question is.. is there a similar tool for SQL Server 2008 or am I going to have to do a reinstall? Also let me know if you think this belongs on StackOverflow

    Read the article

  • SQL Server 2008 Hardware Recommendation;

    - by Jay
    Hi,I work for a large fortune 500 company. We have several SQL 2005 Servers running on DELL Poweredge 2950 with 8 GB RAM and 4 CPU's. Storage is DMX RAID 10. We are in the process of migrating to sql 2008. We are planning on consolidating multiple sql 2005 into single SQL 2008 Server.If anyone can suggest hardware I would appreciate. We have looked at DELL R710, I was wondering if there are other servers that are good for running SQL 2008. Thanks

    Read the article

  • Unable to connect to local SQL Express (2008)

    - by Will
    I'm trying to get an installation of SQL Express 2008 working, but no matter what I do I can't connect to it with management studio. I've enabled TCP/IP for the instance. I've tried connecting with machinename\instance, .\instance, (local), etc etc etc. Nothing works, and I always get the same message. If I browse for a server, the only server listed is the local integration services, which I can connect to just fine. The SQL server service is running (SQLEXPRESS), SQL Server Agent is not (and won't, can't enable it), and SQL Server Browser is. Anyone have any suggestions on where to go next? I've tried uninstalling EVERYTHING sql and reinstalling, no change.

    Read the article

  • Activity monitor is unable to execute queries against server

    - by mika
    SQL Server Activity Monitor fails with an error dialog: TITLE: Microsoft SQL Server Management Studio The Activity Monitor is unable to execute queries against server [SERVER]. Activity Monitor for this instance will be placed into a paused state. Use the context menu in the overview pane to resume the Activity Monitor. ADDITIONAL INFORMATION: Unable to find SQL Server process ID [PID] on server [SERVER] (Microsoft.SqlServer.Management.ResourceMonitoring) I have this problem on SQL Server 2008 R2 x64 Developer Edition, but I think it is found in all 64bit systems using SQL Server 2008, under some yet unidentified conditions. There is a bug report on this in Microsoft Connect. It seems that the problem is not solved yet.

    Read the article

  • Renaming server - sql 2008 server instance affected

    - by user986363
    Will changing the computer name on which SQL Server 2008 is installed on affect SQL Server in anyway? Or will changing the computer name be transparent to SQL Server? For example: I plan to install Windows 2008 Server and naming it "BobStage". Next I will install SQL Server 2008 R2 and restore a few DB's. Finally I plan to rename the windows machine to "BobLive". Will me renaming the computer's name affect SQL Server's instance ID/name and possibly break something?

    Read the article

  • SQL Server agent died

    - by Manjot
    3 SQL server agents stopped and didn't restart automatically untill we manually restarted them. SQL servers are on SQL 2005 X86 standard edition. The error message that was reported in Application log was: Faulting application sqlagent90.exe, version 2005.90.4211.0, stamp 49837478, faulting module kernel32.dll, version 5.2.3790.4480, stamp 49c51f0a, debug? 0, fault address 0x0000bef7. No errors were reported in SQL server logs or SQl agent logs. Does anyone know what this means? I tried to Google but no luck. Thanks in advance!

    Read the article

  • Execution plan different on two different Sql Servers

    - by Lieven Cardoen
    On our sql server, a query takes 20 ms. If I look at the execution plan, parallelism is used, hash match, Bitmap create, ... a lot of images with two arrows pointing to the left. On sql server of a customer where our product runs, the same query takes 2500 ms. If I look at their execution plan, no parallelism or any of the things with arrows are used... I've been searching for a couple of days no why the query runs so much slower on their sql server. Is parallelism and all of the other things something that can be configured on their sql server? And how to you configure that? What are the dangers of using parallelism? Another strange thing is that on our server, the query needs some 1200 reads and 0 writes. On their sql server it needs 1.5 million reads and some 1500 writes. Why these writes when a read query is done?

    Read the article

  • SQL Server 2008 Optimization

    - by hgulyan
    I've learned today, if you append to your query OPTION (MAXDOP 0) your query will run on multiple processors and if it's huge query, query will perform faster. I know general guidelines on query optimizations (using indexes, selecting only needed fields etc.), my question is about SQL Server optimization. Maybe changing some options in configurations or anything else. What guidelines are there for SQL Server Optimization? Thank you. P.S. I suppose, this is not the right place to ask server related questions. Should I delete it or maybe it can be migrated to serverfault?

    Read the article

  • Accessing SQL Server in Windows XP Mode Virtual Pc

    - by DavidStein
    I have a laptop running 64bit Windows 7 Ultimate. I created a Virtual PC using Microsoft XP Mode. I've installed SQL Server 2000 on the Virtual Machine. I have SQL Server 2008 R2 installed on the Windows 7 machine (laptop). I can browse to the SQL 2000 instance (it sees it), but I cannot successfully connect using either Windows or SQL Server Authentication. I don't get an error, the attempt just times out. I have the Windows XP Mode Firewall turned off, and there doesn't appear to be anything in the Event logs either. Any ideas how I can query the XP Mode SQL Server from the Windows 7 machine?

    Read the article

  • Troubleshooting a high SQL Server Compilation/Batch-Ratio

    - by Sleepless
    I have a SQL Server (quad core x86, 4GB RAM) that constantly has almost the same values for "SQLServer:SQL Statistics: SQL compilations/sec" and "SQLServer:SQL Statistics: SQL batches/sec". This could be interpreted as a server running 100% ad hoc queries, each one of which has to be recompiled, but this is not the case here. The sys.dm_exec_query_stats DMV lists hundreds of query plans with an execution_count much larger than 1. Does anybody have any idea how to interpret / troubleshoot this phenomenon? BTW, the server's general performance counters (CPU,I/O,RAM) all show very modest utilization.

    Read the article

  • Only allow certain processes to connect to MS SQL

    - by Fred
    I've lost the source code for a very old application that connects to a MS SQL-server for some SQL queries. Since the login is hard-coded in the application I can't change the username/password on the server. One day the password will probably be known to the users and we surely need to change it. But how? One idea is to only allow the old application to do the queries on the SQL server and block out any other application like the query analyzer etc. Can I set process permission somehow? The SQL server (MS SQL 2005) and application (C++) are on the same machine It's too costly to rewrite the old program Thanks for help!

    Read the article

  • SQL SERVER AGENT CAN NOT START

    - by Keith Ph?m
    http://imageshack.us/photo/my-images/819/sqlserveragent3.png/ http://imageshack.us/photo/my-images/341/sqlserveragent.png/ I still can not start SQL server agent . When Sql server agent just starts and stop immedietly .I don't know what's happening in the middle .. I already login by the Network Service account in configuration tools and assign member role in msmb database for SQL Server agent. Pls give me an advice I use win 7 ultimate , sql server 2008: Microsoft SQL Server Management Studio 10.0.1600.22 ((SQL_PreRelease).080709-1414 ) Microsoft Data Access Components (MDAC) 6.1.7600.16385 (win7_rtm.090713-1255) Microsoft MSXML 3.0 4.0 5.0 6.0 Microsoft Internet Explorer 9.0.8112.16421 Microsoft .NET Framework 2.0.50727.4971 Operating System 6.1.7600 Thanks

    Read the article

  • Recommended service account setup for MS SQL Server 2005/2008

    - by boxerbucks
    We have a number of MS SQL servers in our environment running either SQL Server 2005 standard/enterprise or SQL server 2008 enterprise. Currently the SQL services are running as local service or network service and the MS recommended best practice is to run as a domain account which is what we are trying to move towards. Is the best practice with regards to domain accounts to have a separate domain account per service per server? So if we have 4 SQL services we want to run per server and we have 50 servers, we would create 50 * 4 = 200 accounts in AD? This seems excessive to me and I was wondering if anyone has any real experience with this type of setup and it's management.

    Read the article

  • Cannot authenticate a domain user with SQL Server 2008

    - by Sambo
    I'm new to setting up Domains so I might be missing something simple here... I've installed SQL Server 2008 on a Windows Server 2008 R2 box and I have another WS2008 R2 box acting as the domain controller. I've joined the SQL server to the domain and it seems to be behaving itself fine. I can ping the DC by name and IP address. I created a domain user 'SPSQLAdmin' that I want to use for database access with SharePoint but I can't seem to log on to SQL with this user. SQL complains, saying that the user belongs to an untrusted domain. I've configured the DC to delegate control for any service to the SQL Server but it doesn't improve the situation. What should I try next? Thanks in advance.

    Read the article

  • SQL server environment

    - by Olegas D
    Hello I'm considering a bit of changes in current sales environment. And trying to check all cons and pros. Current situation. SQL server (quite decent HP server - server1) + backup server (smaller Dell server - server2). all sql files and sql server itself are on the server1. If something goes wrong with server1 I will have to manually move to server2. Connecting to the sql server: 1 HQ (where server located) + 4 sites through VPN. Now I'm considering 2 scenarios: Buy some storage system + update existing servers (add ram, upgrade processors) and go for VMWare ESXI. Rent a server at a datacenter + rent virtual server in case real server goes down. Also rent some space at data storage to keep SQL files there. Have anyone considered these things and maybe found some good pros/cons list? ;) Thanks

    Read the article

  • Error when I try to connect to a SQL Server 2005 from the internet

    - by Manish
    My SQL Server is on a local machine. I want to access it through internet. I created a website through I want to connect local SQL Server 2005. This is the error message: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) Thanks for a reply!

    Read the article

< Previous Page | 158 159 160 161 162 163 164 165 166 167 168 169  | Next Page >