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
  • can someone find the error please

    help career
    9
    0 Votes
    9 Posts
    0 Views
    P
    Not when I did it.
  • error @ Functions

    mysql help question
    3
    0 Votes
    3 Posts
    0 Views
    J
    I did that and I restarted the server to make sure the services were restarted but I am still facing the same problem.
  • string truncation

    php sharepoint database sql-server com
    29
    0 Votes
    29 Posts
    0 Views
    L
    Thanks. I'm fully convinced by now that is the right way to do things. And I have implemented parts of it already, the TextBoxes now are fully aware of the field widths through a simple model layer and some dictionaries. While not fully automatic, it seems to work well. :thumbsup: Luc Pattyn [My Articles] Nil Volentibus Arduum
  • Data from multiple tables

    question sales
    6
    0 Votes
    6 Posts
    0 Views
    M
    yes you were right. I had to change actual data of those fields. thanks --------------------------------------------- _" Future Lies in Present "_Manmohan Bishnoi
  • Master.dbo.xp_fileexist in sql

    question database help
    2
    0 Votes
    2 Posts
    0 Views
    L
    vanikanc wrote: How can I check if the main part of the file exists, just xxx part so I can rename it? When I use the fileexist, it looks for the entire filename and hence not finding the file. Get the directory contents by using [xp_cmdshell](http://msdn.microsoft.com/en-us/library/aa175921%28v=sql.80%29.aspx)[[^](http://msdn.microsoft.com/en-us/library/aa175921%28v=sql.80%29.aspx "New Window")], and check whether there's a recently created file that meets the criteria. Bastard Programmer from Hell :suss:
  • database deployment

    database sysadmin sql-server com tutorial
    3
    0 Votes
    3 Posts
    0 Views
    J
    Development phase. 1. Create one or more scripts that create the database 2. Create one or more scripts that populate the database. 3. CHECK them into source control. 4. Label them 5. Extract USING the label and store as a 'delivery' in the file system some where. Call this location X (it will be related to a delivery version number.) Install phase 1. Notify the production personal what X is (related to the verifie version.) 2. Production personal use a dabase id SPECIFICALLY for installs, and nothing else, to run the scripts appropriately. 3. Verify that the database is 'working' using something methodology probably involving other applications. There are all sorts of variations on the above.
  • MySQL query help

    database mysql help
    4
    0 Votes
    4 Posts
    0 Views
    B
    Only the first part of the solution: how to get the 60 rows from table_1: SELECT table_1.PropID, FullStreetAddress, City, State, Zipcode, Remarks, Date, table_2.URL FROM table_1 LEFT JOIN table_2 ON table_1.PropID=table_2.PropID WHERE table_1.PropID IN (SELECT PropID FROM table_1 WHERE LIMIT 60) That's still with all releated rows from table_2.
  • how to avoid this error?

    csharp question database mysql sysadmin
    3
    0 Votes
    3 Posts
    0 Views
    J
    jrahma wrote: so how can I avoid the error? The tick is a special character. You are ignoring that possibility. That is the cause of the error. There can be other special characters as well. As noted in the other reply you should use parameter replacement, which many database APIs (different types, different programming languages) provide. If you absolutely cannot do that then you would need to either 1. Determine what special characters exist for your database and deal with them yourself. 2. Limit all input to a known safe set of characters and verify each input value FIRST before attempting to use it in SQL.
  • LesserOf function

    database sql-server sysadmin question
    5
    0 Votes
    5 Posts
    0 Views
    A
    You could do this... CREATE FUNCTION dbo.LesserOf ( @Op1 NUMERIC(18,7) , @Op2 NUMERIC(18,7) ) RETURNS NUMERIC(18,7) AS BEGIN DECLARE @result NUMERIC(18,7) IF ( @Op1 < @Op2 ) SET @result = @Op1 ELSE SET @result = @Op2 RETURN @result END ...or set the precision and scale to something bigger (20,7)...will give 13 significant numbers and 7 decimal places. (I don't usually use real.) I don't speak Idiot - please talk slowly and clearly 'This space for rent' Driven to the arms of Heineken by the wife
  • MS SQL Server Trigger help

    database help sql-server sysadmin announcement
    4
    0 Votes
    4 Posts
    0 Views
    C
    I do not know which version of SQL server you have but if 2008 try MERGE in your trigger.
  • 0 Votes
    5 Posts
    0 Views
    J
    Thanks. I added PC-A's "Guest" account to the SQL Server's "Security\Logins" group and mapped it to specific databases I want to connect. Here, I might have broken some security, but at least got it working for now. Best, Jun
  • saving changes to sqlserver2008

    database tutorial
    4
    0 Votes
    4 Posts
    0 Views
    D
    Did you define the new column to not allow NULL ? If so, then you need to define a default value for that column.
  • Problem in query

    help database tutorial
    5
    0 Votes
    5 Posts
    0 Views
    U
    thanks
  • Accumulation with multiple conditions

    database tutorial question
    4
    0 Votes
    4 Posts
    0 Views
    J
    Probably. But personally I'm reluctant to use SQL for presentation logics, you'll find that it isn't very flexible. I would simply get the data you need: Select LocationID ,MeetingID ,Sum(Numvisitors) as TotalNumVisitors From Visitors where MeetingID IN (1,2) Group By LocationID,MeetingID And then do the Pivot in Reporting Services where it's called "Matrix control". (Here I assume that your "rdl report" means you're using SSRS) Light moves faster than sound. That is why some people appear bright, until you hear them speak. List of common misconceptions
  • How can i check executing time from mssql2008?

    question database
    3
    0 Votes
    3 Posts
    0 Views
    C
    print getdate() execute yoursp print getdate()
  • SELECT ... GROUP BY Error

    database help question
    18
    0 Votes
    18 Posts
    0 Views
    P
    SELECT MAX(TheDate), Type, Value FROM MyTable GROUP BY Type, Value
  • emeregency

    help database sql-server sysadmin
    5
    0 Votes
    5 Posts
    0 Views
    Y
    I love u so Much . Thanks a million for your guides . At first i could not get what you mean . for That accept my apologies . I had changed the type of every one of my variables but i had problem only on the return type of the Function . It must have been BigInt too . Thank you so much You helped me a lot Bye the way My Name is "Yousef" . It is same as "Josef" thanks and have a nice day
  • Stored Procedure to Handle CSV

    database algorithms help tutorial announcement
    7
    0 Votes
    7 Posts
    0 Views
    P
    When I've used BCP in the past, I've created a special table to hold the raw data (all as varchar) and used a trigger to move (and convert) the data to the real destination. This technique also allows for adding foreign keys as necessary. On the other hand, I only use BCP for occasional imports, if I have data I need to import frequently I write a console app or Windows Service to do it.
  • Remove empty spaces in a String in TSQL

    csharp asp-net sql-server com
    7
    0 Votes
    7 Posts
    0 Views
    R
    Here's a generic example: create table t (s sysname) insert into t select 'this is the reason that I did this. ' -- convert tabs to spaces update t set s = replace(s, ' ',' ') where charindex(' ', s) > 0 -- now do the work. while 1=1 begin update t set s = substring(s, 1, charindex(' ', s, 1)-1) + ' ' + ltrim(substring(s,charindex(' ', s, 1), 8000)) where charindex(' ', s, 1) > 0 if @@rowcount = 0 break end select s from t
  • 0 Votes
    2 Posts
    0 Views
    M
    Devesh Sinha wrote: Please provide me with some sample proc. Asking for the codez is just lazy. You need to decide if you want linier interpolation or a copy forward methodology. Both are very simple comparing the friday and monday rates and creating the new records as required. Never underestimate the power of human stupidity RAH