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
  • User Group Membership

    question css database tutorial workspace
    11
    0 Votes
    11 Posts
    0 Views
    S
    I would use you solution but with a slight change. I would include all columns common to Client and lawyer in the user class. i.e First, Last. If there are few columns that are different for Client and Lawyer, I would just role everything up to User, and allow nulls for those columns which don't apply to both client and lawyer. You will need some business rules to determine when those null fields should have a value.
  • Database diagram in system databases

    database
    3
    0 Votes
    3 Posts
    0 Views
    S
    You could look at the constaints on the foreign key. Does it allow duplicates, does it allow nulls?
  • Null handling oddity

    database sql-server visual-studio com game-dev
    9
    0 Votes
    9 Posts
    0 Views
    T
    Gaaaah, I finally found the cause of the problem. I apparently created my original sproc with "SET ANSI_NULLS OFF". By default queries in management studio runs with ANSI_NULLS ON. DOH![^] For a simple example of the sproc I was playing with: create PROCEDURE [dbo].[Bob_Test] @MaterialNumber varchar(18) AS DECLARE @Replace varchar(18) SELECT @MaterialNumber IF (@Replace != '') SET @MaterialNumber = @Replace SELECT @MaterialNumber When I call this with ANSI_NULLS OFF Bob_Test '123456' my results show 123456 from the first select in the sproc, and NULL for the select after the if statement. With ANSI_NULLS ON both selects return 123456. My faith SQL Server has been restored. Tune in next week for more inept coding... :cool: Kill some time, play my game Hop Cheops[^]
  • Conditional clause form two tables in sql server

    database sql-server sysadmin
    9
    0 Votes
    9 Posts
    12 Views
    S
    You could use SELECT Col1.T1, Col2.T1, Col3.T1 FROM table1 T1 join table2 T2 ON T1.Col1=Coln.T2 OR SELECT Col1.T1, Col2.T1, Col3.T1 FROM table1 T1 WHERE COL1 in (SELECT Col1 FROM table 2 where Coln=something1 and colm=somethingelse and yadayada)
  • 0 Votes
    2 Posts
    0 Views
    J
    I would migrate to .net and make it DB agnostic using DBProviderFactories[^]. Then you can choose your poison in the app.config section. Light moves faster than sound. That is why some people appear bright, until you hear them speak. List of common misconceptions
  • 0 Votes
    3 Posts
    0 Views
    A
    Thank you very much Be Happy
  • How to Insert Record In MYSQL

    help database mysql xml tutorial
    5
    0 Votes
    5 Posts
    0 Views
    S
    u can use BULKinsert
  • MS-SQL Server querry question

    database sql-server sysadmin question
    4
    0 Votes
    4 Posts
    0 Views
    S
    select * from table1 where SUBSTRING(table1.column2,1,2) like '%@param1%' or SUBSTRING(table1.column2,1,2)>'%@param2%' use dynamic query
  • Parameter names of Stored Procedures

    help tutorial question
    5
    0 Votes
    5 Posts
    0 Views
    S
    yap it will work
  • Error message; with not much out on Google on this error

    help
    3
    0 Votes
    3 Posts
    0 Views
    L
    Remove the NOLOCK; the insert is messing up some reads. Bastard Programmer from Hell :suss:
  • Problem with Multiple search Stored Procedure

    database help sharepoint
    5
    0 Votes
    5 Posts
    0 Views
    S
    Eddy Vluggen wrote: Why is there a commit, if you are only selecting records? Just to be sure that he is committed to selecting records only. Nothing else! :)
  • 0 Votes
    5 Posts
    0 Views
    D
    Solved the issue. Parameters can be specified that don't show up in the list of preview items. If these parameters are returned (the IF conditions are met and the different view is instead displayed) then these parameters have the requisite value, otherwise they don't and aren't applicable. Thank you for the attempts to answer my question but they were all incorrect.
  • 0 Votes
    10 Posts
    0 Views
    S
    Why would you want to duplicate data this way?
  • client informs client

    csharp database php sql-server winforms
    14
    0 Votes
    14 Posts
    0 Views
    L
    My pleasure, and thanks :)
  • VS2010 Database Project Problem

    database help visual-studio com beta-testing
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • 0 Votes
    5 Posts
    0 Views
    L
    chuckcan08 wrote: this could will work FTFY :-)
  • Making my DB faster

    database sql-server design sysadmin question
    4
    0 Votes
    4 Posts
    0 Views
    L
    Database Engine Tuning Advisor[^] might be of help.
  • Email notificatiion for due date of task

    database sql-server sysadmin question career
    2
    0 Votes
    2 Posts
    0 Views
    M
    Create a job that checks the data store where the job is, compare the system date with the job due date, get the email address from the employee table and send the email using SQL mail. The information about jobs can be found using sysobjects and the related sys% tables. You will need to do some research as to where it can be found. Employee information is your problem. Never underestimate the power of human stupidity RAH
  • 0 Votes
    4 Posts
    0 Views
    S
    One idea could be do to disable all relations/checks/constraints on the report tables, execute CDC statements and then re enable relations/checks/constraints. Your execution should handle errors nicely though for this to work. Shreekar
  • Resetting 'Identity Specification' column in Sql Table

    question help database
    12
    0 Votes
    12 Posts
    0 Views
    J
    unclejimbob wrote: I can't ever recall anyone suggesting that 2 lines of code (delete/reseed) is somehow better than 1 (truncate) and yes, I've been at this game at least as long as you have. Hopefully that statement is flippant. There are in fact differences between using delete and truncate, especially in SQL Server, which have nothing to do with this discussion. And those differences are the reasons is should be used with care and why it is seldom needed. Choosing the correct one has nothing to do with the number of lines. And there is very little in programmng that should be based solely on line count. (It isn't even a good developer productivity metric.) unclejimbob wrote: Indidivuals who come in after the fact and attempt to rate your contribution based upon their own close-enough-is-good-enough two-second evaluation are, of course, putting you down - don't accept it This site is set up specifically to allow rating answers. Especially on technical questions. That is what the "Rate this message" is for. And one need not even explain why they give it a good or bad rating. Moreover I think that any technical site that doesn't allow and expect discourse on the correctness of answers is probably worthless.