Forum Replies Created

Viewing 15 posts - 8,506 through 8,520 (of 8,731 total)

  • RE: Copy results, update a few fields, reinsert

    Please, review the code I sent as there are some errors I didn't see, mainly because I can't test the code. I hope you get the idea of what it's...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Copy results, update a few fields, reinsert

    Matthew Cushing (8/30/2012)


    Going to give it a try now, but I'm unsure what this does:

    ROW_NUMBER() OVER( ORDER BY position_id) + @new_position_id - 1

    That's taking the new position_id and adding the...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: select all the relationship data

    Something like this?

    DECLARE @TableTable(

    User_ID int,

    Phone_Numbervarchar(20),

    AddBy_UserIDint)

    INSERT @Table

    SELECT 1, '0194523638', 0 UNION ALL

    SELECT 2, '1122334455', 1 UNION ALL

    SELECT 3, '1122334456', 1 UNION ALL

    SELECT 4, '1111111111', 2 UNION ALL

    SELECT 5, '222222222 ',1...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Copy results, update a few fields, reinsert

    That's correct.

    It should perform much better, assuming the results are correct.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Copy results, update a few fields, reinsert

    Yes, that's why I wanted to know what GetUpLdNextInstance is doing.

    I just noticed that I erased the first one on my code by accident. I'm putting it back on now.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: How to get the SP's based on certain search string

    For SQL Server 2000 you should use syscomments table.

    You might not need it, but it's a good thing to now.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Copy results, update a few fields, reinsert

    I'm sure there's a way to avoid the SPs to obtain the Next IDs, but here's a possible suggestion.

    I can't assure it will work, but it can give you an...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: How to get the SP's based on certain search string

    SELECT o.name

    FROM sys.sql_modules m

    JOIN sys.objects o ON m.object_id = o.object_id

    WHERE definition like '%Employee%'

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Exporting data from a sql server table to text file- data transformation

    Something like this?

    SELECT CONVERT( varchar(23), GETDATE(), 121)+'000'

    If its datetime2 instead of datetime, you can use varchar(26) with no concatenation.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Table design help .

    You might be able to use something like this:

    I'm not sure if it would work as I can't see the DDL, but it can give you an idea.

    Update A

    SET col1...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: derived column

    I'm sorry, I didn't see the forum's name :blush:

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Table design help .

    Try to look for First Normal Form or Database normalization.

    Here's a start:

    http://www.sqlservercentral.com/blogs/jamesserra/2012/01/06/normalizing-your-database/

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: format for phone number

    Phil Parkin (8/29/2012)


    Luis Cazares (8/29/2012)


    It should be char or varchar.

    Ideally you should only store the digits and format the phone in the front end. However, you'll need an extra field...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: derived column

    How about this? It might be expensive, but it's a solution.

    WITH names( fullname) AS(

    SELECT 'shah, anki S.' UNION ALL

    SELECT 'dogula nanacy' UNION ALL

    SELECT 'baskin brian B' UNION ALL

    SELECT...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: format for phone number

    It should be char or varchar.

    Ideally you should only store the digits and format the phone in the front end. However, you'll need an extra field for extension if needed.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

Viewing 15 posts - 8,506 through 8,520 (of 8,731 total)