Skip to content

Database

Discussions on database access, SQL, and ADO

This category can be followed from the open social web via the handle database@forum.codeproject.com

17.1k Topics 61.8k Posts
  • How to display data effectively [modified]

    question database xml tutorial learning
    3
    0 Votes
    3 Posts
    0 Views
    F
    Yes, I mean what you say: Some grouping, sorting, summing up of columns,.... Best regards
  • Calling Executables from CLR Procedure

    help database sql-server dotnet sysadmin
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Help with this Stored proc

    help
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Conversion error in ms sql

    database help
    2
    0 Votes
    2 Posts
    0 Views
    S
    Got the answer create table #countlists (ICount int) exec ('insert into #countlists(ICount) select COUNT(['+@v_COLUMN_NAME+']) from '+@DataTable+' where '+@v_COLUMN_NAME+' is not null') set @vCount=(select ICount from #countlists) drop table #countlists
  • How to get value from outer to inner SELECT

    database help tutorial oracle question
    4
    0 Votes
    4 Posts
    0 Views
    R
    This is my query now: SELECT ID, DAY FROM (SELECT ROWNUM as CAL_ROWNUM, DAY AS MAX_CALENDAR_DAY FROM (SELECT DAY FROM CALENDAR WHERE DAY > TRUNC(TO_NUMBER(SYSDATE - TO_DATE('01.01.1970', 'DD.MM.YYYY'))) AND CALENDAR.IS_WORKING_DAY= 'y' ORDER BY CALENDAR.DAY) WHERE ROWNUM <= (SELECT MAX(NR_OF_DAYS) FROM WORKCENTER WHERE ID IN (1, 2, 6, 7, 9)) ) INNER JOIN WORKCENTER ON NR_OF_DAYS = CAL_ROWNUM WHERE ID IN (1, 2, 6, 7, 9) And it works, yeah! Thanks guys. Greetings
  • New column retrival on Sql

    database agentic-ai help tutorial
    3
    0 Votes
    3 Posts
    0 Views
    T
    Thanx a million buddy.. works like a charm.... thanx alot...
  • 0 Votes
    10 Posts
    0 Views
    R
    I found the solution at Microsoft Support, not MSDN. :-D "A Journey of a Thousand Rest Stops Begins with a Single Movement"
  • alternative to rewire CASE WHEN in query

    database question
    9
    0 Votes
    9 Posts
    1 Views
    P
    Scott, here is the whole query. and roughly, records for each supplier is minimum 400(rows) declare @a as char(1) declare @b as varchar(35) set @a='Y' set @b='<span style=''color:Red''>N</span>' SELECT DISTINCT Product_Master.Product_Kid, Product_Master.Product_Name, convert(nvarchar,Product_Master.Product_RegDate,103) as Product_RegDate, Product_Master.Product_RegDate as RegDate, Isnull(Product_Master.Product_Code,'-') AS Product_Code, Isnull(Product_Master.Product_ModelNo,'-') AS Product_ModelNo, CASE WHEN (Product_Master.Product_Image IS NULL) THEN @b ELSE @a END AS Product_Image, CASE WHEN (Product_Master.Product_BrandId IS NULL) THEN @b ELSE @a END AS Brand_Name, CASE WHEN (Product_Master.Product_MarketPrice IS NULL) THEN @b ELSE @a END AS Product_MarketPrice, CASE WHEN (Product_Master.Product_PackagingCharge IS NULL) THEN @b ELSE @a END AS Product_PackagingCharge, CASE WHEN (Product_Master.Product_MinOrderQty IS NULL) THEN @b ELSE @a END AS Product_MinOrderQty, CASE WHEN (Product_Master.Product_ShippingQty IS NULL) THEN @b ELSE @a END AS Product_ShippingQty, CASE WHEN (Product_Master.Product_Weight IS NULL) THEN @b ELSE @a END AS Product_Weight, CASE WHEN (Product_Master.Product_Dimension IS NULL) THEN @b ELSE @a END AS Product_Dimension, CASE WHEN (Product_Master.Product_DeliveryPeriod IS NULL) THEN @b ELSE @a END AS Product_DeliveryPeriod, CASE WHEN (Product_Master.Product_Description Is NULL) THEN @b ELSE @a END AS Product_Description, CASE WHEN (Product_Master.Product_PcsPerKg IS NULL) THEN @b ELSE @a END AS Product_PcsPerKg, CASE WHEN (ProductApplication.ProdApp_Code IS NULL) THEN @b ELSE @a END AS ProdApp_Code, CASE WHEN (ProductFeatures.ProdFeatures_Code IS NULL) THEN @b ELSE @a END AS ProdFeatures_Code, CASE WHEN (ProductTechnicalSpecification.TechSpec_code IS NULL) THEN @b ELSE @a END AS TechSpec_code, CASE WHEN (ProductSpecialNotesInstruction.ProdSpecInstr_Code IS NULL) THEN @b ELSE @a END AS ProdSpecInstr_Code, CASE WHEN (MaterialSafetyDataSheet.MSDS_Code IS NULL) THEN @b ELSE @a END AS MSDS_Code, CASE WHEN (ProductStandardApproval.ProdStdApproval_Code IS NULL) THEN @b ELSE @a END AS ProdStdApproval_Code, CASE WHEN (InstallationManual.InstCommManual_Code IS NULL) THEN @b ELSE @a END AS InstCommManual_Code, CASE WHEN (ProductPackaging.ProdPackaging_Code IS NULL) THEN @b ELSE @a END AS Product_Pack
  • 0 Votes
    1 Posts
    0 Views
    No one has replied
  • A Secured Hotel Management System using Visual BAsic 2010

    11
    0 Votes
    11 Posts
    0 Views
    C
    You need this[^]. Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
  • Select number of rows [modified]

    database help
    8
    0 Votes
    8 Posts
    0 Views
    J
    Quite similar to Oracle then, which still lacks the TOP function. "When did ignorance become a point of view" - Dilbert
  • Temporary freeze updating .SDF file - fixed

    database adobe question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Making with values of two rows, two entries in a new table.

    4
    0 Votes
    4 Posts
    0 Views
    N
    Thank you all, it helped me really much :) :)
  • Order By

    database xml question
    4
    0 Votes
    4 Posts
    0 Views
    R
    So elucidate as it did appear that's what you asked for. In any case you can use select foo from bar order by 2 or 3 or 1000 "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair. nils illegitimus carborundum me, me, me modified on Monday, August 2, 2010 6:26 AM
  • db4o Embedded DB

    question csharp database com hardware
    10
    0 Votes
    10 Posts
    0 Views
    D
    you're welcome :) I bug
  • Insert and delete

    database question
    2
    0 Votes
    2 Posts
    0 Views
    L
    T.RATHA KRISHNAN wrote: I"ve to add values to a field A single field has a single value. The UPDATE-command would replace the current value of a field with a new value. I are Troll :suss:
  • Selecting Recent row

    tutorial question
    6
    0 Votes
    6 Posts
    0 Views
    R
    If you're using an autonumber field as a primary key, select on the MAX value of that field. Alternatively, get the number of rows in the main table and fetch the (N-1)th row. "A Journey of a Thousand Rest Stops Begins with a Single Movement"
  • Variable value in SQL Query

    database question
    10
    0 Votes
    10 Posts
    0 Views
    P
    I suggest you tell your boss to hire an SQL specialist.
  • query takes long time!

    database css sharepoint sql-server wpf
    8
    0 Votes
    8 Posts
    0 Views
    P
    Start with using LIKE (as mentioned) 1) Don't prefix your stored procedure names with SP_. 2) Don't use a DataAdapter, use a DataReader 3) Be sure to close your Connection
  • Retrieve the value from Dynamic Sql

    database
    2
    0 Votes
    2 Posts
    0 Views
    D
    You can use following: SET @STRSQL='SELECT @someVariable = MAX(TRN_AMOUNT) FROM TRN You can declare @someVariable in your SP. BTW there is no need to dynamic query in the scenario you have mentioned.