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
  • Equivalent in MS Sql

    question database
    10
    0 Votes
    10 Posts
    0 Views
    L
    SilimSayo wrote: Most of our imports come from abroad! Imports become necessary when locals lack quality and become unaffordable! ;-)
  • 0 Votes
    4 Posts
    4 Views
    V
    I am sorry, I moved the question to MFC as suggested and did not even attempted to delete it here. I think it cannot be deleted once discussion starts. Yes, the field index is properly advanced and it works just fine with more than one record in the recordset - initially. The key is that I get the first field OK, than it fails on next one. I know the field is there because it retrives the record just fine when different SQL returns more records in recordset. Here is the code snippet, I have removed my // comments for clarity, but it is pretty normal text retrieval loop. pRecordset->AddNew(); fix , does not really adds anything pRecordset->MoveFirst(); should not need this on initial Open recordset short nFields = pRecordset->GetODBCFieldCount( ); while( !pRecordset->IsEOF( ) ) { buffer = strText.GetBuffer(256); // set item text for( short index = 0; index < nFields; index++ ) { pRecordset->GetFieldValue( index, strText ); buffer = strText.GetBuffer(256); pList->SetItemText(iItem,index,buffer); this is where it fails TRACE("\n item %i field %i buffer %s ",iItem , index , buffer ); } pRecordset->MoveNext( ); iItem++; } I would like to get you opinions on this if you have time to work on it. If so please switch to MFC forum. Thanks Vaclav
  • managing access to multiple stand alone installations

    database sysadmin
    4
    0 Votes
    4 Posts
    0 Views
    B
    If you are using SQL Server 2008 policy based management might be a solution. But again I think this was something introduced in SQL 2008.
  • 0 Votes
    2 Posts
    0 Views
    L
    Firstly, this is not a Database question, so should have been posted to the C# forum. However, this article[^] explains it all. Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman
  • y this query answer wrong ?

    database sales help question
    3
    0 Votes
    3 Posts
    0 Views
    C
    Please tell us what is the problem exactly your are facing. If you want data according to customerid just you can add customer id to the view.
  • Converting from Access to MSDE 2000

    database xml help
    2
    0 Votes
    2 Posts
    0 Views
    C
    Since you did not include what you have tried. Try using an inner join BEGIN TRAN DELETE tblResultNotes FROM tblResultNotes INNER JOIN tblResults ON tblResultNotes.ResultID = tblResults.ResultID ROLLBACK TRAN Look up BEGIN TRAN to see what to replace ROLLBACK TRAN with to commit the delete.
  • Sqlserver

    question
    7
    0 Votes
    7 Posts
    0 Views
    S
    That's not the difference. N is what you get when you divide NVarchar by Varchar.
  • GROUP BY and listing rows in an aggrigate

    database sales help question
    7
    0 Votes
    7 Posts
    0 Views
    L
    My pleasure :)
  • generate specific format in sql table

    database
    8
    0 Votes
    8 Posts
    0 Views
    L
    sankooo wrote: I want to add one column in sql table. That will be in specific format. Mycroft is right, but it's half the story. Tables hold data, not information. sankooo wrote: If the year changes to new year, I want to start from 00001. like that. That's a composite column, and in the ideal world we try to keep the data atomic. That means that you can loose the date-part, as that's already encoded in the previous column. You also don't need the prefix-zeroes, those are merely there for presentation. Hence, all you need in the ApplicationID-row is a sequence-number; all other information is already present and the complete applicationID as you need can be calculated from the rest of the tuple. The other half of the story is that we don't want to duplicate information, as that would be redundant (and thus, increases the chances for errors). I'd suggest you read up on normalization[^] procedures. Bastard Programmer from Hell :suss:
  • SQL Server Management Studio R2 (varchar(MAX))

    database sql-server sysadmin help
    8
    0 Votes
    8 Posts
    0 Views
    L
    vkstarry wrote: the max of varchar is varchar(8000) Yup, anything longer than that would cripple the database-index when you do a LIKE operation. To keep it simple; the documents contents should be a varchar(max) (or nvarchar if you need to store unicode), and you should use strings that are limited in length to describe other properties (like a title). Bastard Programmer from Hell :suss:
  • 0 Votes
    3 Posts
    0 Views
    T
    From link[^]: Basically, when you failed to connect to your SQL Server, the issue could be: 1) Network issue, 2) SQL Server configuration issue. 3) Firewall issue, 4) Client driver issue, 5) Application configuration issue. 6) Authentication and logon issue. Check these Steps to troubleshoot SQL connectivity issues[^] SQL Server 2005 Connectivity Issue Troubleshoot - Part I[^] Troubleshoot Connectivity Issue in SQL Server 2005 - Part II[^] Troubleshoot Connectivity Issue in SQL Server 2005 - Part III[^] BTW check this bunch also for future errors thatraja My Dad had a Heart Attack on this day so don't... Pompeyboy3 here | Nobody remains a virgin, Life screws everyone :sigh:
  • update and view news headline

    database question announcement php mysql
    2
    0 Votes
    2 Posts
    0 Views
    W
    I think you will get more response from the PHP forum. :) When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
  • Get start date

    database help question
    4
    0 Votes
    4 Posts
    0 Views
    S
    What other fields are in tbl_leaveentry besides empcode,entrydate? Do you have a field that indicates how may leave days were taken? There should be a field that indicates how many days were taken for leave. Just at glance, it seems to me that your database was poorly designed. I think start date should have been included in the first place.
  • How to Call A web service inside SQL server

    database sql-server sysadmin help tutorial
    4
    0 Votes
    4 Posts
    0 Views
    S
    If I may ask, what inserts records in table_B; is it a stored procedure? If so, I would use the same stored procedure to call the web service immediately after it inserts data. I don't know if ordinary stored procedures can call web services so I would suggest an extended stored procedure i.e. a CLR dll. I haven't done anthing like it; so I am really just guessing.
  • Sum the counts from two different tables

    database sql-server sysadmin regex help
    5
    0 Votes
    5 Posts
    0 Views
    S
    No problem.
  • Integration Services or C# code

    csharp sql-server database linq question
    9
    0 Votes
    9 Posts
    4 Views
    M
    Hmm you need to look at a number of aspects as it sounds like you are a single person operator doing small systems. I have been there so! How are you going to support the processes, remotely or turn up when they fail, can you client do some of the support himself (IE restart an SSIS package/job). Corollary, how critical is the load. Another issue, does your client expect to play in your dirt patch, will he want to learn from your SSIS, is he one of those to want to inspect the code? And do you want him to. This pros and cons, he can help support himself and he can also screw up the system dramatically. Personally I always move the file BEFORE processing it, I do the processing from the archive folder. I also prefer a winforms app as I then have complete control and can walk the user through a restart/reload etc. This is a preference only as both SSIS and app can do all the functionality required (SSIS can poll the folder every #n seconds/minutes using the job scheduler) Never underestimate the power of human stupidity RAH
  • 0 Votes
    2 Posts
    0 Views
    B
    Try yo convert float Excel column into text and then import in SQL Table. I Love T-SQL "VB.NET is developed with C#.NET" If my post helps you kindly save my time by voting my post.
  • create user account

    database question sysadmin xml help
    3
    0 Votes
    3 Posts
    0 Views
    D
    I'm using SQL Server 2005, Stanndard Edition. I've googled for long and still not getting any solution.
  • database role permissions

    database tutorial
    2
    0 Votes
    2 Posts
    0 Views
    R
    Start here[^]. Should help. "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair. nils illegitimus carborundum me, me, me
  • 0 Votes
    2 Posts
    0 Views
    P
    Please don't cross-post.