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
    3 Posts
    0 Views
    C
    Hi Scott,Thanks and lot. I got it. It is working fine from my end . Thanks Chandra
  • erd concepts

    question
    2
    0 Votes
    2 Posts
    0 Views
    M
    If he can be in only 1 MB at a time then it is one to many. If you need a history of membership then it requires a different design, either m-m or an archive record. Never underestimate the power of human stupidity RAH
  • Excel, OleDb, ACE, and skipping header rows

    csharp database sql-server com sysadmin
    6
    0 Votes
    6 Posts
    1 Views
    J
    I never knew about the space problem, thanks for the feedback. I can't think of any workaround at the moment, but I'm having a look at it tomorrow as I'm having a potential bug in one of my programs. Light moves faster than sound. That is why some people appear bright, until you hear them speak. List of common misconceptions
  • data base system

    com help question
    2
    0 Votes
    2 Posts
    0 Views
    L
    You draw an arrow from one entity to the other. Done. Did you mean in code? What database-system? Here's one in SQL92; CREATE TABLE Car ( cId INTEGER, Description CHARACTER VARYING(50), PRIMARY KEY (cId) ) CREATE TABLE CarPurchase ( pId INTEGER, boughtCar INTEGER, PRIMARY KEY (pId), FOREIGN KEY (boughtCar) REFERENCES Car ) This syntax should work on most systems. Bastard Programmer from Hell :suss:
  • 0 Votes
    2 Posts
    0 Views
    L
    Yhat should be possible using a query. Add a computed field that indicates whether it's a number or a range of characters, and put that as the first column to sort on. Or check out the collations if you're on Sql Server - might be as easy as changing the setting and have the server order everything in the correct way for your locale. Bastard Programmer from Hell :suss:
  • Serial number in SQL

    database help tutorial
    4
    0 Votes
    4 Posts
    20 Views
    D
    I got another solution select * from ABC t,( select level R from dual connect by level <= 6) t1 where t.SEQUENCE(+) = t1.r order by r
  • One to Many Relationships - Tabular Display

    database question
    8
    0 Votes
    8 Posts
    0 Views
    E
    It does not have a native pivot feature, but your aggregate / group by solution will work perfectly. Cheers, --EA
  • Sybase DB access in windows 7

    database csharp sysadmin help question
    2
    0 Votes
    2 Posts
    0 Views
    J
    The coding part is completely correct, file connection is open and closed also. I guess window 7 does not support this function. best face cleanser
  • export to text file + SQL

    database tutorial question
    4
    0 Votes
    4 Posts
    0 Views
    J
    Thanks For Reply . I have use this code : EXEC master.dbo.sp_configure 'show advanced options', 1 RECONFIGURE EXEC master.dbo.sp_configure 'xp_cmdshell', 1 RECONFIGURE EXEC xp_cmdshell 'bcp "SELECT * FROM Silver.tblGroups" queryout "C:\bcptest2.txt" -T -S ALIJOONASUS\wintapsqlexpress -c -t,' But i wanna to have UTF-8 text file. and Secondly : How to have Columns Name also
  • 0 Votes
    6 Posts
    0 Views
    P
    You could develop a small app which can be run as a scheduled task every minute or so which will capture data changed from Oracle and transfer to SQL Server. You will need something on Oracle which will place the data in a temporary storage area (probably a table) eg trigger or addition to stored procedures etc. This could be as simple as creating an insert or update statement etc. This will be captured by the app and executed on SQL Server.
  • xBase question

    question css data-structures
    10
    0 Votes
    10 Posts
    0 Views
    K
    Lucky you :) The thing to remember is that you really don't know what's in a variable until runtime. In FoxPro you can do Customer = "Smith" Customer = CreateObject("Excel.Application") Customer = .T. Now a later version of FoxPro added the 'AS' keyword: LOCAL CustomerName AS String but this is for intellisense only and doesn't constrain the variable to a type, so you can still do LOCAL CustomerName AS String CustomerName = 10+5 It's not uncommon in older apps to see a variable declared as Public in the startup program, then see its value changed all over the place. This is hell on earth. Here's a FoxPro forum [^]you can use. I'v been a member there for many years, and most people there are very knnowledegable. If it's not broken, fix it until it is
  • How to Update Database SQL express DB

    database csharp tutorial announcement sharepoint
    3
    0 Votes
    3 Posts
    0 Views
    J
    thanks for reply! but i wanna to update my database (it should compare the old database with the Newest one and update the old one ...if need Add/Update/Delete SP,View,table,schema,...) in other word : the customers have previous application and database (full with their specific data). Now a new version is ready and the customer gets the update. In the mean time we made some modification on DB (new table, columns, maybe an old column deleted, or whatever). I’m pretty new in Linq and also SQL databases and my first solution can be: I check the applications/databases version and implement all the changes step by step comparing all tables, columns, keys, constrains, etc. (all this new information I have in my dbml and the old I asked from the existing DB). And I’ll do this each time the version changed. But somehow I feel, this is NOT a smart solution so I look for a general solution of this problem.
  • Oracle: Replace single occurrence of a character

    question oracle regex help tutorial
    2
    0 Votes
    2 Posts
    0 Views
    R
    why don't you rely on occurence of special character.if it more than one,don't replace. simply if-else case.. cheers!!! Vatsa www.objectiveprogramming.com
  • SQL Table Description

    database sql-server sysadmin help tutorial
    3
    0 Votes
    3 Posts
    0 Views
    K
    Thanks. I also found this[^] If it's not broken, fix it until it is
  • Linq to Sql

    database csharp linq tutorial question
    2
    0 Votes
    2 Posts
    0 Views
    K
    sindhuan wrote: Is this the right way to do?? No, because dc.users.InsertOnSubmit("us"); won't even compile, because you're trying to insert a string "ur". Your code is expecting an entity of type user. So you want dc.users.InsertOnSubmit(us); So, you first want to query the user to get the name, then insert the new row. using (MyDataContext dc = new MyDataContext()) { var userName = (from u in dc.tblUsers where u.Id = someId select u.UserName).FirstOrDefault(); user us = new user { Date = DateTime.Now, name = userName }; try { dc.users.InsertOnSubmit(us); } catch(Exception e) { // Handle exception here } } You will have to adjust the data context and table names and column names, but this should get you started. If it's not broken, fix it until it is
  • Doubt in a piece of code [Transact-SQL database audit].

    database css com sysadmin help
    4
    0 Votes
    4 Posts
    0 Views
    C
    One thing to remember about T-SQL is that by default if you have a null in an expression the expression is null. Thus COALESCE(@PKCols + ' and', ' on') would return ' on' if @PKCols is null as NULL + ' and' returns NULL. Also NULL cannot be compared to another NULL as in WHERE NULL = NULL because this returns NULL not true or false. This gets me on occasion. Besides the COALESCE function there is ISNULL, used like WHERE ISNULL(@PKCols, '') <> '' Hope this is more helpful than confusing.
  • 0 Votes
    5 Posts
    0 Views
    L
    First, the answer to your question; BACKUP[^] and RESTORE[^]. carm_ella wrote: I want the code sir. You have been given links to the manual. I suggest you read it and write the code. Bastard Programmer from Hell :suss:
  • Oracle Question: Split String into two

    question oracle help tutorial
    4
    0 Votes
    4 Posts
    0 Views
    J
    You're welcome Light moves faster than sound. That is why some people appear bright, until you hear them speak. List of common misconceptions
  • timestamp

    question database
    2
    0 Votes
    2 Posts
    0 Views
    L
    MSDN[^] states: Is a data type that exposes automatically generated, unique binary numbers within a database. timestamp is generally used as a mechanism for version-stamping table rows. The storage size is 8 bytes. The timestamp data type is just an incrementing number and does not preserve a date or a time. To record a date or time, use a datetime data type. You're welcome :) Bastard Programmer from Hell :suss:
  • 0 Votes
    4 Posts
    0 Views
    L
    I think he's using Microsoft Access, not Sql Server :rolleyes: Bastard Programmer from Hell :suss: