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
  • IMPORT DBF File into SQL 2000

    database sql-server sysadmin help question
    4
    0 Votes
    4 Posts
    0 Views
    I
    You can use Import Data Option exists in Sql Server but it will not let you insert data if their are any constrains made on the column of the tables means if their are constrains like no duplicate etc... then it will not let you otherwise it will work here are some softwares for merging data also http://wareseeker.com/free-sql-merge-tables/[^] i made one utility which exports data into an xml file then can import that data into sql server if you can make a utility then it will be another option Best Of Regards, SOFTDEV Sad like books with torn pages, sad like unfinished stories ...
  • What is SQL Query:Master child table [modified]

    database question
    5
    0 Votes
    5 Posts
    0 Views
    N
    Below is the query for your requirement. You need to group by each field that you want in the select statement. SELECT Fee.Payable, ISNULL( SUM(Fee_Detail.Paid) ,0) FROM Fee Left Outer Join Fee_Detail ON Fee.PK_Id = Fee_Detail.FK_Id Group By FK_Id, Fee.Payable Hope it helps you.
  • Managing Database Updates

    announcement database help question sysadmin
    7
    0 Votes
    7 Posts
    1 Views
    M
    I now find I have quite a few "attribute" tables in my schemas. Customer now wants 2nd mobile - add a phone attribute linked to the customer table. I have one app that is ALL attributes, it tends to get nasty when trying to retrieve data, monstrous number of joins. Which goes to prove you can go too far down that path.
  • Logging

    question database tutorial announcement
    12
    0 Votes
    12 Posts
    1 Views
    A
    So you used a generic logging system and it slowed your system. No big suprise there. As I said, we use triggers for auditing and have never had performance issues, but we write them ourselves so they are optimised for our system, with the audit tables properly located and indexed etc. You may have had a bad experience with triggers, but do not assume they are bad, its just a case of using them properly - I have no experience of ApexSQLAudit, but I wouldn't expect some generic product to be as performant as one written specifically for your database by someone who knows what they are doing. Bob Ashfield Consultants Ltd Proud to be a 2009 Code Project MVP
  • 0 Votes
    3 Posts
    1 Views
    I
    i will not talk about Normalization here and will post only regarding your question only try to use "NOT IN " in query select ID from T_country where id not in (select ID from P_country) if you dont have any keys then use the common fields exists in both the tables like in your case you can use Country Name but will not recommend you makes query so slow try to use any numeric fields and you can also use not equal join Best Of Regards, SOFTDEV Sad like books with torn pages, sad like unfinished stories ...
  • SQL 200 and SQL 2000

    csharp c++ asp-net database
    3
    0 Votes
    3 Posts
    1 Views
    V
    Thank you , The Problem was not on the SQL side. we have a C++ App and the Developer is developing in his way and i think the Connection string is hard coded and that is a bad idea. but the problem is now resolved. i had to check the registry to resolve it. Thanks Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/
  • Problem to configuring reporting services

    help database sql-server html com
    1
    0 Votes
    1 Posts
    3 Views
    No one has replied
  • Trigger not firing in SQL Server 2000

    database csharp sql-server sysadmin tools
    2
    0 Votes
    2 Posts
    2 Views
    A
    This is weird.. If any insert operation is made trigger gets fired automatically. Open SQL Server profiler -> and check what exactly is running from inside that application. It must be invoking some insert statement on the database. :) Abhishek Sur My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB **Don't forget to click "Good Answer" if you like to.
  • 0 Votes
    4 Posts
    6 Views
    J
    Abhishek, Here is the class I am using (along with my AssemblyInfo file).   The only section at this point I am worrying about is the ExcelTester...I had the chgCardRead working by calling it in SQL on Monday, but again, something has gone wrong and I'm at a loss.   Also, I am creating the assemblies as Unsafe already.   Like I said before, it worked just fine and then just stopped and I have no idea why.   Thank you for your assistance. Option Strict Off Imports System.Data.OleDb Imports System.Data.SqlClient Imports System.Data.SqlTypes Imports System.Reflection Imports System.Data Imports System.IO Imports System.Runtime.InteropServices Imports System Imports Microsoft.Win32 Imports System.Data.OleDb.OleDbPermission <ComClass(ChargeCardCom.ClassId, ChargeCardCom.InterfaceId, ChargeCardCom.EventsId)> _ Public Class ChargeCardCom #Region "COM GUIDs"       ' These   GUIDs provide the COM identity for this class       ' and its COM interfaces. If you change them, existing       ' clients will no longer be able to access the class.       Public Const ClassId As String = "2DF8ED1A-55D0-4EC1-AF8E-1611FF6C631E"       Public Const InterfaceId As String = "14CA7221-FBFD-4D6C-92B3-E60EAD6B48D7"       Public Const EventsId As String = "F994EEB1-4001-444C-BF01-09EA090B7CA6"       'Public Const ClassId As String = "d05374f7-f2e0-4c82-badc-2f5f93c6f1b1"       'Public Const InterfaceId As String = "b4d276c1-6548-4d70-9c05-e9e1e034c55a"       'Public Const EventsId As String = "0d3e3508-c31e-45df-b41a-b4bd0997fcb4" #End Region       ' A creatable COM class must have a Public Sub New()       ' with no parameters, otherwise, the class will not be       ' registered in the COM registry and cannot be created       ' via CreateObject.       Public Sub New()             MyBase.New()       End Sub       Public Shared Function ExcelTester() As String             Log("in tester")             Dim xlconn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\10098
  • 0 Votes
    3 Posts
    1 Views
    R
    Thank you! I posted it in the design and architecture forum. I did not know it was there. You can never try. You either do it or you don't.
  • SQL Server FDHOST

    sysadmin question c++ database sql-server
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • help writing query

    question database help
    5
    0 Votes
    5 Posts
    0 Views
    D
    Remember that SQL unions are based on set theory, so if value A is from table 1 and value A is also from table 2 you would only get one value A is your result set. By introducing the sort indicator that "Ashfield" suggests, you would get 2 values of A. You would get 1,A and 2,A. I'm not sure if this would impact your algorithm, but I just wanted to make you aware of it. Cheers, David
  • Help for an SQL query

    database sales help question
    4
    0 Votes
    4 Posts
    1 Views
    D
    I have already told you what the problem is. Re-read my previous post. You are not including the date on the Sales table in your query.
  • easy_odbc leak memory

    question database performance help
    4
    0 Votes
    4 Posts
    0 Views
    A
    Ok, I didn't realise it was based on a CP article. Your best bet is to leave a message for the author (at the end of the article) as they should have an idea about the problem. Bob Ashfield Consultants Ltd Proud to be a 2009 Code Project MVP
  • Script Check

    tools question learning csharp database
    3
    0 Votes
    3 Posts
    1 Views
    M
    See, this is why I love this site :-D I like your script better and will steal it! Now , to figure out how to realize that there are changes! If the post was helpful, please vote, eh! Current activities: Book: Devils by Fyodor Dostoyevsky Project: Hospital Automation, final stage Learning: Image analysis, LINQ Now and forever, defiant to the end. What is Multiple Sclerosis[^]?
  • update issue

    csharp database mcp help announcement
    5
    0 Votes
    5 Posts
    1 Views
    N
    Hi, I really cannot understand your requirement. What you are trying to achieve, is not at all clear in the statement presented here. I fully agree with Abhishek. However, if you invoke the statement "update tale1 set substring(orderno,6,2) = 'tt'" you will get the following error "Msg 102, Level 15, State 1, Line 1 Incorrect syntax near ','." Now, I have a table say tblOrder with the following records. OrderNo 123456789 234567891 345678912 45678123 67 78 89 My goal is to update those orderno's that will satisfy the condition substring(orderno,6,2). Means, if the order no is 987623456 , then substring('987623456',6,2) will yield me 34. So if any OrderNo 34 is present, that will be updated. The query is update tblOrder set OrderNo = 'tt' where OrderNo in( select substring(OrderNo,6,2) from tblOrder) The output is OrderNo 123456789 234567891 345678912 45678123 tt tt tt Hope this helps :) Niladri Biswas
  • problem:storing rtf formatted data into sql

    help database question
    3
    0 Votes
    3 Posts
    1 Views
    A
    thanks for the reply,i used the vb.net ,i fixed the problem by doubling the single quote.
  • Exporting a database

    database sql-server sysadmin question announcement
    7
    0 Votes
    7 Posts
    1 Views
    I
    if possible then he can add Execption depends upon cicrumstances and is one of the option if possible otherwise there copying or backup is good option and he can even export only some tables and if he can export tables into XML and then can import then it will be even another way to do it , depends upon the nature as far as my understanding is he is not using at clients he is using for his test pc at home Best Of Regards, SOFTDEV Sad like books with torn pages, sad like unfinished stories ...
  • The ORA-01033: ORACLE initialization or shutdown in progress

    database oracle help
    2
    0 Votes
    2 Posts
    1 Views
    S
    Have you logged onto OS as owner of Oracle software?
  • ADO Data Bind!!

    c++ help
    3
    0 Votes
    3 Posts
    6 Views
    D
    I have the same problem with "Windows 7 RC", with XP and older no problem, I have registred regsvr32 "Msadodc.ocx" regsvr32 "Msdatgrd.ocx" regsvr32 "Msdatlst.ocx" Msadodc loaded data normally but Msdatgrd SetRefDataSource rise error "Can't initialize data bindings"