Forum Replies Created

Viewing 15 posts - 466 through 480 (of 617 total)

  • RE: Format

    Jeff Moden (12/28/2007)


    This should do it, Mike...

    SELECT *

    FROM yourtable

    WHERE ISDATE(LEFT(yourcolumn,4))=1

    AND yourcolumn LIKE '[0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9][0-9]'

    Jeff,

    Would this have been faster

    SELECT *

    FROM yourtable

    WHERE yourcolumn LIKE '[12][089][0-9][0-9]-[0-9][0-9][0-9][0-9][0-9]'

    AND ISDATE(LEFT(yourcolumn,4))=1

    i.e. Restrict the 1st 2 columns...

    Kenneth FisherI was once offered a wizards hat but it got in the way of my dunce cap.--------------------------------------------------------------------------------For better, quicker answers on T-SQL questions, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/[/url]Link to my Blog Post --> www.SQLStudies.com[/url]

  • RE: Checking Row with Column value

    Ok I made some assumptions on the format of your accounts but here is at least one solution. Its worked well for me in the past but I would...

    Kenneth FisherI was once offered a wizards hat but it got in the way of my dunce cap.--------------------------------------------------------------------------------For better, quicker answers on T-SQL questions, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/[/url]Link to my Blog Post --> www.SQLStudies.com[/url]

  • RE: Isnull function

    Ok probably one of the more interesting discussions on NULL and comparison operators but I have a question. I feel like I missed the 1st half of the discussion....

    Kenneth FisherI was once offered a wizards hat but it got in the way of my dunce cap.--------------------------------------------------------------------------------For better, quicker answers on T-SQL questions, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/[/url]Link to my Blog Post --> www.SQLStudies.com[/url]

  • RE: Retrospective Reporting

    Your solution looks like the best way to handle that particular problem but I would make 2 changes.

    Instead of creating a temporary table each time you run the...

    Kenneth FisherI was once offered a wizards hat but it got in the way of my dunce cap.--------------------------------------------------------------------------------For better, quicker answers on T-SQL questions, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/[/url]Link to my Blog Post --> www.SQLStudies.com[/url]

  • RE: Create View Help

    Try isnumeric. It would look something like this.

    CASE WHEN ISNUMERIC(RECENTINR)=1 THEN CAST(RECENTINR AS DECIMAL(10,2) ELSE 0 END

    Kenneth FisherI was once offered a wizards hat but it got in the way of my dunce cap.--------------------------------------------------------------------------------For better, quicker answers on T-SQL questions, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/[/url]Link to my Blog Post --> www.SQLStudies.com[/url]

  • RE: function vs. another table join

    I think it primary depends on the type of testing. Your absolutely right in that testing on a small amount of data or with a simplified query isn't going...

    Kenneth FisherI was once offered a wizards hat but it got in the way of my dunce cap.--------------------------------------------------------------------------------For better, quicker answers on T-SQL questions, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/[/url]Link to my Blog Post --> www.SQLStudies.com[/url]

  • RE: function vs. another table join

    I agree with Jeff that you should do at least some time trials with your data and setup.

    That being said I have used the table method with great...

    Kenneth FisherI was once offered a wizards hat but it got in the way of my dunce cap.--------------------------------------------------------------------------------For better, quicker answers on T-SQL questions, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/[/url]Link to my Blog Post --> www.SQLStudies.com[/url]

  • RE: Change Connection with T-SQL

    Kenneth Fisher (12/10/2007)


    I tried what you suggested .. and it seemed to work .. at first. But now for some reason I'm getting the following result:

    Connecting to servername...

    Disconnecting connection...

    Kenneth FisherI was once offered a wizards hat but it got in the way of my dunce cap.--------------------------------------------------------------------------------For better, quicker answers on T-SQL questions, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/[/url]Link to my Blog Post --> www.SQLStudies.com[/url]

  • RE: Change Connection with T-SQL

    I tried what you suggested .. and it seemed to work .. at first. But now for some reason I'm getting the following result:

    Connecting to servername...

    Disconnecting connection from servername...

    And...

    Kenneth FisherI was once offered a wizards hat but it got in the way of my dunce cap.--------------------------------------------------------------------------------For better, quicker answers on T-SQL questions, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/[/url]Link to my Blog Post --> www.SQLStudies.com[/url]

  • RE: Table Sostitution

    Try running the following query looking for either Parent_Table or Child_Table is your table name. Just to confirm that you don't have any foreign keys. You may also...

    Kenneth FisherI was once offered a wizards hat but it got in the way of my dunce cap.--------------------------------------------------------------------------------For better, quicker answers on T-SQL questions, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/[/url]Link to my Blog Post --> www.SQLStudies.com[/url]

  • RE: Unattended Installation OF SQL SErveR 2005

    I wrote an unattended install for my client tools and it worked quite well. Just look at the template.ini on your install disk. It has instructions and all...

    Kenneth FisherI was once offered a wizards hat but it got in the way of my dunce cap.--------------------------------------------------------------------------------For better, quicker answers on T-SQL questions, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/[/url]Link to my Blog Post --> www.SQLStudies.com[/url]

  • RE: copy Sql Trace into a table

    declare @rc int

    EXEC @rc = prSQLSecurityAudit 'C:\Trace\LOG'

    SELECT * FROM :: fn_trace_getinfo(default)

    -- INTO TableName trys to create a new table.

    -- This inserts into an existing table

    INSERT INTO Trace_Table

    SELECT * FROM...

    Kenneth FisherI was once offered a wizards hat but it got in the way of my dunce cap.--------------------------------------------------------------------------------For better, quicker answers on T-SQL questions, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/[/url]Link to my Blog Post --> www.SQLStudies.com[/url]

  • RE: Forum Etiquette: How to post data/code on a forum to get the best help

    You know all of this remind me of one of my favorite help requests I had when I was a lead developer years ago.

    "Its broken"

    Literally .. that was it. ...

    Kenneth FisherI was once offered a wizards hat but it got in the way of my dunce cap.--------------------------------------------------------------------------------For better, quicker answers on T-SQL questions, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/[/url]Link to my Blog Post --> www.SQLStudies.com[/url]

  • RE: Warning when rebuilding index in another database

    I'm going to make an educated guess. Although fair warning it is just an educated guess. I belive what is happening is that when you do an alter...

    Kenneth FisherI was once offered a wizards hat but it got in the way of my dunce cap.--------------------------------------------------------------------------------For better, quicker answers on T-SQL questions, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/[/url]Link to my Blog Post --> www.SQLStudies.com[/url]

  • RE: Forum Etiquette: How to post data/code on a forum to get the best help

    Great article Jeff. I much prefer to spend my time answering a question and not coming up with test cases.

    Jeff Moden (11/27/2007)


    I suspect that the very process of presenting...

    Kenneth FisherI was once offered a wizards hat but it got in the way of my dunce cap.--------------------------------------------------------------------------------For better, quicker answers on T-SQL questions, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/[/url]Link to my Blog Post --> www.SQLStudies.com[/url]

Viewing 15 posts - 466 through 480 (of 617 total)