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
  • Older generation SQL syntax - Oracle

    help database oracle question
    4
    0 Votes
    4 Posts
    0 Views
    L
    If this is still confusing, you can create a view with the expression and then do your join on the view.
  • Having a bad SQL day

    database com help question announcement
    10
    0 Votes
    10 Posts
    0 Views
    J
    Yes, thats equivalent. I just prefer the readability of the CTE (which is merely an opinion) plus that you can refer to a CTE in more than one place. "The ones who care enough to do it right care too much to compromise." Matthew Faithfull
  • Is it possible to print a variable in stored procedure

    database
    3
    0 Votes
    3 Posts
    0 Views
    V
    The printed value has to be a varchar or char. So, please cast the value to a varchar before printing.
  • How do I get Distinct entries from Duplicate records?

    question json
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • SQL Server 2008

    database sql-server design sysadmin sales
    3
    0 Votes
    3 Posts
    0 Views
    J
    Table: site - id - Site_name - Site_url Table: site_parameter - id - Site_id (foreign key to above table) - name - value For "26 parameters" you would have 26 rows in the site_parameter table.
  • Visual Studio 2005 Access 2010 Database

    csharp database visual-studio question
    2
    0 Votes
    2 Posts
    0 Views
    M
    Yes G to connectionstrings.com as a research beginning. Never underestimate the power of human stupidity RAH
  • 0 Votes
    2 Posts
    0 Views
    M
    Sounds to me like you are doing something dramatically wrong, running a simulation on production data, therefore requiring the roll back, or building a business process on cancelling a transaction. A more normal method of simulating would be to restore production to another instance, run the process to completion and then restore again to repeat. Never underestimate the power of human stupidity RAH
  • Missing Data in an Access Report

    csharp database asp-net com
    9
    0 Votes
    9 Posts
    2 Views
    J
    Vuyiswa Maseko wrote: Requirements in Software Development or in any industry might sometimes overcome the basic understanding of what makes sense to you. That it true to a limited extent. HOWEVER 1. That doesn't mean that the requirements are always right. 2. That doesn't mean that the requirements are always complete. 3 That doesn't mean that the requirement are always understood. 4 That doesn't mean that the requirements are always possible nor logical. A professional developer must be willing and capable of recognizing when there is a flaw in the requirements and tell the business people what those are so together they can work towards a solution that meets the business needs. And as a guess in terms of this posting, for what you posted, I would suppose that #2 in the above was the problem. Since presumably you already knew you needed to produce indivdiual pages in an electronic form and not just one massive single paper report. At least I am hoping that is what your other post meant.
  • Propagating a MySQL transaction with MSMQ II

    mysql question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • oracle error with winserver2008

    help oracle design sysadmin data-structures
    2
    0 Votes
    2 Posts
    0 Views
    B
    Oracle provides the error code - just google for ORA-00161. Looks like a problem with the different data providers you installed on the machines.
  • 0 Votes
    1 Posts
    0 Views
    No one has replied
  • 0 Votes
    6 Posts
    0 Views
    J
    devvvy wrote: I think it's the opposite. CHAR don't store trailing termination char (2 bytes for SQL), varchar does Not sure what that statement means. The 'char' data type is fixed length. That means that there will ALWAYS be 255 characters. And the way normal APIs to databases handle that is that they pad shorter lengths with spaces. Pretty sure that is an ANSI requirement as well. devvvy wrote: that's why you should always use VARCHAR(n) as supposed to VARCHAR(MAX) Unless of course you know that you will be storing data larger than the largest integer value allowed for varchar(n). devvvy wrote: CHAR(n) when lenght same for all/most rows. In normal database design most columns will be varchar because 1. User data is almost always variable 2. Application data that is text almost always has a variable length.
  • check before insert

    help question career
    11
    0 Votes
    11 Posts
    0 Views
    C
    You can use the begin tran or try catch within the T-SQL. If you raise an error on failure you can then have C# rerun the data if that is what you want.
  • Encrypt a field in the database.

    database csharp sql-server sysadmin question
    3
    0 Votes
    3 Posts
    0 Views
    E
    I have not seen encrypting one field as a function of a SQL database. Most of the time encryption and decryption is performed at the application level. I can't speak for other programmers, but I use a salted MD5 algorithm in my code that encrypts and decrypts password fields and other sensitive data. http://stackoverflow.com/questions/5061003/how-to-encrypt-the-password-column[^]
  • SP Unexpected Behavior

    database sharepoint tools regex question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • 0 Votes
    6 Posts
    0 Views
    Y
    HI, this is how it worked for me INSERT INTO TABLE2 (COL1, COL2, QL_FLG, ST_FLG, PA_FLG) (SELECT COL1, COL2, DECODE(INSTR(COL2,'QL'),0,0,1) QL_FLG, DECODE(INSTR(COL2,'ST'),0,0,1) ST_FLG, DECODE(INSTR(COL2,'PA'),0,0,1) PA_FLG FROM TABLE1); Thank you so much for your help.
  • how to comlex databinding with access database

    tutorial database wpf wcf
    5
    0 Votes
    5 Posts
    0 Views
    A
    please i already know how to bind combo box to access database but my problem is : i have 2 combo box the combobox1 binding to table1 which has 3 records as follow college name ____________ college of engineering college of science table 2 has 2 column college of engineering department College of Science _________________________________ ___________________ civil eng department Department of botany electronic eng.department Department of biology computer eng.department Department of physics table 2 binding to combo box 1 so if combo box 1 display member is college of science the combobox2 automatically diplay only college of science column
  • SQL Update

    database help announcement
    22
    0 Votes
    22 Posts
    1 Views
    J
    PIEBALDconsult wrote: If you're going to teach a man to fish, do it right The point here however is not how to fish. Rather it is how to use a spinner when trolling for big mouth bass at dawn around slow moving water amoungst rocks. Which is something that someone might need to know. But not without the qualification. And it is not teaching them how to fish.
  • Identify DML changes between two databases

    database tutorial sql-server sysadmin tools
    3
    0 Votes
    3 Posts
    0 Views
    U
    In Red-gates data compare, please let me know how to get the scripts to merge data?
  • End Case in a Variable

    database help
    4
    0 Votes
    4 Posts
    0 Views
    M
    You are combining a select query and an assignment query, not allowed! You need to nest your case statements as you need to test the case for each record, variable assignment is a once only operation (using a cursor spit would allow you to do the record by record processing). This example test the value of flag but note that it must know what to expect in the nested case, your ... cannot be a random date, it must be a testable value! SELECT Records, CASE Flag WHEN 'FX' THEN CASE Records WHEN 0 THEN 'Failed' ELSE 'Ok' END WHEN 'MM' THEN CASE Records WHEN 0 THEN 'Failed' ELSE 'Ok' END WHEN 'TZ' THEN CASE Records WHEN 0 THEN 'Failed' ELSE 'Ok' END END FROM ProcessLog PL Never underestimate the power of human stupidity RAH