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
  • Complicated size calculation

    database help
    2
    0 Votes
    2 Posts
    0 Views
    M
    Never having addressed this requirement this is a guess only. I would take a look at the properties in SSMS, I'm sure the tables have size and rowcount in their properties, this means it is stored in a sys table somewhere. It now becomes a search and mathematics problem. Good Luck Never underestimate the power of human stupidity RAH
  • Hello

    database help tutorial question
    2
    0 Votes
    2 Posts
    0 Views
    M
    gertag - read the bloody guidelines, you know the horrible yellow sticky messages at the top of the screen. Use datepart and datediff to identify the last 7 days of the month and use those dates to filter your product registration. Never underestimate the power of human stupidity RAH
  • Joining columns from two tables into one column

    database
    7
    0 Votes
    7 Posts
    0 Views
    M
    Normaly I am reluctant to supply code, I prefer to give hints only - as David did and encourage you to do some research but as you posted some code you were abviously willing to learn. Look into UNION and UNION ALL as suggested by Jorgen. Never underestimate the power of human stupidity RAH
  • replace the value with different text in Select

    database help tutorial
    4
    0 Votes
    4 Posts
    0 Views
    C
    I concur. But how many times have we all see stuff like this? I like your mapping table solution, unless this is a one off exercise in which case a case statement will run faster and won't need to be maintained. Data Quality Solutions
  • Using dynamic SQL

    database sharepoint sysadmin performance tutorial
    5
    0 Votes
    5 Posts
    0 Views
    P
    Tim Carmichael wrote: Since I, personally, DETEST seeing SQL statements hard-coded in an application That's where they belong, so you know they can't be easily changed. And it is to be hoped that any changes are properly tracked in your version control system with a proper paper trail and then tested. Stored procedures are too fragile and should be avoided at all costs. I've even had stored procedures "disappear"... there one day, gone the next.
  • 0 Votes
    3 Posts
    0 Views
    I
    If you want to search for the answer, look at my last reply to the question below. If you want the answer look at my second reply to indian143 (20:38 28 Jun '10) four questions down.
  • 0 Votes
    5 Posts
    0 Views
    I
    80 is Sql Server 2000, 70 is Sql Server 7 etc. You are connecting to a Sql Server 2000 instance not 2008. You cannot use FOR XML PATH. I suggest that you search google for "sql aggregate string concatenation". You may also find this link helps http://www.projectdmx.com/tsql/rowconcatenate.aspx[^]
  • 0 Votes
    11 Posts
    0 Views
    I
    I have checked the code in Sql Server Management Studio 2008 and 2005 by creating a new query, copying the code into it and running it; It works fine. How are you trying to run the code?
  • sql functon

    database help question
    5
    0 Votes
    5 Posts
    0 Views
    M
    Chris Meech wrote: was left scratching my head Been there many times, thankfully between the lot of us someone generally gets the idea the OP is trying to convey. Never underestimate the power of human stupidity RAH
  • Unable to Connect to Sybase DB in Word 2007

    database help question workspace
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • xp_cmdshell [modified]

    database help question sharepoint com
    6
    0 Votes
    6 Posts
    0 Views
    I
    Thanks for your Help.
  • xp_cmdshell

    tools help question
    3
    0 Votes
    3 Posts
    0 Views
    I
    Sorry Its Just by Mistake.
  • 0 Votes
    1 Posts
    0 Views
    No one has replied
  • 0 Votes
    8 Posts
    0 Views
    B
    Unfortunately, I haven't yet found a solution...
  • Query for multiple occurance

    database help question
    2
    0 Votes
    2 Posts
    0 Views
    T
    You have posted this question in C# board also.:mad: Here you go...Pete O'Hanlon answer[^] thatraja Tips/Tricks|Brainbench certifications|Facebook|Twitter
  • Join tables from different server

    sysadmin help
    5
    0 Votes
    5 Posts
    0 Views
    N
    Thank you for your reply. I am really really sorry for my uncomplete question. I am using SQL server 2000. @J4amieC, Thank you. Will try with "sp_addlinkedserver[^]".
  • Jan-December chart with specific information

    database question help
    3
    0 Votes
    3 Posts
    0 Views
    D
    Hi Dave, First, for stage, prefer a drop down list to choose the stage and the results change accordingly, just show one type of stage, say a table showing the Pieris Napi at adult stage only. What you suggested on having a drop down list to chose the scientific name would be far better, how would I do this so you can choose what you want proir to creating the table, would an input form work best for this, choose the scientific name and stage on a small form then press a button to take you to a chart on that species. I know how to create the form, but not how to get the information onto a chart Havn't used much with charts or inputting data except on tables latley, so I am a bit rusty. In the end we're all just the same
  • Group By 30 Minutes

    sales
    9
    0 Votes
    9 Posts
    0 Views
    I
    Thanks.I have already sorted it out. Cheers
  • sql function to calculate work hours of an employee

    database help question
    2
    0 Votes
    2 Posts
    0 Views
    T
    Mate, please format the code because there are many smileys in your sql query. thatraja Tips/Tricks|Brainbench certifications|Facebook|Twitter
  • sql function to calculate work hours

    database help
    4
    0 Votes
    4 Posts
    0 Views
    C
    Time can be a real nightmare to handle. Other issues which you might want to think about include: Day-light saving time (esp. around midnight boundaries). Time zones -- don't look applicable in your case, but I worked on a car hire problem which supported pickup/drop off across time zones. Of course, I've not actually answered the original question. Some idea of the data structure/data available might be useful.