Forum Replies Created

Viewing 15 posts - 5,611 through 5,625 (of 8,731 total)

  • RE: Isnumeric function - ISNUMERIC('1E2')

    Take a look at this article. It shows what's happening and how to get an all-digits validation.

    http://www.sqlservercentral.com/articles/ISNUMERIC()/71512/

    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 name a column the same name of a tablename

    You need to learn that if you want to get the count of the rows the main option is to use "SELECT COUNT(*) FROM Table". You need to learn 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: Are the posted questions getting worse?

    GilaMonster (10/25/2014)


    Anyone live anywhere where they can easily get a variety of different dried chillies? Stuff Costeño, New Mexico, Choricero, Arbol, Cascabel, Ancho, Mulatto, Negro, Pasilla?

    I do, but I'm not...

    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: Help with looping

    I have to admit that the CROSS APPLY was because I went lazy and didn't change it for an INNER JOIN. Here's an alternative with additional columns that show how...

    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: Help with looping

    There's no need to loop through the table. You should post sample data in a way that we can just execute it and start working on it. I did it...

    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 name a column the same name of a tablename

    For one moment, forget about dynamic code. Try writing a static query that will do what you need.

    When you're sure that you have the correct query, you can use 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: How to name a column the same name of a tablename

    You don't need to create a table each time you need to query something. A SELECT will be enough.

    Check the following articles:

    COUNT(): http://msdn.microsoft.com/en-us/library/ms175997.aspx

    QUOTENAME(): http://msdn.microsoft.com/en-us/library/ms176114.aspx

    Dynamic SQL: http://www.mssqltips.com/sqlservertip/1160/execute-dynamic-sql-commands-in-sql-server/

    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 name a column the same name of a tablename

    No, I mean building the string. Something like this:

    SELECT Top 1 'The table I need is ' + name + '. Now I can create a SELECT statement with it'

    FROM...

    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 name a column the same name of a tablename

    You have posted your code 4 times. It's easy to understand even if it's showed as a quote. When posting, review that you're using the correct tags.

    Follow the instructions in...

    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 name a column the same name of a tablename

    Your variable @MyRowCount will always return 1 or 0 because you're limiting the results.

    You have a query that will return the name of the table. Using that value, build a...

    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 name a column the same name of a tablename

    dogramone (10/23/2014)


    Just a thought, dynamic SQL, selecting the table names into a variable and loop through the resulting set of table names excecuting the count query for each.

    conceptually ...

    select 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: How to name a column the same name of a tablename

    dariuslearn (10/23/2014)


    so the table name resulting from the following query should become the column name.

    SELECT name

    FROM sys.tables

    WHERE name = (select Top 1 name from sys.tables)

    ;

    You don't need to read...

    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: Review on SELECT query

    spaghettidba (10/23/2014)


    ChrisM@Work (10/23/2014)


    Luis Cazares (10/22/2014)


    Did you leave something out of your post? There seems to be no reason to have the 3 left joins in that query as it is.

    Without...

    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: What To Do When the Import and Export Wizard Fails (Part I)

    You don't need Pearl, you could use xp_cmdshell.

    For inserting data, you could use pure T-SQL with BULK INSERT.

    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: Excel Source in SSIS

    Below the post textbox, there's a section for Attachments. You can use that. 😉

    (See the attached image)

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