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
  • Default Button is not working using different (skinid)

    5
    0 Votes
    5 Posts
    0 Views
    M
    I don't consider "stores data" as a definition of a database! Word, excel, xml, CSV, bin with screwed up paper in it all store data! Never underestimate the power of human stupidity RAH
  • Sql injection Attack

    question database
    8
    0 Votes
    8 Posts
    0 Views
    Richard DeemingR
    Aatif Ali from Bangalore wrote: How to avoid or prevent this attack...? Use parameterized queries; Don't use dynamic SQL, use parameterized queries; Oh, and did I mention: use parameterized queries! Input validation and other techniques have their place, but the only way to completely avoid SQL injection is to use parameterized queries. If you ever find yourself concatenating strings (other than known constant strings) to build a query, either in client code or a stored procedure, you've left yourself open to SQL injection. "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
  • Calculation For Time Attendance System

    database help tools regex json
    4
    0 Votes
    4 Posts
    0 Views
    C
    I had try out is IN FAB time is out time - In time and Out FAB time is In time - Out time. the problem is now dont know how to apply the logic in my SQL script. kindly advise, thank you
  • stored procedure or views?

    database com performance question announcement
    6
    0 Votes
    6 Posts
    0 Views
    A
    Based on the performance considerations, the SPs are more versatile and allow a broader range of inquiries and actions than the views.
  • SQL

    database help question
    6
    0 Votes
    6 Posts
    0 Views
    P
    Hi First create Employee table CREATE TABLE EMPLOYEE ( Sl_no int identity, Name varchar(40), Employee_id int ) insert the values INSERT INTO EMPLOYEE(Name,Employee_id) SELECT 'Anil',1001 UNION ALL SELECT 'Mahesh',1002 UNION ALL SELECT 'Raju',1003 then create designation table CREATE TABLE DESIGNATION ( Employee_id INT, Designation varchar(30) ) then insert the values INSERT INTO DESIGNATION SELECT 1001, 'Developer' UNION ALL SELECT 1002, 'Tester' UNION ALL SELECT 1003, 'Trainee' then follow this query SELECT E.*,D.Designation FROM EMPLOYEE E INNER JOIN DESIGNATION D ON E.Employee_id=D.Employee_id Prakash.ch
  • 0 Votes
    4 Posts
    5 Views
    P
    Hi First create table CREATE TABLE apl_Error ( Error_Desc VARCHAR(MAX), Error_Date DATE ) After that create this procedure CREATE PROC SAMPLE @ERROR_DESC VARCHAR(MAX) OUTPUT AS BEGIN BEGIN TRY CREATE TABLE #TABLE(ID int,fName varchar(20)) INSERT INTO #TABLE VALUES('A1','CHOICE') SELECT @ERROR_DESC=NULL END TRY BEGIN CATCH INSERT INTO apl\_Error(Error\_Desc,Error\_Date) SELECT cast( RTRIM(LTRIM(CAST(ERROR\_STATE() as CHAR(10)))) +','+ RTRIM(LTRIM(CAST(ERROR\_LINE() AS CHAR(5))))+','+ERROR\_PROCEDURE()+','+ERROR\_MESSAGE() as varchar(max)),GETDATE() SELECT @ERROR\_DESC='Error on Inserting' END CATCH END to execute this procedure DECLARE @NAME VARCHAR(MAX) EXEC SAMPLE @ERROR_DESC=@NAME OUTPUT SELECT @NAME AS Error_Description then see apl_Error table now you can see the message and date. Error_Desc Error_Date 1,8,SAMPLE,Conversion failed when converting the varchar value 'A1' to data type int. 2013-07-05
  • getting common data

    help
    3
    0 Votes
    3 Posts
    0 Views
    P
    Hi Arun kumar Could you provide sample data for understanding purpose and from that how you want the data could you give sample output Regards, Prakash.ch Prakash.ch
  • Data Base administrator vs software developer

    database visual-studio question
    10
    0 Votes
    10 Posts
    0 Views
    L
    The first thing you need to learn is how to do your own research[^]. Use the best guess
  • sqlserver 2005 connection problem

    sysadmin question csharp help
    2
    0 Votes
    2 Posts
    0 Views
    L
    Enable the TCP/IP protocol (see configuration). Open port 1433 on your firewall. Setup port forwarding on your router. ..and start praying; a SQL Server directly connected to the internet is a bad idea. Expect quite some people poking the server to check its security. The "best" way to expose your database would be by using webservices :) Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]
  • Date difference with total years, months and days

    database question
    7
    0 Votes
    7 Posts
    0 Views
    M
    You are right, a simple datediff 3 times will not do it, however with the application of a little imagination and some work with SSMS I know you can do this, I have seen it done in an example somewhere but dammed if I am willing to chase it down. Never underestimate the power of human stupidity RAH
  • Keep Client QL DB Updated

    database csharp wpf testing beta-testing
    2
    0 Votes
    2 Posts
    0 Views
    M
    We use Red-Gates SQL Compare to deploy to UAT (production deployment is a more stringent process). Data compare to synch the master tables. I think it can be automated but we do a manual deployment as reports are built against UAT and not the dev database. Never underestimate the power of human stupidity RAH
  • Derived Fields

    question database visual-studio tutorial discussion
    4
    0 Votes
    4 Posts
    0 Views
    M
    Personally I'm with Tim, I consider your design the technically correct one. Technically correct is not always the best design, it is the one I prefer but if I thought storing the data would give me a better solution I'd have no compunction in changing it. Only you can asses the benefit to changing but I would think 1500 is a trivial number to deal with, add a few zeros and I'd look at it again! Never underestimate the power of human stupidity RAH
  • Automatically open keys upon connection

    sql-server csharp database sysadmin question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • 0 Votes
    23 Posts
    0 Views
    L
    Do you guys think Java is designed to be more native to Linux so it can run that fast?
  • Connecting to an SQL Database.

    csharp database sysadmin
    22
    0 Votes
    22 Posts
    3 Views
    L
    Bram van Kampen wrote: I extrapolate from the above that Wrong assumption. Although you can force both to use SQL92, it's not optimal. Both have their own SQL-dialect, and there's a little difference in adding parameters to the IDbCommand. Still, I like Access for prototyping Sql-server database; one can build a UI quickly around the tables, and they're easily copied to a USB-stick. There's a Wizard somewhere in there that "upgrades" the database to Sql Server-format, so once it works you can migrate all the tables easy from Access. The wizard can't translate all, e.g., there's no UI-service in Sql Server. It also doesn't translate reports, but tables and views, yes. If you want to be able to use the Access-reports with the Sql Server database, that's possible too - by linking the tables from Access and installing the free Access Runtime[^]. Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]
  • SQL QUERY

    database sql-server sysadmin help question
    9
    0 Votes
    9 Posts
    0 Views
    R
    Use sort by or group by with the query to get the result.
  • Creating New Database in SQL 2012 Management Studio

    database question
    6
    0 Votes
    6 Posts
    2 Views
    A
    I think it should be on same data type
  • 0 Votes
    5 Posts
    0 Views
    B
    Also consider the operations to be performed on the database. If it's only create-retrieve-update-delete, MySQL will cope with lots of data. But when you want to do some reporting, MySQL becomes too slow early. And for more complicated reports based on several joined subqueries, also Postgres won't do the job - Oracle can handle that (but otherwise Oracle is quite a PITA).
  • 0 Votes
    3 Posts
    0 Views
    R
    Well, there's no "grade" here ... so I'll use "results" instead. But to illustrate only a point: CREATE TABLE [cpqaAnswers].[cpqa].[cpqa_OT_tblRegister]( [id][int], [school][nvarchar](15), [name][nvarchar](38), [Subject][nvarchar](45), [results][int], [studentID][int] ) That's the table. BULK INSERT [cpqaAnswers].[cpqa].[cpqa_OT_tblRegister] FROM 'C:\Users\OT\registerOT(td)_.txt' Where registerOT(td)_.txt has the posted data tab-delimited. SELECT * FROM [cpqaAnswers].[cpqa].[cpqa_OT_tblRegister] WHERE [results] = 72 ORDER BY [id] FOR XML PATH('Schools'), ELEMENTS, ROOT('Register') Not what OP is after but perhaps more key than the usual webpage link. <Register> <Schools> <id>5</id> <school>Cambridge</school> <name>john</name> <Subject>English</Subject> <results>72</results> <studentID>2</studentID> </Schools> </Register> [edit] Is it possible that THIS is what is sought (notice the closed tags that have been added)? <Register> <Schools> <School> <Name>Oxford</Name> <Students> <Student> <Name>tom</Name> <Subjects> <Subject> <Name>Maths</Name> <grde>98</grde> </Subject> <Subject> <Name>English</Name> <grde>87</grde> </Subject> <Subject> <Name>Chemistry</Name> <grde>63</grde> </Subject> </Subjects> </Student> </Students> </School> <School> <Name>Cambridge</Name> <Students> <Student> <Name>john</Name> <Subjects> <Subject> <Name>Maths</Name> <grde>50</grde> </Subject> <Subject> <Name>English</Name> <grde>72</grde> </Subject> <Subject> <Name>Chemistry</Name> <grde>32</grde> &
  • SQL Database Security

    database sql-server sysadmin security tutorial
    3
    0 Votes
    3 Posts
    0 Views
    M
    You can encrypt the database and that mat protect your data across a restore, I have never had to do this so I do not have a definitive answer! Hiding columns in a table view is not possible (I think) but you can create views exposing the columns you want to display for each group of users. Then only give permission for the user to the views and not any other objects. Never underestimate the power of human stupidity RAH