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
  • (Expiring Next Month) Problem

    question com help announcement
    7
    0 Votes
    7 Posts
    0 Views
    G
    Try the query out - you will find that it selects the data from next calendar month ;) “That which can be asserted without evidence, can be dismissed without evidence.” ― Christopher Hitchens
  • Select and Update

    tutorial announcement
    5
    0 Votes
    5 Posts
    1 Views
    M
    The Select-Statement have to run into a variable. For all recorset in the variable you have to carry out the update statement
  • 0 Votes
    5 Posts
    0 Views
    A
    Hi thanks for your help we have to do it fast as we did not have time so i just copy past all values of column and paste in excel file and change the desired format:D :) and paste it in database :)
  • Problem with Decimal Places and Rounding off

    csharp asp-net database com
    3
    0 Votes
    3 Posts
    0 Views
    V
    Thanks that saved the day. Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa[at]dotnetfunda.com http://www.Dotnetfunda.com
  • Weird problem with UNION query in Access 2010

    database help question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Find the right SSMS

    sql-server question database sysadmin
    3
    0 Votes
    3 Posts
    0 Views
    C
    Thank you, I seem to find the wrong download (full instance) when I look.
  • 0 Votes
    2 Posts
    0 Views
    M
    Erk! You have an insert statement Then an if statement on a variable that is not in scope (of the question) Try moving the insert inside the if statement, so you will need the insert twice if begin insert select end else begin insert select end Never underestimate the power of human stupidity RAH
  • split datatable column using c#

    csharp question
    6
    0 Votes
    6 Posts
    0 Views
    L
    Show us your code :) Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]
  • Handling Duplicate records

    database help sql-server tutorial
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • How to Calculate Total Time Difference

    database tutorial question
    12
    0 Votes
    12 Posts
    0 Views
    S
    /****** Script for Select the Time difference in HH : MM ******/ SELECT [Id], CONCAT (DATEDIFF(HOUR ,StartDate, EndDate), N' : ', (DATEDIFF(MINUTE,StartDate, EndDate) % 60)) as TimeTaken FROM [dbo].[YourTable] Above example, I am first finding the Hour, then finding the minutes. Finally, do a Concatenation to get the results in the format of HH:MM. Hopes this helps.
  • 0 Votes
    4 Posts
    0 Views
    M
    LTM_it_kh wrote: But this may not the best choice for me. It may well be the worst solution! Global temp table are nasty to manage! Never underestimate the power of human stupidity RAH
  • Cannot create a foreign key reference (probably my fault)

    database question
    6
    0 Votes
    6 Posts
    0 Views
    L
    Richard MacCutchan wrote: your suggestion did work (for SQL CE). Cool - one of those rare cases where both implemented the same sql-standard. Makes me curious how easy (or hard) it is to switch from one to the other. Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]
  • Help with XML

    sharepoint database xml performance help
    4
    0 Votes
    4 Posts
    0 Views
    Richard DeemingR
    Your OPENXML query doesn't work because the node value contains white-space, which is not getting trimmed. Since you're only taking the first 5 characters, you'll get a string containing nothing by white-space. Your .nodes() query doesn't work because you're getting the PolicyType nodes, and then trying to find the third PolicyType node within that node. Try this: DECLARE @xmlPolicyType XML SET @xmlPolicyType= REPLACE('<?xml version="1.0" encoding="utf-16"?> <NewDataSet> <PolicyType> MED </PolicyType> <PolicyType> SPORT </PolicyType> </NewDataSet> ','utf-16','UTF-8'); DECLARE @PolicyTypes TABLE ( PolicyType char(5) ); INSERT INTO @PolicyTypes ( PolicyType ) SELECT LTrim(Replace(Replace(Replace( T.PolicyType.value('.', 'varchar(120)') , Char(13), ''), Char(10), ''), Char(9), '')) FROM @xmlPolicyType.nodes('/NewDataSet/PolicyType') As T (PolicyType) ; "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
  • SQL SERVER DBA--- HELP ME WITH THIS....

    learning database sql-server sysadmin help
    3
    0 Votes
    3 Posts
    0 Views
    M
    There are 2 distinct streams when dealing with databases, developer and DBA. CP mostly deals with developer requirements, how to move data around an application and process the data. If you intend to go down the DBA path, where you maintain the health of the database and development is only incidental to your core role then http://www.sqlservercentral.com/[^] is a good resource. You may also want/need to concentrate on a specific database server. Never underestimate the power of human stupidity RAH
  • Weird MS SQL "Error"

    csharp database com help question
    8
    0 Votes
    8 Posts
    0 Views
    G
    10.50.1617.0 Management studio hitting 2008 R2 10.0.5500.0 I think it was a one-time glitch. I hate those. We won't sit down. We won't shut up. We won't go quietly away. YouTube and My Mu[sic], Films and Windows Programs, etc.
  • sql server

    database sql-server sysadmin help question
    8
    0 Votes
    8 Posts
    9 Views
    M
    Seems to be a solved problem, have some google foo[^] Never underestimate the power of human stupidity RAH
  • The Log For the Database is Not Available

    database help sql-server sysadmin tutorial
    5
    0 Votes
    5 Posts
    0 Views
    A
    I'd recommend to turn off the Auto Close: ALTER DATABASE database_name SET AUTO_CLOSE OFF; GO Speaking about errors, try to restart the server and run DBCC CHECKDB again. Also, take a look at Windows Event Logs for errors. BTW, do you have enough disk space? Regards, Andrius Leonavicius
  • CONCAT names with condition

    com announcement
    4
    0 Votes
    4 Posts
    0 Views
    G
    Without using CONCAT you can do this: rtrim(isnull(first_name,'',first_name+' ') + isnull(middle_name,'',middle_name+' ') + isnull(last_name,'',last_name)) The rtrim will remove a trailing space where the person does not have a last name. “That which can be asserted without evidence, can be dismissed without evidence.” ― Christopher Hitchens
  • how to select numbers (integers) only?

    question com tutorial announcement
    7
    0 Votes
    7 Posts
    0 Views
    P
    Because they're strings; you'll need to convert to numeric fo rthe comparisons to work the way you want. You'll never get very far if all you do is follow instructions.
  • 0 Votes
    1 Posts
    0 Views
    No one has replied