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
  • 0 Votes
    4 Posts
    0 Views
    H
    That was it - it supports the ? syntax but fell over on the :name syntax, but only the :name syntax is in their documentation. :doh:
  • DTS not working in sql 2008

    database sql-server sysadmin help question
    3
    0 Votes
    3 Posts
    0 Views
    M
    Rewrite the bloody thing, you are relying on a conversion utility to work perfectly, they almost never do, especially with anything that is even mildly complex. Never underestimate the power of human stupidity RAH
  • SSRS Help

    question database sql-server help career
    3
    0 Votes
    3 Posts
    0 Views
    A
    so, here is what I am doing so far: we have an SSRS server that is already up and running, so I put my report on that server so people in HR can get to the applications while at work. Now, we're dealing with multiple HR groups on different domains, so I want to place it on the web server so everyone can hit it but I am lost on how to configure SSRS to run on the run on the server. I can get it installed and up, but when I change the urls/virtual directories for SSRS it all goes to pot. What am I doing wrong?
  • using ?: operation in sql server 2008

    help question database sql-server sysadmin
    5
    0 Votes
    5 Posts
    0 Views
    R
    very nice thanks
  • Changing DAO to ADO

    c++ question
    2
    0 Votes
    2 Posts
    0 Views
    K
    Answering my own question - perhaps dbAx is what I want dbAx: a C++ Library for ActiveX Data Objects (ADO)[^]
  • Stored procedure from SSIS

    help sharepoint database sql-server cryptography
    5
    0 Votes
    5 Posts
    5 Views
    U
    Ok, cool. Glad to assist if you should need further assistance. :cool:
  • Run Package Parameters

    question database sql-server com sysadmin
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Comparing Table Entries Using C# and MS Access

    database csharp help career
    2
    0 Votes
    2 Posts
    3 Views
    J
    Okay, so that's just a lot of text, and the question seems to be drowning in it. That's why nobody is answering I guess. So I will answer what I am guessing is the core question here: The basic idea is to get the list with sql, compare stuff and change values with C# and finally update these values with sql. So first of all you'll want to use an UPDATE query instead of removing and reinserting each row. //So this indeed gets you the list. OleDbCommand dbCommand = new OleDbCommand("SELECT * FROM tblUsers", this._dbConnection); //Your reader then loops through the rows and you compare and check stuff //Then you apply some logic, and determine what the values should be //And then somewhere at the end of your reader loop you actually update your database like so: OleDbCommand dbUpdateCommand = new OleDbCommand("UPDATE tblUsers " _ "SET FieldOne = @ParameterOne " _ ", FieldTwo = @ParameterTwo " _ "WHERE KeyField = @ParameterThree ", this._dbConnection); dbUpdateCommand.Parameters.Add("@ParameterOne", _ SqlDbType.NVarChar).Value = SomeVariableHoldingTheValueInQuestion; dbUpdateCommand.ExecuteNonQuery; N.B. You may have to use a second connection for the update (I don't remember for sure)... N.B. I used the syntax for MS SQL. You may have to adapt it to MS Access syntax, as it often uses its own slightly different version. You can check this by building a simple update query with the MS Access Query wizard / query builder. A coding tip: try to avoid using index numbers for database fields in your code: currentUser.Name = userData["UserName"].ToString(); is better than currentUser.Name = userData[0].ToString(); because otherwise when you make a change in your database table or in the query, that will change the order of the fields, and then your code will run amok. Or you will be forced to edit your code all the time, and figure out which field is which index number over and over. My advice is free, and you may get what you paid for.
  • Lookup Columns In Access via Linked Data?

    database question sql-server sysadmin help
    14
    0 Votes
    14 Posts
    0 Views
    M
    Alright, that sounds reasonable. I will look into it more. Until then I will use my current "report" generation. :-)
  • 0 Votes
    5 Posts
    0 Views
    T
    Pretty much what I was thinking. Thanks for you help.
  • SQL Jobs Output

    database sharepoint help tutorial question
    3
    0 Votes
    3 Posts
    0 Views
    G
    You understood it perfectly. I had been looking at BCP and tried to format it correctly (from the command prompt, not sqlcmd), but it bugged on my nested stored procedures. Haven't looked at SSIS yet, gonna do that now. But I'm getting off-topic. You answered my question.
  • Show Statement

    mysql help question
    7
    0 Votes
    7 Posts
    0 Views
    L
    Do you have the source-code of the function? There's your answer :) Bastard Programmer from Hell :suss:
  • problem trying to use UNION in the sql query

    database help
    3
    0 Votes
    3 Posts
    0 Views
    C
    What is the type for the column ROOM_PHONE. From your error, I bet it is numeric. In the second select change the final '' column to be to_number(NULL). That might make a difference. :) 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] posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
  • is these two queries same?

    question
    3
    0 Votes
    3 Posts
    0 Views
    D
    ya thank you.. suchita
  • My Ox is Flummed!

    database workspace csharp sql-server visual-studio
    6
    0 Votes
    6 Posts
    0 Views
    J
    TheComputerMan wrote: Sorry what assumption am I making? It would of course be your assumption, so there is no way for me to know what it is. You have an impossible situation. Since computers are deterministic that means that you made an assumption which is wrong. You can't find assumptions by looking at code (although code might have been written with an assumption in mind.)
  • 0 Votes
    4 Posts
    0 Views
    J
    Certainly the following is going to have some sort of impact. http://download.oracle.com/docs/cd/B19306_01/server.102/b14225/ch4datetime.htm#CACFFHCJ[^]
  • 0 Votes
    4 Posts
    0 Views
    L
    I'd probably do it like this. The main difference is making each [xx-yy] field a subquery, and using BETWEEN rather than doubling up the datediff's. select SUM(ARO.TOTALAMOUNT) AS SUM_OF_TOTALAMOUNT, [0-30 days] = (select sum(SUM_OF_TOTALAMOUNT) from <your table joins> where datediff(dd, CLM.SHIP_DT_CH,getdate()) <= 30), [31-60 days] = (select sum(SUM_OF_TOTALAMOUNT) from <your table joins> where datediff(dd, CLM.SHIP_DT_CH,getdate()) between 31 and 60), [61-90 days] = (select sum(SUM_OF_TOTALAMOUNT) from <your table joins> where datediff(dd, CLM.SHIP_DT_CH,getdate()) between 61 and 90), [91-180 days] = (select sum(SUM_OF_TOTALAMOUNT) from <your table joins> where datediff(dd, CLM.SHIP_DT_CH,getdate()) between 91 and 180), [181-360 days] = (select sum(SUM_OF_TOTALAMOUNT) from <your table joins> where datediff(dd, CLM.SHIP_DT_CH,getdate()) between 181 and 360), [over 360 days] = (select sum(SUM_OF_TOTALAMOUNT) from <your table joins> where datediff(dd, CLM.SHIP_DT_CH,getdate()) >= 361) from <your table joins> group by <your grouping> order by <your ordering> desc modified on Tuesday, June 21, 2011 3:23 PM
  • 0 Votes
    2 Posts
    0 Views
    U
    From SQL Server Management Studio 2008 R2: you can RT-click the database in question, choose Tasks -> Generate Scripts and select the objects you'd like to script out that way. There is an option to save each object to a separate file ("single file per object" option, I believe).
  • Convert MSSQL database to MySQL database

    question database mysql sql-server
    4
    0 Votes
    4 Posts
    0 Views
    O
    Convertion of MSSQL database to MySQL database can mean a lot of things. Migration of Tables and Data. Migration of stored proc, triggers etc. Doing the first one is relatively easy and less labour intensive and can be done in a lot of ways. One example would be first to generate the create table scripts and edit them to suit MySQL. Execute these to create the tables in MySQL. Export the data from MSSQL to MySQL. Lastly apply the foreign keys. For each of these steps, there are tools available. The below mentioned link may help you. http://kofler.info/english/mssql2mysql/[^] -- obhijitghosh
  • 0 Votes
    2 Posts
    2 Views
    M
    In order to fill in the parameters you would use the same type of code from the INSERT statement generation: command.Parameters.Add(this._userDataSet.tblUsers.ID_NAMEColumn.ColumnName, OleDbType.VarChar, this._userDataSet.tblUsers.ID_NAMEColumn.MaxLength, "ID_NAME"); command.Parameters.Add(this._userDataSet.tblUsers.ID_PASSWORDColumn.ColumnName, OleDbType.VarChar, this._userDataSet.tblUsers.ID_PASSWORDColumn.MaxLength, "ID_PASSWORD"); // Etc., etc. You would change the OleDbType to the appropriate type for the parameter. And you change the last parameter to the name of the field. Does that make sense? Hopefully this helps. I answered based on what I could gather from your questions.