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
  • check date range in between date range

    database tutorial
    5
    0 Votes
    5 Posts
    0 Views
    V
    Instead of usign Between Operator, you should use FromDate >= @FromDate AND EndDate < DateAdd(D, 1, @EndDate ) (It always perform the accurate process, specially in case when Date Column accepts dates also) Remember EndDate must work with LessThan and FromDate performs on GreaterThanEqualTo - Happy Coding - Vishal Vashishta
  • See If Stored Proc Returns Data

    database question announcement
    5
    0 Votes
    5 Posts
    0 Views
    V
    Create Params passed to a Store Proc.. as local variables in Debug Code,,, and to check whether a SP returns data, execute the SP with those local variable with specified values.. by marking comment on Create or Alter Command on SP - Happy Coding - Vishal Vashishta
  • choosing a database

    question database
    5
    0 Votes
    5 Posts
    0 Views
    P
    Eddy Vluggen wrote: a simple local data lookup I have no idea that that's the case.
  • using xquery to populate a table variable in sql

    question database business xml help
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • 0 Votes
    6 Posts
    0 Views
    D
    Thanks for your valued input. Further to the comments made to Eddy above; What you have shared is probably what approach I would use for data collection repository, when any given point could be recorded at any given time. All points I am recording will be manually entered at the same time, all with the same 'end of period' timestamp. I am using some validation logic on the post back to check which site the data is being recorded for and set any 'unused' point to zero or empty string (depending on the datatype) Also, the views are tailored to only display the relevant collection points to the user based on site. You have given me some more food for thought.........thanks. Dave Find Me On: Web|Facebook|Twitter|LinkedIn Folding Stats: Team CodeProject
  • Playing music on my end, with APIs of search engines

    wcf com json help
    7
    0 Votes
    7 Posts
    0 Views
    L
    I'm sorry, seems I cannot help here. Bastard Programmer from Hell :suss:
  • career Sql developer

    sharepoint database career
    5
    0 Votes
    5 Posts
    0 Views
    R
    well, It is also a good option and later on you can master other skills as well like SSIS,SSRS etc.. regards Vatsa www.objectiveprogramming.com
  • Nesting Limit

    database question sales help
    4
    0 Votes
    4 Posts
    0 Views
    M
    Andy_L_J wrote: seems the issue is a calculated field (CustCode) that is part of the table definition. Probably fired off by a trigger - triggers how to completely fuck your database. Never underestimate the power of human stupidity RAH
  • Connect to Oracle database from Log4net.config file

    database oracle help tutorial
    2
    0 Votes
    2 Posts
    0 Views
    L
    Try this[^]. Bastard Programmer from Hell :suss:
  • Running Balance

    database help
    3
    0 Votes
    3 Posts
    1 Views
    B
    I guess you have to use SUM and GROUP BY, by the way your question is not enough clear. I Love T-SQL "VB.NET is developed with C#.NET" If my post helps you kindly save my time by voting my post.
  • I have a problem in a SSIS solution !!!

    database sql-server question sysadmin help
    8
    0 Votes
    8 Posts
    0 Views
    P
    See Mycroft's post. Clear out a temporary area, import all the data there, then copy only the new data to the final location.
  • SQL Get Max for each group

    database question csharp com sales
    8
    0 Votes
    8 Posts
    0 Views
    V
    SELECT b.RowNumber, iSrno, vUserCode, dLoggedDate FROM ( SELECT iSrno, vUserCode, dLoggedDate, ROW_NUMBER() OVER ( PARTITION BY vUserCode ORDER BY vUserCode DESC ) 'RowNumber' FROM HOUserLog) b WHERE RowNumber = 1 /* Here HOUserLog is the table from where the Group By MAX needs to be pick. ROw_Number() OVER ( PARTITION BY .... ) will generate the RowNumber according to the Group By Column you provided in ORDER BY ..... DESC Clause. Now pick the values for every RowNumber Column = 1 will get you the solution. MARK AS ANSWER IF WORKS - Happy Coding - Vishal Vashishta
  • 0 Votes
    4 Posts
    1 Views
    P
    The easiest option would be to open the instance up in SQL Server 2005 from your last working backup. If this is not an option for you. you might want to read this[^] article. Warning! Anything you do here is at your own risk - if you don't have backups to go back to, you could be well and truly stuffed. *pre-emptive celebratory nipple tassle jiggle* - Sean Ewington "Mind bleach! Send me mind bleach!" - Nagy Vilmos CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier
  • SQL 2008 to SQL2005

    help sharepoint database tools announcement
    6
    0 Votes
    6 Posts
    0 Views
    L
    jojoba2011 wrote: and why doesn't the SQL create correct scripts It did. You generated them on Sql2008, and thus it will use all the language-features available for 2008. If you wanted to be compatible with Sql2005, you'd generate them from there. Put your database in compatibility mode (Google knows how) and try to script again. Bastard Programmer from Hell :suss:
  • 0 Votes
    10 Posts
    0 Views
    B
    I can not find a SQL solution to solve this problem, but finally, I found a esproc solution. It is not a traditional SQL, but It fit for me, because ESPROC can return a resultSet to my Jasper reporting tool. Anyway, I still need a SQL solution, can some body help me? ESPROC's solution is just like this: http://stackoverflow.com/questions/10184205/complicated-sql-how-to-filtrate-duplicate-data-about-technical-support-and-comp/10275434#10275434[^] or check here: http://i.stack.imgur.com/p5rp0.jpg[^] Here are some information about this solution: http://www.esproc.com/tour/what-is-esproc.html[^] Or here is a SQL Server Solution(but not fit for mysql):http://social.msdn.microsoft.com/Forums/en-US/transactsql/thread/e11c754d-559e-4eb7-9682-e998ea3387d9[^] Hope this helps people that meet the same trouble
  • mysql to ms sql server

    sql-server database mysql com sysadmin
    3
    0 Votes
    3 Posts
    1 Views
    J
    I suspect the solution would require that you first analyze what happens if there is an error. For example you update the MySQL table and at that moment the SQL Server database is down so of course the corresponding table cannot be updated then - so what do you expect to happen then? Additionally how soon does the data need to be in the SQL Server database?
  • SSRS 2005 question

    help question css database sql-server
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • 0 Votes
    5 Posts
    0 Views
    J
    I have no better idea about relevant of database but your problem will be solve at w3school site because of there is well explain about database...I also daily visit that site for getting new information about html...
  • Getting unique combination of rows in SQL??

    question database help
    7
    0 Votes
    7 Posts
    2 Views
    B
    There exists DISTINCT option to retrieve non-repeated values, but your case was different from using DISTINCT. Glad to help you. I Love T-SQL "VB.NET is developed with C#.NET" If my post helps you kindly save my time by voting my post.
  • Traking Offence

    database sql-server sysadmin question
    3
    0 Votes
    3 Posts
    2 Views
    B
    Actually i want to workin 3 tables 1)tbloffence : where we will get the sum(offence) here i track maincontractorID and sum(offence) query will be like this : "SELECT sum(o.OffenceID) as OffenceNumber,u.UserID from tblOffence o inner join tblSubContractor ts on o.MainContractorID=ts.SubContractorID" from here i will chk the tblUSER with these subcontractorID : "inner join tblUser u on u.SubContractorID=ts.SubContractorID" . and my doubt is that upto here i will get the total sum of offence and appropriate userid.,for eg UserID : 520 TotalOffence:6000 but there is another table called tblAuditTrailSession where we will get logondate and userid which is tracking here..so i want to display offence based on userlogin(userid) ..since last login. i want a help in query format..Hope this is a generalized format question.