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
  • Getting Foreign Key Constraint Error Unusually

    database debugging help
    5
    0 Votes
    5 Posts
    0 Views
    I
    Can I put my code here Thanks & Regards, Abdul Aleem Mohammad St Louis MO - USA
  • Database Design to store revisions of creating an assessment

    database design
    2
    0 Votes
    2 Posts
    0 Views
    M
    Use Word and turn on revisions... SMACK ouch Add a RevisionID field to your table and manually increment it when the user checks out the version. In your UI allow the user to "check out" a copy of the data (make another record in your table), allow the user to save the copy of the next revision and they are not allowed to check it out again until they either commit the revision or discard it. Never underestimate the power of human stupidity RAH
  • 0 Votes
    2 Posts
    0 Views
    L
    The difference is that one is written out as a subquery. It's a micro-optimization IMHO, but you can use the Management Studio[^] to check the execution plan and compare both versions. Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]
  • Database for Bridge Asset Management

    database design help tutorial question
    5
    0 Votes
    5 Posts
    0 Views
    N
    BTW there are fields that provide the bridge information,it's bridge number(p.k),name,design year,asset value and other fields. Now there are 3 different districts A,B and C.Under District A,there are different sections and road segments that correspond to A only.Same thing goes to B and C.These districts are not related in any way in other words. That's why i created 3 separate tables based on these districts.
  • 0 Votes
    6 Posts
    0 Views
    J
    I believe someone didn't get the sarcasm, (over)compensating. Be excellent to each other. And... PARTY ON, DUDES! Abraham Lincoln
  • Select statement: ordering by column name.

    database xml question
    15
    0 Votes
    15 Posts
    3 Views
    S
    Ralph, I completely forgot to try it. I just c&p into ssms but it didn't run clean and throws some errors. I need to schedule some time to look at it, but off the shelf, I couldn't run it even though I replaced the database name and table with correct values. If there is one thing more dangerous than getting between a bear and her cubs it's getting between my wife and her chocolate.
  • 0 Votes
    2 Posts
    0 Views
    S
    I'd have a read of this as a starting point. Remote Procedure call failed in SQL Server Configuration Manager[^] Every day, thousands of innocent plants are killed by vegetarians. Help end the violence EAT BACON
  • Mounting .DBF files (Oracle Database 11g)

    question database oracle
    3
    0 Votes
    3 Posts
    0 Views
    P
    Maciej Los, Thanks for your comment, But you can see the Question is Listed on OTN. The similar Question you referred is also mine. I am still in search for the solution. - Prathamesh
  • How to link pdf file in iframe ?

    sysadmin tutorial question
    2
    0 Votes
    2 Posts
    0 Views
    M
    I think you picked the wrong forum for this, it has nothing to do with Database. Never underestimate the power of human stupidity RAH
  • Return Results of a Join Using Stored Proc

    database
    4
    0 Votes
    4 Posts
    0 Views
    J
    ASPnoob wrote: Please point out why it does not work Because you are putting it into a table instead of returning it.
  • Right outer join with no ON

    database debugging help
    4
    0 Votes
    4 Posts
    0 Views
    P
    Mycroft Holmes wrote: the query designer Blech, filth. X|
  • 0 Votes
    10 Posts
    0 Views
    L
    great question. i've been having similar problems myself. addictive medications medication mistakes prescription addiction what to do for an overdose prescription narcotic abuse effects of addiction addiction signs and symptoms signs and symptoms of overdose what are symptoms of overdose what are the signs of overdose prescription drug abuse what are the side effects of painkillers
  • 0 Votes
    6 Posts
    0 Views
    G
    As a prezzie here's a stored procedure to connect to and disconnect from a linked server: --connects to and disconnects from the mysql online database --example call to connect: --dbo.LinkedServerConnect_SP @connect = 1 --example call to disconnect: --dbo.LinkedServerConnect_SP @connect = 0 CREATE PROC dbo.LinkedServerConnect_SP (@connect as int) AS BEGIN if @connect = 1 begin if not exists(select name from sys.servers where name = 'yadayada') begin EXEC sp\_addlinkedserver 'yadayada', 'MySQL', 'MSDASQL', Null, Null, 'Driver={MySQL ODBC 3.51 Driver};DB=yadayada;SERVER=mysql.yadayada.com;option=512;uid=yadayada;pwd=yadayada' end end if @connect = 0 begin if exists(select name from sys.servers where name = 'yadayada') begin EXEC sys.sp\_dropserver @server = 'yadayada', @droplogins = 'droplogins'; end end end GO “That which can be asserted without evidence, can be dismissed without evidence.” ― Christopher Hitchens
  • database

    database
    5
    0 Votes
    5 Posts
    0 Views
    B
    test
  • Update trigger.

    database question announcement
    8
    0 Votes
    8 Posts
    0 Views
    Richard DeemingR
    Well, by the highly scientific method of Google-fighting: sql trigger magic tables[^]: 413,000 results; sql trigger virtual tables[^]: 1,680,000 results; your interviewer was an idiot. :) "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
  • SSIS package question

    sql-server question database sysadmin
    4
    0 Votes
    4 Posts
    0 Views
    V
    Thank you very much. I found this excellent article that help solve my problem. http://social.msdn.microsoft.com/Forums/en-US/1d5c04c7-157f-4955-a14b-41d912d50a64/how-to-fix-error-the-microsoftaceoledb120-provider-is-not-registered-on-the-local-machine[^]
  • How to identify identical master-detail records.

    database help tutorial question
    7
    0 Votes
    7 Posts
    0 Views
    Richard DeemingR
    An up-vote before you know whether the answer works might be a bit premature. "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
  • Rank over () / row_number over in sqlite

    sqlite question
    3
    0 Votes
    3 Posts
    0 Views
    J
    i have googled a lot but no good solution ! can give samll example ? thanks in advanced
  • How to find ladder in sql query

    database help tutorial
    5
    0 Votes
    5 Posts
    0 Views
    K
    USE tempdb ; GO DECLARE @ladderTable TABLE ( Col1 INT ) ; DECLARE @incrementValue INT = 0 ; INSERT INTO @ladderTable ( Col1 ) VALUES ( 5 ), ( 10 ), ( 15 ), ( 20 ) ; SELECT TOP 1 @incrementValue = Col1 FROM @ladderTable ORDER BY Col1 ASC ; SELECT st.Col1, CAST(st.Col1 AS VARCHAR(20)) + '-' + CAST(ISNULL(dt.Col1, st.Col1 + @incrementValue) - 1 AS VARCHAR(20)) AS LadderSequence FROM @ladderTable AS st LEFT OUTER JOIN @ladderTable AS dt ON st.Col1 < dt.Col1 AND ( st.Col1 + @incrementValue ) >= dt.Col1 ; GO Thanks, Karunakar
  • Product dataabase

    help database question announcement
    8
    0 Votes
    8 Posts
    0 Views
    M
    jschell wrote: How many entries entries based on actual business cases (not developer fantasy) will it contain Damn missed that! This whole thing will be so trivial it does not matter how he builds the bloody thing! Never underestimate the power of human stupidity RAH