Search Results

Search found 22901 results on 917 pages for 'query bug'.

Page 43/917 | < Previous Page | 39 40 41 42 43 44 45 46 47 48 49 50  | Next Page >

  • MDX: Problem filtering results in MDX query used in Reporting Services query

    - by wgpubs
    Why aren't my results being filtered by the members from my [Group Hierarchy] returned via the filter() statment below? SELECT NON EMPTY {[Measures].[Group Count], [Measures].[Overall Group Count] } ON COLUMNS, NON EMPTY { [Survey].[Surveys By Year].[Survey Year].ALLMEMBERS * [Response Status].[Response Status].[Response Status].ALLMEMBERS} DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM ( SELECT ( { [Survey Type].[Survey Type Hierarchy].&[9] } ) ON COLUMNS FROM ( SELECT ( { [Response Status].[Response Status].[All] } ) ON COLUMNS FROM ( SELECT ( STRTOSET(@SurveySurveysByYear, CONSTRAINED) ) ON COLUMNS FROM ( SELECT(filter([Group].[Group Hierarchy].members, instr(@GroupGroupFullName,[Group].[Group Hierarchy].Properties( "Group Full Name" )))) on columns FROM [SysSurveyDW])))) CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS

    Read the article

  • Variable in one query is getting into another query in view

    - by Jason Shultz
    I have two foreach statements. The variable from one one is somehow getting into another and i'm not sure how to fix it. Here's my controller: // Categories Page Code function categories($id) { $this->load->model('Business_model'); $data['businessList'] = $this->Business_model->categoryPageList($id); $data['catList'] = $this->Business_model->categoryList(); $data['featured'] = $this->Business_model->frontPageList(); $data['user_id'] = $this->tank_auth->get_user_id(); $data['username'] = $this->tank_auth->get_username(); $data['page_title'] = 'Welcome To Jerome - Largest Ghost Town in America'; $data['page'] = 'category_view'; // pass the actual view to use as a parameter $this->load->view('container',$data); } What happens is categories will only show the businesses in a certain category. The businesses are pulled from the database using the categoryPageList($id) function. Here is that function: function categoryPageList($id) { $this->db->select('b.id, b.busname, b.busowner, b.webaddress, p.thumb, v.title, c.catname, s.specname, p.thumb, c.id'); $this->db->from ('business AS b'); $this->db->where('b.category', $id); $this->db->join('photos AS p', 'p.busid = b.id', 'left'); $this->db->join('video AS v', 'v.busid = b.id', 'left'); $this->db->join('specials AS s', 's.busid = b.id', 'left'); $this->db->join('category As c', 'b.category = c.id', 'left'); $this->db->group_by("b.id"); return $this->db->get(); } And here is the view: <h2>Welcome to Jerome, Arizona</h2> <p>Choose the Category of Business you are interested in:<br/> <?php foreach ($catList->result() as $row): ?> <a href="/site/categories/<?=$row->id?>"><?=$row->catname?></a>, &nbsp; <?php endforeach; ?></p> <table id="businessTable" class="tablesorter"> <thead><tr><th>Business Name</th><th>Business Owner</th><th>Web</th><th>Photos</th><th>Videos</th><th>Specials</th></tr></thead> <?php if(count($businessList) > 0) : foreach ($businessList->result() as $crow): ?> <tr> <td><a href="/site/business/<?=$crow->id?>"><?=$crow->busname?></a></td> <td><?=$crow->busowner?></td> <td><a href="<?=$crow->webaddress?>">Visit Site</a></td> <td> <?php if(isset($crow->thumb)):?> yes <?php else:?> no <?php endif?> </td> <td> <?php if(isset($crow->title)):?> yes <?php else:?> no <?php endif?> </td> <td> <?php if(isset($crow->specname)):?> yes <?php else:?> no <?php endif?> </td> </tr> <?php endforeach; ?> <?php else : ?> <td colspan="4"><p>No Category Selected</p></td> <?php endif; ?> </table> The problem occurs here. <?=$crow->id?> should be showing the row id from the business table. Instead, it's showing the row ID of the category table. so, if i'm viewing /site/categories/6 <?=$crow->id?> will show 6 when it should be showing 10 (the row ID of the only business in that category at this time. How can I fix this?

    Read the article

  • Underline ie6-bug. Inline element in <a> tag.

    - by kalininew
    There is a markup: <a href="#"> lorem ipsum<span>15</span> </a> There are styles: a{ text-decoration: underline; } a span{ background: #fff; //To clean the bottom underlining under <span> } Works in all interesting me browsers. Except IE6. The bottom underlining under <span> remains. How to solve this problem without changing a markup.

    Read the article

  • How to create a UDF that takes a query string and returns the query's resultset

    - by Martin
    I want to create a stored procedure that takes a simple SELECT statement and return the resultset as a CSV string. So the basic idea is get the sql statement from user input, run it using EXEC(@stmt) and convert the resultset to text using cursors. However, as SQLServer doesn't allow: select * from storedprocedure(@sqlStmt) UDF with EXEC(@sqlStmt) so I tried Insert into #tempTable EXEC(@sqlStmt), but this doesn't work (error = "invalid object name #tempTable"). I'm stuck. Could you please shed some light on this matter? Many thanks EDIT: Actually the output (e.g CSV string) is not important. The problem is I don't know how to assign a cursor to the resultset returned by EXEC. SP and UDF do not work with Exec() while creating a temp table before inserting values is impossible without knowing the input statement. I thought of OPENQUERY but it does not accept variables as its parameters.

    Read the article

  • What should I do or don't do to avoid Delphi "push dword" bug.

    - by Maksee
    I found that Delphi 5 generates invalid assembly code in specific cases. I can't understand in what cases in general. The example below produces access violation since a very strange optimization occurs. For a byte in a record or array Delphi generates push dword [...], pop ebx, mov .., bl that works correctly if there are data after this byte (we need at least three to push dword correctly), but fails if the data is inaccessible. I emulated the strict boundaries here with win32 Virtual* functions Specifically the error occurs when the last byte from the block accessed inside FeedBytesToClass procedure. And if I try to change something like using data array instead of object property of remove actionFlag variable, Delphi generates correct assembly instructions. const BlockSize = 4096; type TSomeClass = class private fBytes: PByteArray; public property Bytes: PByteArray read fBytes; constructor Create; destructor Destroy;override; end; constructor TSomeClass.Create; begin inherited Create; GetMem(fBytes, BlockSize); end; destructor TSomeClass.Destroy; begin FreeMem(fBytes); inherited; end; procedure FeedBytesToClass(SrcDataBytes: PByteArray; Count: integer); var j: integer; Ofs: integer; actionFlag: boolean; AClass: TSomeClass; begin AClass:=TSomeClass.Create; try actionFlag:=true; for j:=0 to Count-1 do begin Ofs:=j; if actionFlag then begin AClass.Bytes[Ofs]:=SrcDataBytes[j]; end; end; finally AClass.Free; end; end; procedure TForm31.Button1Click(Sender: TObject); var SrcDataBytes: PByteArray; begin SrcDataBytes:=VirtualAlloc(Nil, BlockSize, MEM_COMMIT, PAGE_READWRITE); try if VirtualLock(SrcDataBytes, BlockSize) then try FeedBytesToClass(SrcDataBytes, BlockSize); finally VirtualUnLock(SrcDataBytes, BlockSize); end; finally VirtualFree(SrcDataBytes, MEM_DECOMMIT, BlockSize); end; end; Initially the error occured when I used access to RGB data of bitmap bits, but the code there is too complex so I narrowed it to this fragment. So the question is what is here so specific that makes Delphi produce push,pop,mov optimization. I need to know this in order to avoid such side effects in general.

    Read the article

  • Does Eclipse Ganymede have a mouse-click bug in the Navigator view?

    - by Brian Deacon
    I've had to downgrade from Galileo to Ganymede in order to use the version of the FlexBuilder plugin that we are licensed for. Since the downgrade, I have several times accidentally dragged files or entire folders from one part of my project into another (or even into another project). I blamed this on fatfingers the first couple times, but I just now watched it do it to me on what I definitely know to have been a single left click on the folder that the file ended up moving to. Does anybody know if this is a known issue with Ganymede?

    Read the article

  • LINQ Query using UDF that receives parameters from the query

    - by Ben Fidge
    I need help using a UDF in a LINQ which calculates a users position from a fixed point. int pointX = 567, int pointY = 534; // random points on a square grid var q = from n in _context.Users join m in _context.GetUserDistance(n.posY, n.posY, pointX, pointY, n.UserId) on n.UserId equals m.UserId select new User() { PosX = n.PosX, PosY = n.PosY, Distance = m.Distance, Name = n.Name, UserId = n.UserId }; The GetUserDistance is just a UDF that returns a single row in a TVP with that users distance from the points deisgnated in pointX and pointY variables, and the designer generates the following for it: [global::System.Data.Linq.Mapping.FunctionAttribute(Name="dbo.GetUserDistance", IsComposable=true)] public IQueryable<GetUserDistanceResult> GetUserDistance([global::System.Data.Linq.Mapping.ParameterAttribute(Name="X1", DbType="Int")] System.Nullable<int> x1, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="X2", DbType="Int")] System.Nullable<int> x2, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="Y1", DbType="Int")] System.Nullable<int> y1, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="Y2", DbType="Int")] System.Nullable<int> y2, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="UserId", DbType="Int")] System.Nullable<int> userId) { return this.CreateMethodCallQuery<GetUserDistanceResult>(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), x1, x2, y1, y2, userId); } when i try to compile i get The name 'n' does not exist in the current context

    Read the article

  • div "top" bug IE and everything else. Big problem

    - by Victor
    Hi everyone. I am new in CSS so please help me in this problem. I hope to describe it wright. I am making div named content where my site content is. I made it with z-index:-1; so an image to be over this div. But in Chrome, FF and safari, content became inactive. I cant select text , click on link and write in the forms. So I tried with positive states in the z-index but IE don't know what this means. Damn. So I decided to make conditional div. Here is the code: .content { background:#FFF; width:990px; position:relative; float:left; top:50px; } .content_IE { background:#FFF; width:990px; position:relative; float:left; top: 50px; z-index:-1; } and here is the HTML: <!--[if IE 7]> <div class="content_IE" style="height:750px;"> <![endif]--> <div class="content" style="height:550px;"> Everything is fine with the z-index but the problem is that if there is no top in .content class everything looks fine in IE but there is no space in the other browsers. If i put back the top:50px; there onother 50px like padding in the .content_IE class. I mean that the page looks like I've put top:50px; and padding-top=50px;. I've try everything like margin-top:-50px; padding-top:-50px; and stuff like this but I am still in the circle. It look fine only if there is no top option in .content class. Please help.

    Read the article

  • Python instances and attributes: is this a bug or i got it totally wrong?

    - by Mirko Rossini
    Suppose you have something like this: class intlist: def __init__(self,l = []): self.l = l def add(self,a): self.l.append(a) def appender(a): obj = intlist() obj.add(a) print obj.l if __name__ == "__main__": for i in range(5): appender(i) A function creates an instance of intlist and calls on this fresh instance the method append on the instance attribute l. How comes the output of this code is: [0] [0, 1] [0, 1, 2] [0, 1, 2, 3] [0, 1, 2, 3, 4] ? If i switch obj = intlist() with obj = intlist(l=[]) I get the desired output [0] [1] [2] [3] [4] Why this happens? Thanks

    Read the article

  • How do I get developers to look at our bug tracking page regularly?

    - by abeger
    We've recently started using Trac and are still trying to figure out the best way to use it in our environment. It's great, but it will only be effective if developers look at it once in a while and I'm trying to figure out how to instill that habit in them. I've contemplated several solutions, such as: forcing them to use Trac as their homepage (too draconian) handing out bookmarks to the RSS feeds (same problem--no one will look at them) automatic email notifications (won't drive them to the site and might just annoy them more than anything else) What are some other solutions? What have you tried that worked?

    Read the article

  • is it some bug in firefox or jquery or i doing something wrong?

    - by llamerr
    I want to change hidden input value on div click, so i do following: $('#gallery').click(function(){ if ($('input[name=isgallery]').attr('value') == '0') { $('input[name=isgallery]').attr('value', '1') } else { $('input[name=isgallery]').attr('value', '0') } $('#filterform').attr('action',$('#filterform').attr('act')); alert('ok'); $('#filterform').submit(); } ); when it equals 0 i change it to 1 and otherwise but it did not work and following code works: $('#gallery').click(function(){ if ($('input[name=isgallery]').attr('value') == '0') { $('input[name=isgallery]').attr('value', '0') } else { $('input[name=isgallery]').attr('value', '1') } $('#filterform').attr('action',$('#filterform').attr('act')); alert('ok'); $('#filterform').submit(); } ); and also, when i delete the function at all it still works and form submits maybe i have one more handler for this div, but i can't find one you can check it on http://www.4block.org/en/museum/posters and click "gallery view" on top-right

    Read the article

  • Filtering SQLAlchemy query on attribute_mapped_collection field of relationship

    - by bsa
    I have two classes, Tag and Hardware, defined with a simple parent-child relationship (see the full definition at the end). Now I want to filter a query on Tag using the version field in Hardware through an attribute_mapped_collection, eg: def get_tags(order_code=None, hardware_filters=None): session = Session() query = session.query(Tag) if order_code: query = query.filter(Tag.order_code == order_code) if hardware_filters: for k, v in hardware_filters.iteritems(): query = query.filter(getattr(Tag.hardware, k).version == v) return query.all() But I get: AttributeError: Neither 'InstrumentedAttribute' object nor 'Comparator' object associated with Tag.hardware has an attribute 'baseband The same thing happens if I strip it back by hard-coding the attribute, eg: query.filter(Tag.hardware.baseband.version == v) I can do it this way: query = query.filter(Tag.hardware.any(artefact=k, version=v)) But why can't I filter directly through the attribute? Class definitions class Tag(Base): __tablename__ = 'tag' tag_id = Column(Integer, primary_key=True) order_code = Column(String, nullable=False) version = Column(String, nullable=False) status = Column(String, nullable=False) comments = Column(String) hardware = relationship( "Hardware", backref="tag", collection_class=attribute_mapped_collection('artefact'), ) __table_args__ = ( UniqueConstraint('order_code', 'version'), ) class Hardware(Base): __tablename__ = 'hardware' hardware_id = Column(Integer, primary_key=True) tag_id = Column(String, ForeignKey('tag.tag_id')) product_id = Column(String, nullable=True) artefact = Column(String, nullable=False) version = Column(String, nullable=False)

    Read the article

  • Boot failure randomly. Can someone help?

    - by desgua
    I often get stuck at the boot on battery. I can suspend and hibernate without any trouble (even on battery). If I plug the energy cable everything goes right most of the time (edited June 13). Adding "acpi=off" doesn't solve the issue. Disabling power save from LAN at BIOS doesn't solve this too. Memory test seems to be ok: I can even compile a kernel without a problem: Has someone a tip for this? (I have the same questions marks in my mind as the image shows if not more :-/ ) obs.: this is an upgraded installation from Natty alpha. edited I (May 22): I've installed a brand new final 11.04 and got the bug again. edited II (June 13): I thought it was solved but it is not. After spending eight days off, the same problem happened even with the power cable connected. I had to reboot about 6 times until success. edited III (June 14): I can boot (even with battery) if I disconnect the cable and take off the battery for a few seconds. This lead me to conclude that maybe something is kept into memory of some hardware. Maybe or maybe not related but I also have touchpad issues (jumps) with this machine. edited IV (June 25): I opened gconf-editor and went to apps gnome-power-manager and disabled everything possibly related to suspend or hibernate. No help. Also I grabbed a Fedora live usb pendrive and got the same problem: So I think it is a hardware problem related issue.

    Read the article

  • Good bug tracking with Sharepoint?

    - by torbengb
    At my place of work, it has been decided to move many processes to Sharepoint. I'm now looking into how Sharepoint can be used for bug tracking (à la Mantis, FogBugz etc. but within Sharepoint). Specifically, we're using a collaboration room and the solution must work inside that. I know that I can create lists using an "Issue tracker" template, but it lacks workflow, integrated correspondence (like FogBugz), and audit log (any user can edit any field any time, without it being noted anywhere). That's not sufficient, so I am looking for "bigger" solutions but haven't yet found anything at all. This question is similar but aims at Helpdesk use; we aim at bug tracking and change requests to a system. I'm open to suggestions! As I'm not an administrator, I can't just grab a Sharepoint component and install it for testing. I'm looking for experiences, documentation, white papers, screen shots -- the actual downloadable will be relevant later. Ideally, some of these matters should be covered: Support for different ticket types (bug, feature, inquiry, internal task). Configurable workflow per ticket type, no fixed number of steps. Configurable read/write permissions per field and per workflow status. Configurable dashboard for managers with nice charts. Configurable email notifications. Correspondence à la FogBugz. (Challenge: we use Notes, not Exchange.)

    Read the article

  • SpamAssassin 2010 Bug still active on my mailserver despite the offending rule being fixed - where t

    - by Ibrahim
    The SpamAssassin 2010 bug was supposed to be fixed not long after the bug became widely known, and indeed the offending rule in my /usr/share/spamassassin/72_active.cf has been updated. However, incoming messages are still being tagged by this eg: X-Spam-Status: No, score=3.188 tagged_above=-999 required=6.31 tests=[BAYES_50=0.001, FH_DATE_PAST_20XX=3.188, SPF_PASS=-0.001] Here is the relevant rule: ##{ FH_DATE_PAST_20XX header FH_DATE_PAST_20XX Date =~ /20[2-9][0-9]/ [if-unset: 2006] describe FH_DATE_PAST_20XX The date is grossly in the future. ##} FH_DATE_PAST_20XX I'm on spamassassin/3.2.5-2+lenny1.1~volatile1 on Debian Lenny, completely up to date. Any pointers on where to look to figure out what's going on? I don't know anything about SpamAssassin; someone else usually manages this but I'm free right now and am trying to figure out what the problem is because it's been annoying us for a while and we only just realized this bug was still affecting us. Update: I've lowered the score for the FH_DATE_PAST20XX rule to 0.1, both in /etc/spamassassin/local.cf and /usr/share/spamassassin/50_scores.cf and it's still giving 3.188 points for this rule. Any idea what's going on? This really has me stumped. Update 2: It seems that after restarting amavisd, it's been fixed. What's the difference between amavisd and spamd? It seems like both should not be running, or something.

    Read the article

  • SpamAssassin 2010 Bug still active on my mailserver despite the offending rule being fixed - where t

    - by Ibrahim
    The SpamAssassin 2010 bug was supposed to be fixed not long after the bug became widely known, and indeed the offending rule in my /usr/share/spamassassin/72_active.cf has been updated. However, incoming messages are still being tagged by this eg: X-Spam-Status: No, score=3.188 tagged_above=-999 required=6.31 tests=[BAYES_50=0.001, FH_DATE_PAST_20XX=3.188, SPF_PASS=-0.001] Here is the relevant rule: ##{ FH_DATE_PAST_20XX header FH_DATE_PAST_20XX Date =~ /20[2-9][0-9]/ [if-unset: 2006] describe FH_DATE_PAST_20XX The date is grossly in the future. ##} FH_DATE_PAST_20XX I'm on spamassassin/3.2.5-2+lenny1.1~volatile1 on Debian Lenny, completely up to date. Any pointers on where to look to figure out what's going on? I don't know anything about SpamAssassin; someone else usually manages this but I'm free right now and am trying to figure out what the problem is because it's been annoying us for a while and we only just realized this bug was still affecting us. Update: I've lowered the score for the FH_DATE_PAST20XX rule to 0.1, both in /etc/spamassassin/local.cf and /usr/share/spamassassin/50_scores.cf and it's still giving 3.188 points for this rule. Any idea what's going on? This really has me stumped. Update 2: It seems that after restarting amavisd, it's been fixed. What's the difference between amavisd and spamd? It seems like both should not be running, or something.

    Read the article

  • Clipboard bug in Wordpad in Windows 7 (accidentally pasting large file into application)

    - by frenchglen
    In Win7, I use Wordpad, and I really like it. For my needs it's lean and fast, yet has the formatting functionalities I'm after when working on my TXT/RTF files on a daily basis. I don't intend to change text editors. There's a really bad bug which has ALWAYS plagued me. If you have a large file contained in the clipboard, like a 238MB FLAC file, and you accidentally paste it into Wordpad for whatever reason - it hangs the application for a VERY long time (like 2 hours, it depends on how big the file is, because it tries to 'handle' it). You either have to close the application and lose any unsaved changes, or go do something else until the item has finished pasting into Wordpad (it actually eventually drops the file's icon in wordpad just like how it appears in Windows Explorer). It's a Windows bug, a Wordpad bug. Is there some solution for this? Or is the problem fixed in Windows 8 (if anyone can tell me)? .....I'm not going to try out Win8 myself, merely to answer this question - that's what I'm asking it on SuperUSer for! I'm really hoping it's one of those little-yet-big things that they've fixed in Win8 (like removing the 255-character file path limit in Explorer, which is awesome). Thank you for your help, if you have Win8 handy and can test this. :)

    Read the article

  • Strange focus bug in Firefox (chrome vs content)

    - by Marius
    Here is a strange bug I'm experiencing in Firefox: I can only use either the chrome, or the content, not both at the same time! For example, I can click on tabs and the toolbar icons, focus the search bar and write in it as well as the address bar, but if I try to click on anything in the content (eg a link or a textfield to write something), then nothing happens. The mouse pointer doesn't change either, it just stays a pointer when I hover over things, and the links I hover don't react either. But if I alt-tab to another program (or click on it in the taskbar), then back to Firefox, then I can use the area that I click on. So if I click somewhere on the webpage to get focus back to Firefox, then I can click on links and write things (like this text), but I cannot click on tabs or refresh or anything else in the chrome. I can't even click on the minimize, restore and close icons! To get focus back on the chrome I have to alt-tab to another program, and then click on the chrome to get back to Firefox to be able to use the chrome again. I've tried closing and starting it again, but the bug is still there. I have experienced this before, but I don't remember what I did to fix it. This bug seems to occur sometimes when I wake up the computer from standby, but I leave by computer in standby all the time, so that is not the only factor.

    Read the article

  • SQL SERVER – What is Spatial Database? – Developing with SQL Server Spatial and Deep Dive into Spati

    - by pinaldave
    What is Spatial Database? A spatial database is a database that is optimized to store and query data related to objects in space, including points, lines and polygons. While typical databases can understand various numeric and character types of data, additional functionality needs to be added for databases to process spatial data types. (Source: Wikipedia) Today I will be talking about the same subject at Microsoft TechEd India. If you want to learn about how to spatial aspect of data and how to integrate them with SQL Server this is the perfect session for you. Spatial is very special concept of SQL Server and I really like how it is implemented in SQL Server. In general Performance Tuning and Query Optimization is something I always have enjoyed in my professional life. Index are my best friends and many time, by implementing and many time by removing I have improved the performance of the system. In this session, I will be talking about Index along with Spatial Data. As Spatial Database is very interesting concept, I will cover super short but very interesting 10 quick slides about this subject. I will make sure in very first 20 mins, you will understand following topics Introduction to Spatial Database One line definition Understanding Spatial Indexing Index Internals Query/Performance Tuning Query Hinting/Cost Analysis Spatial Index Catalog Views Performance Troubleshooting Finding Optimal Index using Spatial Index SP Common Errors Index Maintenance This slides decks will be followed by around 30 mins demo which will have story of geometry, geography, index internals and performance tuning. If you are interested in learning how GIS works and how SQL Server out of the box supports this wonderful tools, you will really like how the story is told. I am sure all people who attend the event will know how the Bangalore is positioned on the map of India. I will take example of Bangalore and Hyderabad and demonstrate how index can improve the performance. Well there are lots of story to tell in the session, and I will be opening this session with the beautiful script of Botticelli’s Birth of Venus created by Michael J. Swart. I will also demonstrate few real life scenario where I will be talking about Spatial Database and its usage. Do not miss this session. At the end of session there will be book awarded to best participant. My session details: Session 3: Developing with SQL Server Spatial and Deep Dive into Spatial Indexing Date: April 14, 2010 Time: 5:00pm-6:00pm Microsoft SQL Server 2008 delivers new spatial data types that enable you to consume, use, and extend location-based data through spatial-enabled applications. Attend this session to learn how to use spatial functionality in next version of SQL Server to build and optimize spatial queries. This session outlines the new geography data type to store geodetic spatial data and perform operations on it, use the new geometry data type to store planar spatial data and perform operations on it, take advantage of new spatial indexes for high performance queries, use the new spatial results tab to quickly and easily view spatial query results directly from within Management Studio, extend spatial data capabilities by building or integrating location-enabled applications through support for spatial standards and specifications and much more. Reference: Pinal Dave (http://blog.SQLAuthority.com) Filed under: Pinal Dave, SQL, SQL Authority, SQL Index, SQL Optimization, SQL Performance, SQL Query, SQL Server, SQL Tips and Tricks, SQLAuthority Author Visit, T SQL, Technology Tagged: Spatial Database

    Read the article

  • SQL SERVER – SOS_SCHEDULER_YIELD – Wait Type – Day 8 of 28

    - by pinaldave
    This is a very interesting wait type and quite often seen as one of the top wait types. Let us discuss this today. From Book On-Line: Occurs when a task voluntarily yields the scheduler for other tasks to execute. During this wait the task is waiting for its quantum to be renewed. SOS_SCHEDULER_YIELD Explanation: SQL Server has multiple threads, and the basic working methodology for SQL Server is that SQL Server does not let any “runnable” thread to starve. Now let us assume SQL Server OS is very busy running threads on all the scheduler. There are always new threads coming up which are ready to run (in other words, runnable). Thread management of the SQL Server is decided by SQL Server and not the operating system. SQL Server runs on non-preemptive mode most of the time, meaning the threads are co-operative and can let other threads to run from time to time by yielding itself. When any thread yields itself for another thread, it creates this wait. If there are more threads, it clearly indicates that the CPU is under pressure. You can fun the following DMV to see how many runnable task counts there are in your system. SELECT scheduler_id, current_tasks_count, runnable_tasks_count, work_queue_count, pending_disk_io_count FROM sys.dm_os_schedulers WHERE scheduler_id < 255 GO If you notice a two-digit number in runnable_tasks_count continuously for long time (not once in a while), you will know that there is CPU pressure. The two-digit number is usually considered as a bad thing; you can read the description of the above DMV over here. Additionally, there are several other counters (%Processor Time and other processor related counters), through which you can refer to so you can validate CPU pressure along with the method explained above. Reducing SOS_SCHEDULER_YIELD wait: This is the trickiest part of this procedure. As discussed, this particular wait type relates to CPU pressure. Increasing more CPU is the solution in simple terms; however, it is not easy to implement this solution. There are other things that you can consider when this wait type is very high. Here is the query where you can find the most expensive query related to CPU from the cache Note: The query that used lots of resources but is not cached will not be caught here. SELECT SUBSTRING(qt.TEXT, (qs.statement_start_offset/2)+1, ((CASE qs.statement_end_offset WHEN -1 THEN DATALENGTH(qt.TEXT) ELSE qs.statement_end_offset END - qs.statement_start_offset)/2)+1), qs.execution_count, qs.total_logical_reads, qs.last_logical_reads, qs.total_logical_writes, qs.last_logical_writes, qs.total_worker_time, qs.last_worker_time, qs.total_elapsed_time/1000000 total_elapsed_time_in_S, qs.last_elapsed_time/1000000 last_elapsed_time_in_S, qs.last_execution_time, qp.query_plan FROM sys.dm_exec_query_stats qs CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) qt CROSS APPLY sys.dm_exec_query_plan(qs.plan_handle) qp ORDER BY qs.total_worker_time DESC -- CPU time You can find the most expensive queries that are utilizing lots of CPU (from the cache) and you can tune them accordingly. Moreover, you can find the longest running query and attempt to tune them if there is any processor offending code. Additionally, pay attention to total_worker_time because if that is also consistently higher, then  the CPU under too much pressure. You can also check perfmon counters of compilations as they tend to use good amount of CPU. Index rebuild is also a CPU intensive process but we should consider that main cause for this query because that is indeed needed on high transactions OLTP system utilized to reduce fragmentations. Note: The information presented here is from my experience and there is no way that I claim it to be accurate. I suggest reading Book OnLine for further clarification. All of the discussions of Wait Stats in this blog is generic and varies from system to system. It is recommended that you test this on a development server before implementing it to a production server. Reference: Pinal Dave (http://blog.SQLAuthority.com) Filed under: Pinal Dave, PostADay, SQL, SQL Authority, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, SQL Wait Stats, SQL Wait Types, T SQL, Technology

    Read the article

  • SQL SERVER – Error: Fix – Msg 208 – Invalid object name ‘dbo.backupset’ – Invalid object name ‘dbo.backupfile’

    - by pinaldave
    Just a day before I got a very interesting email. Here is the email (modified a bit to make it relevant to this blog post). “Pinal, We are facing a very strange issue. One of our query  related to backup files and backup set has stopped working suddenly in SSMS. It works fine in application where we have and in the stored procedure but when we have it in our SSMS it gives following error. Msg 208, Level 16, State 1, Line 1 Invalid object name ‘dbo.backupfile’. Here are our queries which we are trying to execute. SELECT name, database_name, backup_size, TYPE, compatibility_level, backup_set_id FROM dbo.backupset; SELECT logical_name, backup_size, file_type FROM dbo.backupfile; This query gives us details related to backupset and backup files when the backup was taken.” When I receive this kind of email, usually I have no answers directly. The claim that it works in stored procedure and in application but not in SSMS gives me no real data. I have requested him to very first check following two things: If he is connected to correct server? His answer was yes. If he has enough permissions? His answer was he was logged in as an admin. This means there was something more to it and I requested him to send me a screenshot of the his SSMS. He promptly sends that to me and as soon as I receive the screen shot I knew what was going on. Before I say anything take a look at the screenshot yourself and see if you can figure out why his queries are not working in SSMS. Just to make your life a bit easy, I have already given a hint in the image. The answer is very simple, the context of the database is master database. To execute above two queries the context of the database has to be msdb. Tables backupset and backupfile belong to the database msdb only. Here are two workaround or solution to above problem: 1) Change context to MSDB Above two queries when they will run as following they will not error out and will give the accurate desired result. USE msdb GO SELECT name, database_name, backup_size, TYPE, compatibility_level, backup_set_id FROM dbo.backupset; SELECT logical_name, backup_size, file_type FROM dbo.backupfile; 2) Prefix the query with msdb There are cases above script used in stored procedure or part of big query, it is not possible to change the context of the whole query to any specific database. Use three part naming convention and prefix them with msdb. SELECT name, database_name, backup_size, TYPE, compatibility_level, backup_set_id FROM msdb.dbo.backupset; SELECT logical_name, backup_size, file_type FROM msdb.dbo.backupfile; Very simple solution but sometime keeps people wondering for an answer. Reference: Pinal Dave (http://blog.sqlauthority.com) Filed under: PostADay, SQL, SQL Authority, SQL Error Messages, SQL Query, SQL Server, SQL Tips and Tricks, T SQL, Technology

    Read the article

  • SQL SERVER – Data Pages in Buffer Pool – Data Stored in Memory Cache

    - by pinaldave
    This will drop all the clean buffers so we will be able to start again from there. Now, run the following script and check the execution plan of the query. Have you ever wondered what types of data are there in your cache? During SQL Server Trainings, I am usually asked if there is any way one can know how much data in a table is stored in the memory cache? The more detailed question I usually get is if there are multiple indexes on table (and used in a query), were the data of the single table stored multiple times in the memory cache or only for a single time? Here is a query you can run to figure out what kind of data is stored in the cache. USE AdventureWorks GO SELECT COUNT(*) AS cached_pages_count, name AS BaseTableName, IndexName, IndexTypeDesc FROM sys.dm_os_buffer_descriptors AS bd INNER JOIN ( SELECT s_obj.name, s_obj.index_id, s_obj.allocation_unit_id, s_obj.OBJECT_ID, i.name IndexName, i.type_desc IndexTypeDesc FROM ( SELECT OBJECT_NAME(OBJECT_ID) AS name, index_id ,allocation_unit_id, OBJECT_ID FROM sys.allocation_units AS au INNER JOIN sys.partitions AS p ON au.container_id = p.hobt_id AND (au.type = 1 OR au.type = 3) UNION ALL SELECT OBJECT_NAME(OBJECT_ID) AS name, index_id, allocation_unit_id, OBJECT_ID FROM sys.allocation_units AS au INNER JOIN sys.partitions AS p ON au.container_id = p.partition_id AND au.type = 2 ) AS s_obj LEFT JOIN sys.indexes i ON i.index_id = s_obj.index_id AND i.OBJECT_ID = s_obj.OBJECT_ID ) AS obj ON bd.allocation_unit_id = obj.allocation_unit_id WHERE database_id = DB_ID() GROUP BY name, index_id, IndexName, IndexTypeDesc ORDER BY cached_pages_count DESC; GO Now let us run the query above and observe the output of the same. We can see in the above query that there are four columns. Cached_Pages_Count lists the pages cached in the memory. BaseTableName lists the original base table from which data pages are cached. IndexName lists the name of the index from which pages are cached. IndexTypeDesc lists the type of index. Now, let us do one more experience here. Please note that you should not run this test on a production server as it can extremely reduce the performance of the database. DBCC DROPCLEANBUFFERS This will drop all the clean buffers and we will be able to start again from there. Now run following script and check the execution plan for the same. USE AdventureWorks GO SELECT UnitPrice, ModifiedDate FROM Sales.SalesOrderDetail WHERE SalesOrderDetailID BETWEEN 1 AND 100 GO The execution plans contain the usage of two different indexes. Now, let us run the script that checks the pages cached in SQL Server. It will give us the following output. It is clear from the Resultset that when more than one index is used, datapages related to both or all of the indexes are stored in Memory Cache separately. Let me know what you think of this article. I had a great pleasure while writing this article because I was able to write on this subject, which I like the most. In the next article, we will exactly see what data are cached and those that are not cached, using a few undocumented commands. Reference: Pinal Dave (http://blog.SQLAuthority.com) Filed under: DMV, Pinal Dave, SQL, SQL Authority, SQL Optimization, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, T SQL, Technology Tagged: SQL DMV

    Read the article

< Previous Page | 39 40 41 42 43 44 45 46 47 48 49 50  | Next Page >