Search Results

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

Page 47/1481 | < Previous Page | 43 44 45 46 47 48 49 50 51 52 53 54  | Next Page >

  • Composite primary keys in N-M relation or not?

    - by BerggreenDK
    Lets say we have 3 tables (actually I have 2 at the moment, but this example might illustrate the thought better): [Person] ID: int, primary key Name: nvarchar(xx) [Group] ID: int, primary key Name: nvarchar(xx) [Role] ID: int, primary key Name: nvarchar(xx) [PersonGroupRole] Person_ID: int, PRIMARY COMPOSITE OR NOT? Group_ID: int, PRIMARY COMPOSITE OR NOT? Role_ID: int, PRIMARY COMPOSITE OR NOT? Should any of the 3 ID's in the relation PersonGroupRole be marked as PRIMARY key or should they all 3 be combined into one composite?? whats the real benefit of doing it or not? I can join anyways as far as I know, so Person JOIN PersonGroupRole JOIN Group gives me which persons are in which Groups etc. I will be using LINQ/C#/.NET on top of SQL-express and SQL-server, so if there is any reasons regarding language/SQL that might make the choice more clear, thats the platform I ask about. Looking forward to see what answers pops up, as I have thought of these primary keys/indexes many times when making combined ones.

    Read the article

  • SQL Server connection help...

    - by Gopal
    Using SQL Server 2005 I have the server connection name as (server1) in windows authentication mode, I want to change windows authentication mode to sql server authentication mode... when i try to change sql server authentication mode with username = sa & password = sa, it showing error... How to change the authentication mode or how to create a new sql connection?

    Read the article

  • Performance tune my sql query removing OR statements

    - by SmartestVEGA
    I need to performance tune following SQL query by removing "OR" statements Please help ... SELECT a.id, a.fileType, a.uploadTime, a.filename, a.userId, a.CID, ui.username, company.name companyName, a.screenName FROM TM_transactionLog a, TM_userInfo ui, TM_company company, TM_airlineCompany ac WHERE ( a.CID = 3049 ) OR ( a.CID = company.ID AND ac.SERVICECID = 3049 AND company.SPECIFICCID = ac.ID ) OR ( a.USERID = ui.ID AND ui.CID = 3049 );

    Read the article

  • Recursive COUNT Query (SQL Server)

    - by Cosmo
    Hello Guys! I've two MS SQL tables: Category, Question. Each Question is assigned to exactly one Category. One Category may have many subcategories. Category Id : bigint (PK) Name : nvarchar(255) AcceptQuestions : bit IdParent : bigint (FK) Question Id : bigint (PK) Title : nvarchar(255) ... IdCategory : bigint (FK) How do I recursively count all Questions for a given Category (including questions in subcategories). I've tried it already based on several tutorials but still can't figure it out :(

    Read the article

  • Recursive COUNT Query (MS SQL)

    - by Cosmo
    Hello Guys! I've two MS SQL tables: Category, Question. Each Question is assigned to exactly one Category. One Category may have many subcategories. Category Id : bigint (PK) Name : nvarchar(255) AcceptQuestions : bit IdParent : bigint (FK) Question Id : bigint (PK) Title : nvarchar(255) ... IdCategory : bigint (FK) How do I recursively count all Questions for a given Category (including questions in subcategories). I've tried it already based on several tutorials but still can't figure it out :(

    Read the article

  • Linq-To-Sql equivalent for this sql query...

    - by Pandiya Chendur
    I thus far used concatenated Id string like 1,2,3 and updated in my table using this query... if exists( select ClientId from Clients where ClientId IN (SELECT i.items FROM dbo.Splitfn(@Id,',') AS i)) begin update Clients set IsDeleted=1 where ClientId IN (SELECT i.items FROM dbo.Splitfn(@Id,',') AS i) select 'deleted' as message end What is the linq-to-sql equivalent for the above query? Any suggestion...

    Read the article

  • how to get the comma seperated values of the column stored in the Sql server

    - by Innova
    how to get the comma separated values stored in the Sql Db into a individual values e.g in sql DB the column is stored with comma values as shown below, EligiblGroup A11,A12,A13 B11,B12,B13 I need to get EligibleGroup A11 A12 A13 B11 B12 ... I have written a query that will fetch me some list of employees with employee name and elibigle group XXX A11 YYY B11 ZZZ C11 I need to check that the employees(XXX,YYY,ZZZ) eligiblegroup falls within this EligiblGroup A11,A12,A13 B11,B12,B13 and retrun me only that rows.

    Read the article

  • An XEvent a Day (13 of 31) – The system_health Session

    - by Jonathan Kehayias
    Today’s post was originally planned for this coming weekend, but seems I’ve caught whatever bug my kids had over the weekend so I am changing up today’s blog post with one that is easier to cover and shorter.  If you’ve been running some of the queries from the posts in this series, you have no doubt come across an Event Session running on your server with the name of system_health.  In today’s post I’ll go over this session and provide links to references related to it. When Extended Events...(read more)

    Read the article

  • An XEvent a Day (6 of 31) – Targets Week – asynchronous_file_target

    - by Jonathan Kehayias
    Yesterday’s post, Targets Week - ring_buffer , looked at the ring_buffer Target in Extended Events and how it outputs the raw Event data in an XML document.  Today I’m going to go over the details of the other Target in Extended Events that captures raw Event data, the asynchronous_file_target. What is the asynchronous_file_target? The asynchronous_file_target holds the raw format Event data in a proprietary binary file format that persists beyond server restarts and can be provided to another...(read more)

    Read the article

  • An XEvent a Day (8 of 31) – Targets Week – synchronous_event_counter

    - by Jonathan Kehayias
    Yesterday’s post, Targets Week - Bucketizers , looked at the bucketizer Targets in Extended Events and how they can be used to simplify analysis and perform more targeted analysis based on their output.  Today’s post will be fairly short, by comparison to the previous posts, while we look at the synchronous_event_counter target, which can be used to test the impact of an Event Session without actually incurring the cost of Event collection. What is the synchronous_event_counter? The synchronous_event_count...(read more)

    Read the article

  • An XEvent a Day (7 of 31) – Targets Week – bucketizers

    - by Jonathan Kehayias
    Yesterday’s post, Targets Week - asynchronous_file_target , looked at the asynchronous_file_target Target in Extended Events and how it outputs the raw Event data in an XML document. Continuing with Targets week today, we’ll look at the bucketizer targets in Extended Events which can be used to group Events based on the Event data that is being returned. What is the bucketizer? The bucketizer performs grouping of Events as they are processed by the target into buckets based on the Event data and...(read more)

    Read the article

  • An XEvent a Day (9 of 31) – Targets Week – pair_matching

    - by Jonathan Kehayias
    Yesterday’s post, Targets Week – synchronous_event_counter , looked at the counter Target in Extended Events and how it could be used to determine the number of Events a Event Session will generate without actually incurring the cost to collect and store the Events.  Today’s post is coming late, I know, but sometimes that’s just how the ball rolls.  My original planned demo’s for today’s post turned out to only work based on a fluke, though they were very consistent at working as expected,...(read more)

    Read the article

  • SQL Server Certification - a database platform primer for your career path

    - by ssqa.net
    When you need to upgrade your knowledge then training is required, at the same time certifications will help you to keep up on what you have learned! There is a big debate on the web about whether certifications are important in your career or not, the bottomline is if you do not know the stuff or unable to answer few basic technical questions, it does'nt matter how many certifications you have then you will not get the job, well I'm not starting the same discussion here. But in the recent...(read more)

    Read the article

  • SQLUniversity Professional Development Week: Learning To Fly

    - by andyleonard
    Introduction Clem and Jim Bob were out hunting the other day in the woods south of Farmville. As they crossed a ridge, they came upon a big ol' Momma Bear and her cub. The larger bear immediately started towards them. Jim Bob took off running as fast as he could. He stopped when he realized Clem wasn't with him. And when he saw Clem reaching into his pack, Jim Bob was incredulous: "Hurry Clem! That bar's comin' fast! You need to out run 'er!" Clem kicked off his boots and pulled running shoes out...(read more)

    Read the article

  • An XEvent a Day (31 of 31) – Event Session DDL Events

    - by Jonathan Kehayias
    To close out this month’s series on Extended Events we’ll look at the DDL Events for the Event Session DDL operations, and how those can be used to track changes to Event Sessions and determine all of the possible outputs that could exist from an Extended Event Session.  One of my least favorite quirks about Extended Events is that there is no way to determine the Events and Actions that may exist inside a Target, except to parse all of the the captured data.  Information about the Event...(read more)

    Read the article

  • Parsing the sqlserver.sql_text Action in Extended Events by Offsets

    - by Jonathan Kehayias
    A couple of weeks back I received an email from a member of the community who was reading the XEvent a Day blog series and had a couple of interesting questions about Extended Events.  This person had created an Event Session that captured the sqlserver.sql_statement_completed and sqlserver.sql_statement_starting Events and wanted to know how to do a correlation between the related Events so that the offset information from the starting Event could be used to find the statement of the completed...(read more)

    Read the article

  • An XEvent a Day (30 of 31) – Tracking Session and Statement Level Waits

    - by Jonathan Kehayias
    While attending PASS Summit this year, I got the opportunity to hang out with Brent Ozar ( Blog | Twitter ) one afternoon while he did some work for Yanni Robel ( Blog | Twitter ).  After looking at the wait stats information, Brent pointed out some potential problem points, and based on that information I pulled up my code for my PASS session the next day on Wait Statistics and Extended Events and made some changes to one of the demo’s so that the Event Session only focused on those potentially...(read more)

    Read the article

  • An XEvent a Day (24 of 31) – What is the package0.callstack Action?

    - by Jonathan Kehayias
    One of the actions inside of Extended Events is the package0.callstack and the only description provided by sys.dm_xe_objects for the object is 16-frame call stack. If you look back at The system_health Session blog post, you’ll notice that the package0.callstack Action has been added to a number of the Events that the PSS team thought were of significance to include in the Event Session. We can trigger an event that will by logged by our system_health Event Session by raising an error of severity...(read more)

    Read the article

  • Parsing the sqlserver.sql_text Action in Extended Events by Offsets

    - by Jonathan Kehayias
    A couple of weeks back I received an email from a member of the community who was reading the XEvent a Day blog series and had a couple of interesting questions about Extended Events.  This person had created an Event Session that captured the sqlserver.sql_statement_completed and sqlserver.sql_statement_starting Events and wanted to know how to do a correlation between the related Events so that the offset information from the starting Event could be used to find the statement of the completed...(read more)

    Read the article

  • An XEvent a Day (26 of 31) – Configuring Session Options

    - by Jonathan Kehayias
    There are 7 Session level options that can be configured in Extended Events that affect the way an Event Session operates.  These options can impact performance and should be considered when configuring an Event Session.  I have made use of a few of these periodically throughout this months blog posts, and in today’s blog post I’ll cover each of the options separately, and provide further information about their usage.  Mike Wachal from the Extended Events team at Microsoft, talked...(read more)

    Read the article

  • Here Comes the FY11 Earmarks Database

    - by Mike C
    I'm really interested in politics (don't worry, I'm not going to start bashing politicians and hammering you with political rage). The point is when the U.S. FY11 Omnibus Spending Bill (the bill to fund the U.S. Government for another year) was announced it piqued my interest. I'm fascinated by " earmarks " (also affectionally known as " pork "). For those who aren't familiar with U.S. politics, "earmark" is a slang term for "Congressionally Directed Spending". It's basically the set of provisions...(read more)

    Read the article

  • SQL Server v.Next (Denali) : Why you should start testing early

    - by AaronBertrand
    Denali is coming, whether you like it or not. You may not be an early adopter and you may not have plans on your current calendar, but at some point you will need to move your apps and databases to this release - or one very much like it. There are a lot of great new features you will be able to take advantage of, but not everything is a double rainbow. There are some changes that will break your spirit if you let them. What does it mean? I go over several breaking changes in my presentation that...(read more)

    Read the article

  • SQL Server Query solution cum Suggestion Required

    - by Nirmal
    Hello All... I have a following scenario in my SQL Server 2005 database. zipcodes table has following fields and value (just a sample): zipcode latitude longitude ------- -------- --------- 65201 123.456 456.789 65203 126.546 444.444 and place table has following fields and value : id name zip latitude longitude -- ---- --- -------- --------- 1 abc 65201 NULL NULL 2 def 65202 NULL NULL 3 ghi 65203 NULL NULL 4 jkl 65204 NULL NULL Now, my requirement is like I want to compare my zip codes of place table and update the available latitude and longitude fields from zipcode table. And there are some of the zipcodes which has no entry in zipcode table, so that should remain null. And the major issue is like I have more then 50,00,000 records in my db. So, query should support this feature. I have tried some of the solutions but unfortunately not getting proper output. Any help would be appreciated...

    Read the article

  • CONTAINSTABLE with wildcard works different in SQL Server 2005 and SQL Server 2008?

    - by musuk
    I have two same databases one on SQL Server 2005 and one on SQL Server 2008, it have same SQL_Latin1_General_CP1_CI_AS Collation, and full text search catalogs have the same settings. These two databases contains table with same data, NTEXT string: "...kræve en forklaring fra miljøminister Connie Hedegaard.." My problem is: CONTAINSTABLE on SQL Server 2008 finds nothing if query is: select * from ContainsTable(SearchIndex_7, Content, '"miljø*"') ct but SQL Server 2005 works perfectly and finds necessary record. SQL Server 2008 finds necessary record if query is: select * from ContainsTable(SearchIndex_7, Content, '"milj*"') ct or select * from ContainsTable(SearchIndex_7, Content, '"miljøminister"') What can be reason for so strange behavior?

    Read the article

< Previous Page | 43 44 45 46 47 48 49 50 51 52 53 54  | Next Page >