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
  • IN Clause Best Practices? [solved]

    question database help csharp data-structures
    4
    0 Votes
    4 Posts
    0 Views
    L
    You're welcome :)
  • Accessing mdiParent form menu from mdiChild form via code

    question help
    2
    0 Votes
    2 Posts
    0 Views
    L
    I'm not sure what this has to do with "General Database" however ... In your hormoneTypeToolStripMenuItem_Click you will need to use a reference to your MainForm, either make it global or ensure this method is part of your MainForm. Also note that your HormoneTypeForm f1 will be destroyed as soon as this method returns; I doubt that is what you want. It's time for a new signature.
  • Interesting SQL Server 2008 problem

    database performance sql-server sysadmin hardware
    5
    0 Votes
    5 Posts
    0 Views
    S
    I have noticed a few cases where the import wizard had turned into a complete pile, i really miss Enterprise Manager, Object Explorer annoyes the crap outa me. I cant figure out why an index change that shouldnt be supported on the database made everything faster, and screwed up everything but reading on the database where it should have been supported.(actually the last bit is what i expected to happen, so i understand that just fine). Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
  • bcp and int>ASCII code conversion [modified]

    database sql-server com sysadmin help
    9
    0 Votes
    9 Posts
    5 Views
    D
    Is it possible to skip -f switch (i.e. not supply format file) and let bcp to do this job herself (i.e. infer field type auto like old days?) C:\somedir\bcp.exe DEV.dbo.SomeMixedData in C:\somedir\output\output_abc_mixed.txt -n -S SomeSErver -T Starting copy... 0 rows copied. << Just can't get it working without format file. Network packet size (bytes): 4096 Clock Time (ms.) Total : 1 When open with Notepad my sample file resembles: 20100701,1.110000e+000,2.220000e+000 20100702,3.330000e+000,4.440000e+000 20100703,5.550000e+000,6.660000e+000 And my simple table: CREATE TABLE [dbo].[SomeData]( [Col1] [varchar](255) NULL, [Col2] [varchar](255) NULL, [Col3] [varchar](255) NULL ) dev modified on Tuesday, July 13, 2010 7:02 AM
  • 0 Votes
    5 Posts
    0 Views
    M
    bhiller wrote: run the query for every ID value... What with a cursor or a while loop, what happens if he has 100k IDs. This is a bad solution, using the running total tools will give a much better result. Never underestimate the power of human stupidity RAH
  • TNS Ping (.NET Library)

    csharp oracle question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • sql function fot removing negative sign

    database help
    3
    0 Votes
    3 Posts
    0 Views
    M
    So are you still storing your date data as strings? Or have you done the sensible thing and changed it to a datetime format. Sorry I already know the answer otherwise you would not be asking this question. CHANGE YOUR DATE DATA TO DATATIME FORMAT! Never underestimate the power of human stupidity RAH
  • Sum for Trend

    database help tutorial
    2
    0 Votes
    2 Posts
    0 Views
    M
    Break it into 4 queries, 1 for each time period doing the appropriate aggregation for each query, include the common key. Then join the 4 queries into 1 using the common key. I would use table vars to hold the temp data. BTW I would not put my company name in your sig, it can be incorrectly construed (look it up). Never underestimate the power of human stupidity RAH
  • auto pagination in sql

    database question
    2
    0 Votes
    2 Posts
    0 Views
    L
    Hi, There's an example over here[^] :) I are Troll :suss:
  • Complex Query

    database sql-server sysadmin
    3
    0 Votes
    3 Posts
    0 Views
    I
    Thanks, I got it in Crystal Reports only. It is fixed and your link also helps me a lot if I need it in SQL Server. Thanks & Regards, Md. Abdul Aleem NIIT technologies
  • UniqueIdentifier Foreign Key

    help question
    4
    0 Votes
    4 Posts
    0 Views
    M
    You use NEWID() to generate the new ID key, you need to trap this and pass it back to the client so it can be put into @ID for the second insert. Insert1 Does not need @ID passed in as it is not used. Create a new ID @CreatedID in the proc but outside the insert statement Insert the record using the @CreatedID After the insert select @CreatedID as NewID will return it to the client Never underestimate the power of human stupidity RAH
  • Excel to Access

    database question
    2
    0 Votes
    2 Posts
    0 Views
    R
    The answer is yes (might require some vba code). But raises the question, Why not use a form in Access? PS I'm a bit rusty on Excel/Access programming so don't ask me how. I know it can be done. Regards David R --------------------------------------------------------------- "Every program eventually becomes rococo, and then rubble." - Alan Perlis The only valid measurement of code quality: WTFs/minute.
  • Blatant advertising

    com sales question
    3
    0 Votes
    3 Posts
    0 Views
    L
    I wondered where this had gone to. If I was into drugs I'd at least have an excuse for such carelessness. :doh: It's time for a new signature.
  • SQL FUNCTION USING DATE TIME

    database help
    4
    0 Votes
    4 Posts
    0 Views
    J
    JasonShort wrote: It is always parsed correctly no matter what the locale. You don't say! :rolleyes: I was providing test data for the OP, which incidentally will parse in all locales as the month names are fully qualified.
  • sql function

    database help
    3
    0 Votes
    3 Posts
    0 Views
    J
    This is the 3rd question on the same topic. You should stick to 1 thread for 1 topic. Ive also pointed out the forum guidlines which ask you to use descriptive subject lines . "sql function" does not qualify as descriptive in a sql forum. The forum guidlines should also include the request to put code within formatted code blocks for ease of reading (if it doesnt it should). Furthermore, you have not given any response to the answers youve been given below, so we have no idea if were even on the right track. Lastly, Ive already answered this question below.
  • sql

    database help
    6
    0 Votes
    6 Posts
    0 Views
    M
    I don't have a problem with the splitting of the date/time I can think of a number of valid reasons to do that in SQL. What had I missed was that he had stored the data as text, I assumed it was datetime. Never underestimate the power of human stupidity RAH
  • stored procedure

    database help
    2
    0 Votes
    2 Posts
    0 Views
    M
    Use dateparts to remove the time component of the fields with time values. You can also do a double convert > varchar using a formater convert(varchar(20),date,103), then convert the result back to datetime format and use that in the report Never underestimate the power of human stupidity RAH
  • Linked Server

    sysadmin
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Dynamic SQL and the Crystal Report

    database tutorial
    2
    0 Votes
    2 Posts
    0 Views
    M
    I think you will find the MS discovery will also not get and fields either. I'm not sure (never read up on it) just what magic they use to get the columns but it cannot work with dynamic sql. This seems perfectly reasonable to me as dynamic sql allows you to change the column names - 1 dead report. Usually dynamic sql indicates a change of underlying object, database, server, table or column structure. Unless it is columns then just dummy up a proc for design purposes. Never underestimate the power of human stupidity RAH
  • 0 Votes
    2 Posts
    0 Views
    M
    The answer to this is, as always, it depends. It depends on the quantity of data, the portability required, the type of data, the type of application and possibly a few others. As a starter I would consider XML (XAML is for markup) only for minimal data that is only relevant to the current user on the current machine. Never underestimate the power of human stupidity RAH