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
  • 0 Votes
    4 Posts
    1 Views
    L
    sekhar.k wrote: I got one more alternative for that... The .NET version would be preferable over an SQL-statement; it's obvious what the code does if you read your version. It's not that obvious what the query on the MSys tables does. Well done :) I are Troll :suss:
  • Database Design

    database design help tutorial
    4
    0 Votes
    4 Posts
    0 Views
    G
    thanks
  • sqlite

    database csharp sqlite help tutorial
    8
    0 Votes
    8 Posts
    0 Views
    B
    My bad - missed that fact that its a SQlLite question. Nice article by the way.
  • 0 Votes
    2 Posts
    0 Views
    B
    If I understand your questions correctly, why dont you create an audit table and always add a record before each update.. so you want an update triger[^]
  • 0 Votes
    9 Posts
    3 Views
    D
    What do you mean as interface to the ODBC items? I don't completely understand your question. Please be more concrete, maybe I'll be able to help you. See my article about Windows 7 Taskbar timer here on CodeProject
  • EXEC Return Value

    database help
    3
    0 Votes
    3 Posts
    0 Views
    D
    EXEC is used to execute stored procedures; in your case you need run sql statement. It's done by the stored procedure sp_executesql, an example can be found here: http://msdn.microsoft.com/en-us/library/ms188001.aspx[^] See my article about Windows 7 Taskbar timer here on CodeProject
  • Problem in Finding Hours Duration Between two Dates

    database help com question
    2
    0 Votes
    2 Posts
    0 Views
    V
    Hi Actually Duration is coming right in this query and the issue is Net Duration is not coming right. Vishnu Narayan Mishra Software Engineer
  • problem for build a query

    csharp database com help
    3
    0 Votes
    3 Posts
    0 Views
    I
    SELECT A.id, A.title, S.total FROM A LEFT OUTER JOIN ( SELECT id, COUNT(id) as total FROM B GROUP BY id ) S on S.id = A.id ORDER BY A.id ASC
  • 0 Votes
    4 Posts
    0 Views
    I
    Go back to the Test team and ask them to explain in detail why they believe that your query is 'weak'.
  • SQL Calculation...

    database help question
    2
    0 Votes
    2 Posts
    0 Views
    _
    You need to remove GrossHours and GrossMinutes from your select statement and group by. I don't have ADHD, I have ADOS... Attention Deficit oooh SHINY!! Booger Mobile (n) - A bright green 1964 Ford Falcon - our entry into the Camp Quality esCarpade!! Do something wonderful - make a donation to Camp Quality today!!
  • T-SQL Query Help Needed

    database help question learning
    5
    0 Votes
    5 Posts
    0 Views
    realJSOPR
    Nah, but that's okay - we have a solution (to use the term loosely). :) .45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
  • Upate Multiple Rows using update query in sql

    database tutorial help announcement
    6
    0 Votes
    6 Posts
    0 Views
    A
    If you are using SQL 2008 you can use Table Value Parameters to acheive this: Table-Value Parameters in SQL Server 2008 - VB.NET[^] :-\ I don't speak Idiot - please talk slowly and clearly 'This space for rent' Driven to the arms of Heineken by the wife
  • loop problem

    asp-net help question announcement lounge
    8
    0 Votes
    8 Posts
    0 Views
    B
    Could it possibly have anything to do with using GETDATE() to construct 'random' portions of the string? Each pass through the loop will render the same values until the server system clock flips to the next day. It seems to me you will always get the exact same value for each pass of the loop until the next day arrives. I also don't understand your use of the RIGHT() function, perhaps it is some odd way of padding with 0's. In each case it seems you concatenate 000's + some value and then pull the 'some value' you just concatenated from the 000's; why not just use the values themselves and not clutter it up by concatenating the 000's and values together only to turn around and take the values off? If you need to pad try using the REPLICATE() function, as it will be easier to read: DECLARE @hold varchar(50) SET @hold = convert(varchar(7), SCOPE_IDENTITY()) -- or @recid SET @hold = REPLICATE('0', 7 - LEN(@hold)) + @hold -- pad to desired length of 7 -- REPLICATE('0', 0) does not produce an error Also if you truly need to get a random value try using the NEWID() function which will return a random GUID. Hold on a second here... Don't you think you might be putting the horse ahead of the cart?
  • Run dynamic query

    database tutorial
    4
    0 Votes
    4 Posts
    0 Views
    L
    If you are using ADO.Net, you can create a command object. By assigning different values to its "CommandText" property, you can conduct queries on different tables. Use ExecuteReader() method to get the result. Please give more details on what API you are trying to use to get access to the database. That way people here can better answer your question.
  • General Performance Question

    question database sql-server sysadmin performance
    14
    0 Votes
    14 Posts
    0 Views
    D
    It can be very hard to track these things down. We once had a stored proc that ran a query, returned some data, the front end then set a flag and saved the data back again. In development it completed within seconds. In live production use, it took 15 minutes. When we looked into it, it turned out that the stored proc was actually running very quickly. So was the front-end processing to set the flag. All the time was being taken transferring the data across the network, because in the live database each row included a massive XML document that took forever to marshall off the database server, move it over the network and then marshall it all back for the front-end to receive. When the developer first tested it, the XML documents he used were teeny-tiny little things so it all ran quickly and no-one spotted the problem. We rewrote the application so that the update was done in the stored proc without returning anything to the front end, and it finished in less than 10 seconds. When we released it to the users, we had people phoning us up saying, "I don't think this did anything, it was too quick..."
  • 0 Votes
    4 Posts
    1 Views
    M
    You are talking about 2 different things, C# is the client you have written and you need to write an installer to deploy that application to the CLIENT. SQL Server is SERVER software and as such is designed to run on a SERVER unless you are using sql express as an embedded/single user database. A quick search[^] will give you plenty of resources to help with that Never underestimate the power of human stupidity RAH
  • 0 Votes
    7 Posts
    0 Views
    A
    There is Server1, Server2..... Server2 is nearer than Server1 at some location, to my device.Hence Server2 is selected and the changes are written to the database on it. Now after this, changes should be automatically written to the Server1......hope made it clear to you
  • Find tables used in stored procedures

    database tools
    5
    0 Votes
    5 Posts
    0 Views
    C
    Thank you, I will look into the "DOS" solution tomorrow. Sometime in the next three months we are upgrading to 2008.
  • sqlite

    database sqlite tutorial question
    5
    0 Votes
    5 Posts
    0 Views
    J
    Sory for the confusion. I should tell you that I am really very very beginer about database. I will find out how to do union and query it. thanks.
  • 0 Votes
    2 Posts
    0 Views
    L
    Can you check the path "ORACLE_BASE\ORACLE_HOME\database"? There could be an error-log for ORADIM there. I are Troll :suss: