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
  • Dynamic Query for XML?

    database xml question
    5
    0 Votes
    5 Posts
    0 Views
    M
    And if he is mucking around with OLAP databases and can't work out how to concatenate a string then they have bigger problems! Never underestimate the power of human stupidity RAH
  • Persisted Primary Key?

    help regex question
    5
    0 Votes
    5 Posts
    0 Views
    J
    Eddy Vluggen wrote: A persisted column, that'd be a computed/calculated field? Are you sure that's a good idea to use as a primary key? It shouldn't even be allowed in my opinion "The ones who care enough to do it right care too much to compromise." Matthew Faithfull
  • Repeating Field in SSRS report.

    sql-server question
    3
    0 Votes
    3 Posts
    0 Views
    L
    Thanks I'll have a look. I actually got round the problem by writing a stored procedure and putting my output into a string.
  • Clarification on SQL Server Function?

    help database sql-server sysadmin question
    10
    0 Votes
    10 Posts
    0 Views
    M
    What I have nothing better to do than write your code for you tsk tsk not going to happen I'm afraid. How can you expect to learn if you don't research and try and do the coding, getting help when you stumble. Never underestimate the power of human stupidity RAH
  • 0 Votes
    3 Posts
    0 Views
    Richard DeemingR
    decimal(4, 1) means a number with three digits before the decimal point and one digit after: http://msdn.microsoft.com/en-gb/library/ms187746.aspx[^] Based on your provided inputs: 36.403 * 100 = 3640.3 Therefore, your result requires four digits before the decimal point, so the precision should be 5: RETURN CAST(CAST(CONVERT(float, @parPercentageToBeFormatted) * 100 AS decimal(5, 1)) AS nvarchar(5)) + N'%' "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
  • put a condition in join query

    sharepoint database wpf wcf tutorial
    7
    0 Votes
    7 Posts
    0 Views
    D
    SELECT vb.Sno, ISNULL(lb.Vehicle\_Number,vb.Vehicle\_Number) as Vehicle\_Number, ISNULL(lb.Vehicle\_Booking\_Date,vb.Vehicle\_Booking\_Date) as Vehicle\_Booking\_Date, ISNULL(lb.Time\_From,vb.Time\_From) as vb.Time\_To, ISNULL(lb.Time\_To,vb.Time\_To) as vb.Time\_To, ISNULL(lb.Vehicle\_Used\_By,vb.Vehicle\_Used\_By) as Vehicle\_Used\_By, ISNULL(lb.Cost\_Code,vb.Cost\_Code) as Cost\_Code, ISNULL(lb.Budget\_Line,vb.Budget\_Line) as Budget\_Line, lb.KM\_Start, lb.KM\_End FROM mtblVehicle\_Booking vb LEFT JOIN mtblLog\_Book lb ON vb.Sno = lb.Sno where vb.Vehicle\_Number = @Vehicle\_Number AND DATEPART(MONTH,vb.Vehicle\_Booking\_Date) = MONTH(getdate()) showing error Incorrect syntax near '.'.
  • 0 Votes
    3 Posts
    0 Views
    L
    It's Really Superb... thanks RAH. If you can think then I Can. Need Development Updates in .Net . Like this page,Place your Comments ,Feedback and Share Knowedge. https://www.facebook.com/dotnetdeveloper1
  • database design for a self food ordering system?

    database design question
    2
    0 Votes
    2 Posts
    0 Views
    S
    It does not work like this here. Here is what is expected of enquirers: 1. TRY first what you want to do! You may find that it's not that hard. 2. Formulate what was done by you that looks like an issue/not working. Try them and tell if you face issues. Members will be more than happy to help like this. Sandeep Mewara Microsoft ASP.NET MVP 2012 & 2013 [My Blog]: Sandeep Mewara's Tech Journal! [My Latest Article]: HTML5 Quick Start Web Application
  • Database design for E commerce web site

    database design
    8
    0 Votes
    8 Posts
    0 Views
    L
    subbaraogaddam wrote: but i am unable to understand subbaraogaddam wrote: as per my understand Your project is in deep trouble.
  • why i am unable to retrieve holiday name

    database help question
    3
    0 Votes
    3 Posts
    0 Views
    U
    i don't know how to use if...exists i am new to asp.net & database as well my requirement is to get 3 consecutive working days declare @i int declare @count int set @i=0 set @count=0 while(@count <= 3) begin 1) select Holiday_Name from Holiday where Holiday_On = DATEADD(day,@i,CONVERT(date,GETDATE())) the above statement is to check whether holiday exists 2) IF DATEPART(day, DATEADD(day,@i,CONVERT(date,GETDATE()))) = 7 OR DATEPART(dw, DATEADD(day,@i,CONVERT(date,GETDATE()))) = 1 the 2nd statement is to check whether weekend or not set @i = @i + 1 if there no holiday and not weekend then only the following code is executed set @count = @count + 1 here i have to retrieve the date...i don't know how to get the date...because i vil get 3 dates... end actually i no need to select holiday name in 1)statement...there i am checking for holiday..
  • BCP - Exported files (docx, xlsx & pptx) are corrupted

    help database question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • 0 Votes
    5 Posts
    0 Views
    R
    My bad, The original code that I used as the query: SELECT [xmliform] AS 'data()' FROM [database].[xml].[tblXMLAsTypeNvarchar] FOR XML PATH('') So, as you can see, an editor will try to format anything from a table where the type is [nvarchar] using it's xml parser when I specify "FOR XML PATH" regardless of how bad I "want" it as xml. And that is with substituted control characters.
  • db_accessadmin?

    database question sql-server sysadmin help
    3
    0 Votes
    3 Posts
    0 Views
    T
    :omg: well now I feel suitably daft, this is ancient history. Thank you :-D
  • a query by less performnace

    database css sql-server sysadmin performance
    7
    0 Votes
    7 Posts
    0 Views
    M
    thank you:)
  • how to unloch table in sql

    database help tutorial
    6
    0 Votes
    6 Posts
    0 Views
    M
    ok thankue
  • 0 Votes
    6 Posts
    0 Views
    M
    my table is also lock. if use this query and you can see that table lock . and select * from sys.dm_tran_locks inner join sys.objects on sys.dm_tran_locks.resource_associated_entity_id=sys.objects.[object_id]
  • Create a table for prices

    help
    5
    0 Votes
    5 Posts
    9 Views
    M
    Thank you guys. I appreciated.
  • retrieving 3 working days

    sharepoint data-structures help tutorial
    2
    0 Votes
    2 Posts
    0 Views
    M
    Use a table variable not an array. Declare @Tbl Table(Date datetime) Insert @tTbl Select getdate() So instead of buying a book and studying you are going to bring every problem to the interweb forums for answer. I predict your questions shortly be ignored and no answers will be forth coming! Never underestimate the power of human stupidity RAH
  • 0 Votes
    4 Posts
    0 Views
    D
    Hi,in this you can create an job using SSMS.No need of writing stored procedure for this.
  • checking whether today's date is public holiday

    sharepoint help
    5
    0 Votes
    5 Posts
    0 Views
    U
    hi, its working....