Search Results

Search found 28024 results on 1121 pages for 'sql 2014'.

Page 114/1121 | < Previous Page | 110 111 112 113 114 115 116 117 118 119 120 121  | Next Page >

  • 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

  • SQL dynamic date but fixed time query

    - by Marko Lombardi
    I am trying to write a sql query like the example below, however, I need it to always choose the DateEntered field between the current day's date at 8:00am and the current day's date at 4:00pm. Not sure how to go about this. Can someone please help? SELECT OrderNumber , OrderRelease , HeatNumber , HeatSuffix , Operation , COUNT(Operation) AS [Pieces Out of Tolerance] FROM Alerts WHERE (Mill = 3) AND (DateEntered BETWEEN GetDate '08:00' AND GetDate '16:00') GROUP BY OrderNumber, OrderRelease, HeatNumber, HeatSuffix, Operation

    Read the article

  • sql server - select top and bottom rows

    - by Adrian Faciu
    Hi, I'm using Sql Server 2005 and i'm trying to achieve something like: In the same select statement i want to get the first x rows and the last x rows. SELECT TOP(5) BOTTOM(5) Of course 'bottom' does not exist so i need other solution. I believe there is an easy and elegant solution that i'm not getting. Doing the select again with Group By Desc is not an option. Thanks.

    Read the article

  • sql "Group By" and "Having"

    - by Hans Rudel
    im trying to work through some questions and im not sure how to do the following Q:Find the hard drive sizes that are equal among two or more PCs. its q15 on this site http://www.sql-ex.ru/learn_exercises.php#answer_ref The database scheme consists of four tables: Product(maker, model, type) PC(code, model, speed, ram, hd, cd, price) Laptop(code, model, speed, ram, hd, screen, price) Printer(code, model, color, type, price) any pointers would be appreciated.

    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

  • SQL Update with row_number()

    - by user609511
    i m using SQL Server 2008 R2. i want to update my column CODE_DEST with increment number CODE_DEST RS_NOM null qsdf null sdfqsdfqsdf null qsdfqsdf what i want: CODE_DEST RS_NOM 1 qsdf 2 sdfqsdfqsdf 3 qsdfqsdf i have try this: update DESTINATAIRE_TEMP set CODE_DEST = TheId FROM (SELECT Row_Number() OVER (ORDER BY [RS_NOM]) as TheId from DESTINATAIRE_TEMP) not work because of ) and this With DESTINATAIRE_TEMP As ( SELECT ROW_NUMBER() OVER (ORDER BY [RS_NOM] DESC) AS RN FROM DESTINATAIRE_TEMP ) UPDATE DESTINATAIRE_TEMP SET CODE_DEST=RN because of union

    Read the article

  • SQL Server - Test the result of a stored procedure

    - by Melursus
    In SQL Server, it is possible to test the result of a stored procedure to know if the result return rows or nothing ? Example : EXEC _sp_MySp 1, 2, 3 IF @@ROWCOUNT = 0 BEGIN PRINT('Empty') END ELSE BEGIN PRINT(@@ROWCOUNT) END But @@ROWCOUNT always return 0 so maybe is there another way of doing this ?

    Read the article

  • LINQ 2 SQL:Left outer join for my SQL statement

    - by Shyju
    Can any one tell me the LINQ 2 SQL version (in vb.net) of the below Left outer join query.I am trying to get all Employees with name "Shyju" and their address line 1 if it exist in the address table SELECT E.EMPLOYEE_NAME, E.AGE,A.ADRESS_LINE1 FROM EMPLOYEE_MASTER E LEFT OUTER JOIN ADDRESS_MASTER A ON E.ID=A.EMPLOYEE_ID WHERE E.EMPLOYEE_NAME='Shyju' Thanks in advance

    Read the article

  • How to Enable Full-Text Index on Sql Server 2008 Table

    - by michaeldelorenzo
    Not sure what's happening with this, but here's my question. I have a Sql Server 2008 database that I need to be able to do full-text indexing/searching but when I try to setup my indices on the table, I get the following: I've tried running this stored procedure on my database and it's successful: EXEC sp_fulltext_database @action = 'enable' But I still get the above window and my full-text searches don't return any results when they should. What am I missing?

    Read the article

  • Change string in SQL Server to abbreviate

    - by jeff
    How do I return the everything in a string from a sql query before a certain character? My data looks like this: HD TV HM45VM - HDTV widescreen television set with 45" lcd I want to limit or truncate the string to include everything before the dash. So the final result would be "HD TV HM45VM"

    Read the article

  • Combining multiple condition in single case statement in Sql Server

    - by swetha
    According to the following description i have to frame a case ...End statement in Sql server ,help me to frame a complex case..End statement to fulfil the following condition. if PAT_ENT.SCR_DT is not null and PAT_ENTRY.ELIGIBILITY is null then display display 'Favor' if PAT_ENT.SCR_DT is not null and PAT_ENTRY.EL is equal to No, display 'Error' if PAT_ENTRY.EL is Yes and DS.DES is equal to null or OFF, display 'Active' if DS.DES is equal to N, display 'Early Term' if DS.DES is equal to Y, display 'Complete' Thanks in advance.

    Read the article

  • Linq to Sql: Generic Stored Procedures

    - by Eric
    Hello everyone, I am using Linq-to-Sql for a C# application and am currently working on some stored procedures. The application is for a newspaper, and a sample stored procedure is the following: ALTER PROCEDURE dbo.Articles_GetArticlesByPublication @publicationDate date AS SELECT * FROM Articles WHERE Articles.PublicationDate=@publicationDate Anyway, this query gets all of the articles where the publication date is equal to the argument (publicationDate). How can I alter this so that the argument can handle multiple publication dates? Also, I'd prefer not to use "BETWEEN," rather, I want to pick and choose dates.

    Read the article

  • Tidy for SQL

    - by Rob
    I'm looking for a tool that that I can use to clean up (formatting, tabs etc...) my stored procedures and views. Is there anything like html's tidy, but for SQL which is free/open source?

    Read the article

  • Select a column returned by a stored procedure

    - by vaibhav
    I have a stored procedure which is returning me about 50 columns. I want to write a query, where I will be able to select a particular column from the list of column returned by the SP. I tried writing select RSA_ID from exec(uspRisksEditSelect '1') But Its throwing me an error. I think we need to write some dynamic sql for it. But I am new to it.

    Read the article

  • SQL Server insert slow

    - by andrew007
    Hi, I have two servers where I installed SQL Server 2008 Production: RAID 1 on SCSI disks Test: IDE disk When I try to execute a script with about 35.000 inserts, on the test server I need 30 sec and instead on the production server more than 2 min! Does anybody know why such difference? I mean, the DB is configured in the same way and the production server has also a RAID config, a better processor and memory... THANKS!

    Read the article

  • how to connect SQL Server cubes using dotnet(C#)

    - by prince23
    Hi. I am new to this cubes concept in SQL Server. I need to connect to cubes and query and get a result and display that result in grid view Any help would be great telling how to connect to a cube, articles on it, code any thing that can help me to achieve the result Thank you.

    Read the article

  • SQL Server 2005 I get "The database is not accessible"

    - by Brian Roisentul
    I have a computer working as a server with many SQL Server 2005 databases in it since two years ago. Today, I don't know why, when I try to connect locally to any of the databases it gives me that error. It fails even if I'm logged in using Windows Authentication or as 'sa' user. It just wouldn't let me access the databases' info. Could anybody explain me what's going on?

    Read the article

< Previous Page | 110 111 112 113 114 115 116 117 118 119 120 121  | Next Page >