Search:

Type: Posts; User: GaryMazzone

Page 1 of 13 1 2 3 4

Search: Search took 24.09 seconds.

  1. Replies
    3
    Views
    248

    Re: [RESOLVED] Deprecated Join Syntax

    I hate still running into that syntax, still see it once in a while, even worse is when you see the old Oracle syntax


    .....
    FROM tableA, tableB
    Where tableA.x (+) = tableB.y

    Outer Join
    ...
  2. Re: rows in incorrect order when inserting into SQL database

    When you bulk insert the rows they are placed in the order of the PK of the table... (I would normally used a BIGINT IDENTITY(1,1) to define it). The rows might seem out of order when you select...
  3. Re: rows in incorrect order when inserting into SQL database

    A SQL database backup is full database only.... you can't recover just some data out of one table by doing a restore.... Can it be done yes would I want to do it it depends on what the person/company...
  4. Re: Running code against Sqlserver worked fine first time but now 'Access denied'

    You need to add a file name to the backup command.. It looks like you are sending a folder path without a file name
  5. Re: Find value that is not included in a group of rows.

    Maybe something like this?


    SELECT
    WebPayLog_strStep
    FROM dbo.test1
    EXCEPT
    SELECT
    WebPayLog_strStep
    FROM dbo.test2
  6. Re: Why do I copy Table1 contents to Table with the error ?

    What is the definition of the table TABQUANHEGD I will be that there is a foreign key named FK_TABKHOKIEMKECT_TABKHOKIEMKE on the table that references table TABQUANHEGDTT. If you do not want the...
  7. Re: Why not use VarChar(8000) always?

    Think of it this way... A page in SQL Server can hold 8K of space. You fill in your row (which has an 8000 sized varchar field) and use 20 of it. Now more rows are added and things are looking...
  8. Re: New Clustered Index already 50% fragmented

    It is a hit on performacne since it is another read
  9. Re: New Clustered Index already 50% fragmented

    I am saying there should always be a Primary Key on a table. I would tend to make it a BIGINT. I would create secondary indexes (NONCLUSTERD) as needed (including UNIQUE) if you want to store the...
  10. Re: New Clustered Index already 50% fragmented

    The PK just keeps the table from getting fragmented. The integer is an ever increasing number and then next one used can never be less than the previous. Then index on the names might (and probably...
  11. Re: New Clustered Index already 50% fragmented

    The PK has nothing to do with what is there. You can still have an index on a field even making it unique the use of varchars and GUID's are horrible choices for clustered keys. You can even leave...
  12. Re: New Clustered Index already 50% fragmented

    Varchar(255) is a horrible choice as a clustered primary Key... I would use an Identity as the clustered key also the PK) and create a unique index on the current field. And yes it should have a...
  13. VS 2017 Re: Populating Labels From SQL Database

    You are never moving to the next record. Only reading the first one
  14. Replies
    15
    Views
    751

    Re: Simple alias query

    Again not completely true with column alias, you cannot use column alias in a group by clause (need actual column names). Not sure on rolliup clause as I don't normally use them
  15. Replies
    15
    Views
    751

    Re: Simple alias query

    As you can see in the image there is nothing named supervisorname it ushould be = U.username
  16. Replies
    15
    Views
    751

    Re: Simple alias query

    It can't be correct post the structure of the 2 tables. This is what I do for a living (writing complicated SQL for developers, and this one is simple)
  17. Replies
    15
    Views
    751

    Re: Simple alias query

    This is how I would write the query:


    SELECT
    CC.ID
    ,CC.centrename
    ,U.username as supervisorname
    FROM costcentres CC
    LEFT JOIN users U
    on U.id= CC.supervisorno
  18. Re: Why the error can't login to the sa account while sa account test is connect good

    How is the connection opened? If it is opened in a mode that changes the properties to single user then if any user is logged into the database no one else can be. With out seeing the connections...
  19. Re: VISUAL STUDIO 2017 how to connect 2 computers to same program?

    It will accept remote connections just not by default. You will need to go into the SQL Server manager and set up allow remote for it and to ensure that the network protocols are enabled (not by...
  20. Replies
    4
    Views
    501

    Re: sql server 2012 jobs not working

    Then it is set on the job....
  21. Replies
    4
    Views
    501

    Re: sql server 2012 jobs not working

    You have set an Idle Pct on the agent... Probably by error I would look at the agent properties
  22. Replies
    18
    Views
    1,003

    Re: Data Storage

    The problem with that is that most places that want to use EF (or any like it) want to move away from having the DBA (or a good SQL Developer) create code in the data base and just want to use the...
  23. Replies
    18
    Views
    1,003

    Re: Data Storage

    Please as a DBA DO NOT USE the entity framework. It writes crappy SQL
  24. Re: Help with a query to find duplicates

    Did you try string_split into a table (STRING_SPLIT('12.45|123|123.45|123','|')) This will place the values into a table you can then query against using a count and having statement

    as an...
  25. Re: I want a concurrency violation and am not getting one

    I used a modified_DateTime column for this (modifiedDateTime DATETIME (or datetimeoffset) NULL). When you select the row always include the modfiedDateTime column. Now when you go to do the update...
  26. Re: Foreign Key, but to which table it depends (SQL Server)

    I would tend to slightly disagree with Funky on not having more than 1 FK to the table. I have had to do this before... I created 2 columns P_ContorlsId NULLABLE with FK to the P Controls table and...
  27. Replies
    9
    Views
    514

    Re: How to group with distinct

    I have a very hard time spelling anything... In fact one place I worked said they always knew it was me by the unique mis-spelling of things
  28. Re: Why is my MS Access database often corrupted?

    I gave up on MS Access once I tried loading large amounts of data to it quickly it would always corrupt. It seemed to be around handling of large amounts of data
  29. Replies
    9
    Views
    514

    Re: How to group with distinct

    I would write it like this:


    SELECT
    Exemptions
    ,jdx
    ,COUNT(*)
    FROM Accounts
    GROUP BY Exemptions,jdx
    ORDER BY jdx;
  30. VS 2012 Re: How to find a record with same lastname and firstname and copy their ID Numbers?

    A more basic question... Can the Last_name, First_name combination be duplicated? If so then how do you decide which one to use?
  31. Re: Best way to insert 7 million rows to a table

    @tg he is running MySQL not SQL Server. I also do not understand what indexes are not working means. If the rows are in the table it should be picked up by the index. If not then are you even sure...
  32. Re: Best way to insert 7 million rows to a table

    Personally i would run this into a new table (mimic the structure of the real table with out indexes or triggers). Once the data is loaded the strat the next part moving the data to the actual table
  33. Re: MS Access Error - Syntax Error in Union Query

    Be careful saying semi-colon is not really needed. Yes in this case the ; before the UNION statement is wrong. Some database systems require the ; be in place to execute a SQL statement. Just...
  34. Replies
    8
    Views
    645

    Re: SQL Server copy table

    You can just use Select * into yourtableName from TheOrginalTableName

    That get all data types but not the indexes or constraints
  35. Replies
    6
    Views
    570

    Re: MSSQL 2008 Update Statement Fails

    I would do as Funky suggest. Put a break point in the code. when you get to each SQL statement to be executed copy the full code and try it in SQL server SSMS. Did it work? Move to the next line
  36. Replies
    8
    Views
    363

    Re: Trigger keeps inserting duplicates

    i would check that the data doesn't exist yest
  37. Replies
    8
    Views
    363

    Re: Trigger keeps inserting duplicates

    What is this trying to do... very insert puts a row in inserted and you are looking there for a record and then inserting again
  38. Re: An interesting query based on a date buried in a big long string

    Not avail on the version of SQL we are using. Also the field is 1024 but the input could be truncated during the insert so I don't always get properly formed JSON
  39. Re: An interesting query based on a date buried in a big long string

    Dumping that all into a single blob string is difficult to work with (believe me I know) here we are using a product from solarwinds named syslogger
    it dumps log files into a table in one field......
  40. Re: An interesting query based on a date buried in a big long string

    Can you use string split..... string_split(bigstring,' ')
    then look for date
Results 1 to 40 of 500
Page 1 of 13 1 2 3 4



Click Here to Expand Forum to Full Width