Skip to content
Code Project
CODE PROJECT For Those Who Code

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
  • Failed to open a Row set

    database help question
    3
    0 Votes
    3 Posts
    0 Views
    H
    thnx 4 the suggestions but i want to get Date parameters value at run time.what should i do?
  • SQL Query Problem

    database help
    13
    0 Votes
    13 Posts
    1 Views
    N
    Try this declare @tbl table(person varchar(50),name varchar(50),value int) insert into @tbl select 'xyz','a',10 union all select 'xyz','b',5 union all select 'xyz','a',15 union all select 'xyz','b',4 union all select 'xyz','c',1 union all select 'xyz','a',5 union all select 'xyz','d',10 union all select 'xyz','a',10 union all select 'abc','a',0 union all select 'abc','b',0 union all select 'abc','c',0 union all select 'abc','d',0 ;with cte as ( select person,name,sum(value) as total from @tbl group by person,name ) select person,'others' as name , SUM(total) as total from cte where name not in('a') group by person union all select person,'a' as name , SUM(total) as total from cte where name in('a') group by person order by person desc :) Niladri Biswas
  • Windows Server woth SQL

    question database sql-server sysadmin windows-admin
    5
    0 Votes
    5 Posts
    0 Views
    A
    Yes, and 2008 as well if you want. Bob Ashfield Consultants Ltd Proud to be a 2009 Code Project MVP
  • 0 Votes
    9 Posts
    0 Views
    N
    Hello, I suggestion.. if possible try to avoid using function as it causes performance bottleneck. :) Niladri Biswas
  • Pre-populate capture records for one day.

    design performance help question code-review
    2
    0 Votes
    2 Posts
    0 Views
    M
    This is obviously too hard to answer - probably belongs in the design forum anyway.... This seems reasonable and as for the edit, what not have a >= today? How do you intend to support a category that needs to be retired? I love asking these questions, years of trying to answer them I guess. Have a from to date where the default to date = datetime.maxvalue (31/12/9999) and use where today between from and to Caveat - datetimepicker does not support datetime.maxvalue.
  • Crystal Reports

    database tutorial
    2
    0 Votes
    2 Posts
    1 Views
    J
    One way is to bind your report to a dataset. Here's[^] a tutorial.
  • find missing numbers in table using sql

    database tutorial question
    2
    0 Votes
    2 Posts
    0 Views
    N
    Try this declare @Table1 table(id int) insert into @Table1 select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 declare @Table2 table(id int) insert into @Table2 select 1 union all select 2 union all select 5 union all select 8 Solution 1: select id from @Table1 except select id from @Table2 Solution 2: select id from @Table1 where id not in (select id from @Table2) Let me know in case of any concern :) Niladri Biswas
  • Image

    sql-server help
    7
    0 Votes
    7 Posts
    0 Views
    I
    hmm , Thats interesting , this is the reason why i put the code, can i know what problem this code has , as you know problem is the gateway to development :-D Best Regards, SOFTDEV If you have knowledge, let others light their candles at it
  • Importing data?? [modified]

    question com design help
    4
    0 Votes
    4 Posts
    0 Views
    M
    Hey Mark, just to let you know, I found the answer and it was to simply create a composite key! We will either find a way, or make one!   (\ /)   (- .-) C(''')(''')
  • Adding custom attributes to tables

    database tutorial question
    3
    0 Votes
    3 Posts
    0 Views
    M
    We are currently using the EAV (what is that by the way) method with an attribute table with AttributeType and AttributeValue. Always varchar of course so yes data typing is an issue. It has allowed us to create a dynamic, extensible solution but there is a definite cost, some of the queries are just horrendous. If I was going to go down the path RJ suggested I would have a customer table with fixed columns and a CustomerEx where the user can add custom columns and the system will rewrite the DDL. I would disallow any custom column from being in the core processing, IE reference only. I'm not sure if this is different from RJs proposal. [edit] IJ not RJ, sorry mate [/edit] Never underestimate the power of human stupidity RAH
  • 0 Votes
    1 Posts
    2 Views
    No one has replied
  • Backup & recovery of Oracle 10g database

    database oracle
    2
    0 Votes
    2 Posts
    0 Views
    C
    Investigate using the EXPORT operation from Oracle as your backup. You will then be able to use the IMPORT operation to completely or partialy restore the database. I've been using and dependant upon these for years with Oracle on Windows servers. :) 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]
  • tentative of reconnection to sql server

    database sysadmin tutorial sql-server testing
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • query needed

    database question sales workspace
    9
    0 Votes
    9 Posts
    0 Views
    I
    That's not what I said. I said that the only way to guarantee the order of the results is to use an ORDER BY clause. Without the sort, the results may or may not be returned in the order that you want depending upon how the query optimizer decides to handle your request.
  • 0 Votes
    5 Posts
    0 Views
    M
    Thanks for that. I had come to the same conclusion myself. Seems a pity that CASE could not be used a quirk of SQL Server!!
  • problem with sending (') as string

    help csharp asp-net database regex
    6
    0 Votes
    6 Posts
    0 Views
    R
    If you're not familiar with SQL Injection, which is a security issue, have a read about it. As others suggest you should always parameterize stuff like this rather than construct a string to do it, otherwise you might find your database missing one day... Regards, Rob Philpott.
  • SQL SERVER 2008

    database sql-server sysadmin help question
    2
    0 Votes
    2 Posts
    0 Views
    L
    How many space is there left on your harddisk? Did you check whether you have enough Virtual Memory left? I are Troll :)
  • SSIS Suggestions

    csharp asp-net sharepoint sql-server
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • New to db4o? Check this funny intro

    com docker question announcement learning
    2
    0 Votes
    2 Posts
    0 Views
    M
    The only reason this has not been voted off as abuse of the forum is because it is open source (note the down votes), if it was commercial it would no longer be here. If you want to promote something like this why not write an article, there is a product article category specifically set up for this and I'd be surprised if there is a charge for publishing and article on open source stuff. Never underestimate the power of human stupidity RAH
  • date issue

    question csharp mcp help
    8
    0 Votes
    8 Posts
    0 Views
    L
    But there is no direct way to get the date in the desired format Regards Aman Bhullar www.arlivesupport.com[^]