Forum Replies Created

Viewing 15 posts - 5,641 through 5,655 (of 8,731 total)

  • RE: Stuff/DateAdd & Datename

    kd11 (10/21/2014)


    I'm not clear on the last statement line From (Values........ Also if I use todays date and run the first three lines of code, the CorrectedVersion Date is...

    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: Creating a table based on a non join ! ! !

    You should try a CROSS JOIN.

    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: Stuff/DateAdd & Datename

    The problem is that you're getting the month for the "current" date instead of subtracting the week as you do in your convert.

    Check this out:

    SELECT GivenDate,

    ...

    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: Continue on error

    The problem is with your way to handle errors. You need to have a try-catch block for each statement.

    I guess that you have something like this:

    BEGIN TRY

    ...

    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: Continue on error

    Do you have a try...catch block for each table/file?

    Can you post what have you tried?

    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: increment numbers in sql

    Why would you use string manipulation when it's easier to work directly with the numbers using some math?

    Here's a modification of Eirikur's code.

    USE tempdb;

    GO

    DECLARE @SAMPLE_SIZE INT ...

    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 export SQL scripts to the SQL Server?

    What do you mean by SQL compatible? SQL Server can't generate 100% SQL code. And no RDBMS can use it, either. SQL Server will generate T-SQL code which is 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: Create a table valued function

    This is an example on how to do it through dynamic code.

    DECLARE @divisor int = 80,

    @dividend int = 10,

    @table varchar(128)...

    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: Create a table valued function

    You can't do this. To be able to query different tables and columns, you need to use dynamic code. Dynamic code can be dangerous if it's not handled correctly and...

    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: Need help with design to store different forms and form data

    Hi scantoria,

    I'm glad that you read the questions. They weren't intended specifically for you, they're part of my signature and appear on all my posts. You wouldn't believe the amount...

    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: Get data in 2 columns

    You could do something like this:

    SELECT 'TableName1' AS ColumnA,

    SomeColumn AS ColumnB

    FROM TableName1

    UNION ALL

    SELECT 'TableName2' AS ColumnA,

    SomeColumn AS ColumnB

    FROM TableName2

    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 can I Prepend 2 CHAR in front of an INT?

    You just add a string literal as the column.

    SELECTc.cust_fullname AS Name,

    c.cust_membership_id AS Account,

    t.c_amount AS Amount,

    'CH' + CAST(t.i_ticket_id AS varchar(12)) AS Doc_Num,

    t.s_credit_tran_type AS Detail_Account,

    ...

    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: Need help with design to store different forms and form data

    No one would be capable of give any help with such little information. You're asking for a DB design but that can be a really big project and you might...

    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: Having Issues With Date Conversion from a String

    Could you post DDL for tables and sample data that will replicate the issue?

    Table and column names can be changed 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
  • RE: Having Issues With Date Conversion from a String

    Are you sure that's the problem?

    If I run the following, it gives the correct result:

    SELECT TBI.CurrDateTime,

    CAST((LEFT(TBI.CurrDateTime, 10) + ' ' + RIGHT(RTRIM(LTRIM(TBI.CurrDateTime)), 15)) AS DATETIME2(6)),

    ...

    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 - 5,641 through 5,655 (of 8,731 total)