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
  • sql

    database sql-server sysadmin announcement
    6
    0 Votes
    6 Posts
    0 Views
    P
    Amazing way to answer Luc.. You stole the show...
  • difference b/w clustered and non-clustered index...

    database sql-server sysadmin
    6
    0 Votes
    6 Posts
    0 Views
    W
    Thank you Mycroft :) Yes, it's been a really busy couple of years. I noticed that you've been a 2010 MVP :thumbsup:. Congratulations (sorry that this comes so late!) The need to optimize rises from a bad design.My articles[^]
  • Installation Failure

    database sql-server sysadmin help question
    8
    0 Votes
    8 Posts
    0 Views
    P
    Hey, congrats buddy. You solved you problem on your own. Great thing in it's own. Keep going. All the Best.
  • Unwanted recordset behaviour !!!

    database help question announcement
    12
    0 Votes
    12 Posts
    0 Views
    S
    Now this does make sense .... nice work around It worked fine (even the result data is not that much comprehensive) but it do the job, and save some extra lines of code ... great man, thanks alot :thumbsup: 0 will always beats the 1.
  • Dynamic query in SQL

    database sql-server sysadmin tutorial question
    3
    0 Votes
    3 Posts
    0 Views
    D
    This may help.[^] ------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave CCC League Table Link CCC Link[^]
  • Getting Constraint Names through ADO

    database sql-server help question
    2
    0 Votes
    2 Posts
    0 Views
    A
    Sir, I don't know what do you want exactly but i think this would help. select parobj.name as 'ParentTable', concol.name as 'ConstrantColumn', refobj.name as 'ReferencedTable', refcol.name as 'ReferencedColumn' from sys.foreign_key_columns inner join sys.objects as parobj on parobj.object_id = sys.foreign_key_columns.parent_object_id inner join sys.columns as concol on concol.column_id = sys.foreign_key_columns.constraint_column_id and concol.object_id = sys.foreign_key_columns.parent_object_id inner join sys.objects as refobj on refobj.object_id = sys.foreign_key_columns.referenced_object_id inner join sys.columns as refcol on refcol.column_id = sys.foreign_key_columns.referenced_column_id and refcol.object_id = sys.foreign_key_columns.referenced_object_id or may be this: SELECT OBJECT_NAME(OBJECT_ID) AS 'NameofConstraint', SCHEMA_NAME(schema_id) AS 'SchemaName', OBJECT_NAME(parent_object_id) AS 'TableName', type_desc AS 'ConstraintType' FROM sys.objects WHERE type_desc LIKE '%CONSTRAINT' 100 :rose: ;) Help people,so poeple can help you.
  • 0 Votes
    5 Posts
    0 Views
    Brian C HartB
    The question's been answered. It was a varchar, i did a CONVERT(INT, myField) in the SELECT Thanks though! Sincerely Yours, Brian Hart
  • 0 Votes
    5 Posts
    0 Views
    S
    Thaks eddy, i found that recordsets are read only by default ... and also are not modifiable if sql depends on two tables of one-to-many relation or invlove sumation of rows ... Also, if above conditions are not true, then a recordset to be modifiable, i think attribs should be set like: set st = db.openrecordset("SQL",2,0,3) or set st = db.openrecordset("SQL",adOpenDynamic,adUseNone, adLockOptimistic) 0 will always beats the 1.
  • Best Security For Small Database

    database sysadmin security question csharp
    4
    0 Votes
    4 Posts
    0 Views
    L
    Q. Why do you need each volunteer to be separately logged in? Do you need to keep track of who let in whom? Assuming you're not too concerned about someone trying to steal or knacker the database then the type of security doesn't really matter - integrated or not that is. You could do something as simple as asking them to type in their name (selection from a drop down could be risky - what if someone volunteers in another user's place?) and then log that in the database. Disable the entry of the name on a login/logout button and bob's your uncle. ___________________________________________ .\\axxx (That's an 'M')
  • 0 Votes
    2 Posts
    0 Views
    J
    Could be any number of reasons. Such as - You are not using the same database - There are uncommitted records. - You are not running the code that you think you are - You are using some process to determine whether records and that process, not the number of records, is wrong.
  • User Defined Function - Condition based tabel return ???

    algorithms help question
    5
    0 Votes
    5 Posts
    0 Views
    M
    This is not a valid use for a function, a stored proc maybe but not a function. There is no way that emp and offices are going to be union compatible, if they are then why are they in different tables. You need to rethink your design. Select * from anytable This is frowned upon, explicitly declare the fields. Never underestimate the power of human stupidity RAH
  • Software to create reports [modified]

    database sql-server sysadmin question
    12
    0 Votes
    12 Posts
    0 Views
    M
    Get to know SSRS, theoretically as a DBA it does (sort of) come under database. It's free and you can use embedded reports if your requirements are simple (if you do not need the full server capability). Never underestimate the power of human stupidity RAH
  • how to email a ssrs report

    tutorial sql-server sysadmin help workspace
    2
    0 Votes
    2 Posts
    0 Views
    M
    vinu.1111 wrote: can anyone provide a step by step datails It is unlikely you will get this, it is a fairly large subject to cover. You need to set up a subscription that will process the report, the subscription can be set up to email the exported report to your gmail account. Never underestimate the power of human stupidity RAH
  • SQL Server Update New Column

    database question sql-server sysadmin help
    2
    0 Votes
    2 Posts
    0 Views
    R
    Not entirely clear what you are asking but this might set you in the right direction: declare @Id int set @Id = 999 select FileName from [table] where IDNumber = @Id Hoep that helps. "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
  • update table

    question help announcement
    5
    0 Votes
    5 Posts
    0 Views
    E
    Thanks David :)
  • Excluding weekends in stored procedure...

    database help
    5
    0 Votes
    5 Posts
    0 Views
    S
    frenz, pls help me out of this issue... i tried using DATENAME(WEEKDAY) but no luck on how to use it properly... i cannot use Date of the week since it all depends on the server datatime settings and i dont want to be dependent on that... pls help me guys... my requirement is to calculate the no. of days between two specific dates excluding weekends... tks!
  • Stored procedures in Entity Framework

    csharp database dotnet business help
    4
    0 Votes
    4 Posts
    0 Views
    A
    send your data as an xml to the sp as SET @Sls_Serial = SCOPE_IDINTITY(); DECLARE @insptr Int; EXEC sp_xml_preparedocument @insptr OUTPUT, @XML; INSERT INTO Sales_Head SELECT @Sls_Serial_No -- ,<other columns> FROM OPENXML(@insptr,'<element path>',1) WITH (<column> <type> '@<attribute name>'); EXEC sp_xml_removedocument @insptr Help people,so poeple can help you.
  • attach two varbinary

    tutorial question
    2
    0 Votes
    2 Posts
    0 Views
    J
    You mean concatenate them? If so then... set @bin3= @bin1 + @bin2;
  • filling a M:N table foreign keys

    learning csharp database visual-studio tutorial
    4
    0 Votes
    4 Posts
    0 Views
    J
    siaswar wrote: when want to import results?! Your requirements are still not clear to me. But regardless your "studentbook" table still represents a link table (two tables linked together.) You fill it in when you have the necessary information to fill it in. Which, as best as I can figure, you would have when you assigned a student to a class. However if there is a 'check out book' process (a manual process perhaps done the first day of class) then it would be done then.
  • 0 Votes
    5 Posts
    0 Views
    E
    SSIS is the best choice for a tool candidate that will be used for data transfer But you can create a SP and create a job with 3 minutes interval in each run Within the SP you can connect to Oracle DB and transfer your data using stored procedure.