Forum Replies Created

Viewing 15 posts - 136 through 150 (of 497 total)

  • RE: zero for Null

    Not sure if this is the real code or not, but I would recommend using the complete column list instead of select *. What if someone adds a new column...



    Microsoft Certified Master - SQL Server 2008
    Follow me on twitter: @keith_tate

    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: Need help in table design

    That is not enough information to go off of. Please give more details for the needs of the table. There isn't a one size fits all table design, so the...



    Microsoft Certified Master - SQL Server 2008
    Follow me on twitter: @keith_tate

    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: checkdb - error but no issue?

    Looks like you need to create a new database and start moving data.



    Microsoft Certified Master - SQL Server 2008
    Follow me on twitter: @keith_tate

    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: Check for null or empty values and return 0

    Coalesce will return the first non-NULL value, so if the sum Previous_Year + Current_Year returns a NULL value it will go to the next value in the comma delimited list...



    Microsoft Certified Master - SQL Server 2008
    Follow me on twitter: @keith_tate

    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: Help with Data Format

    I would start with normalizing your tables appropriately. That would make this a lot easier to do. This should get you what you need:CREATE TABLE [dbo].[A_TABLE](

    [A_ID] [varchar](40) NOT NULL,

    [A_SOURCE] [varchar](10)...



    Microsoft Certified Master - SQL Server 2008
    Follow me on twitter: @keith_tate

    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: Check for null or empty values and return 0

    You can use NULLIF and COALESCE to accomplish this. I would also use LTRIM and RTRIM to get rid of extra spaces i.e. coalesce(nullif(rtrim(ltrim(column)),''),0)



    Microsoft Certified Master - SQL Server 2008
    Follow me on twitter: @keith_tate

    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: More than 1 alphanumeric chars in a string

    Sean Lange (3/12/2014)


    In an effort to evaluate which of the two posted methods would perform better I put together a quick test with 1000 random names. It is kind of...



    Microsoft Certified Master - SQL Server 2008
    Follow me on twitter: @keith_tate

    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: Script to restore all dbs on a server

    I would consider doing it with Powershell here is an article that discusses doing just that: http://www.sqlservercentral.com/blogs/everyday-sql/2013/02/12/t-sql-tuesday-use-powershell-to-restore-a-database-on-a-different-server/



    Microsoft Certified Master - SQL Server 2008
    Follow me on twitter: @keith_tate

    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: Merge Partitions in SQL Server 2008 R2

    You want to make sure that you are only performing a metadata operation and not a data move operation. There are best practices around what you are trying to do....



    Microsoft Certified Master - SQL Server 2008
    Follow me on twitter: @keith_tate

    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: More than 1 alphanumeric chars in a string

    BTW Shan, Sean is one of the SQL Ninjas 😀



    Microsoft Certified Master - SQL Server 2008
    Follow me on twitter: @keith_tate

    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: More than 1 alphanumeric chars in a string

    Now look for one of the SQL Ninja's on the forum to give you something cleaner and better, but this should work for now.with Employee as

    (

    select 'ABC' as Surname, 'x.yz'...



    Microsoft Certified Master - SQL Server 2008
    Follow me on twitter: @keith_tate

    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: Logfile is 150GB !!!

    SELECT log_reuse_wait_desc, * FROM MASTER.sys.databases

    Not sure how many databases you have on your server so you might want to limit the results that are coming back to only the database...



    Microsoft Certified Master - SQL Server 2008
    Follow me on twitter: @keith_tate

    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: Periodic Differential Backup Failures

    I would check the maintenance plan, or some other job that might be doing maintenance, to see if your recovery model is getting changed thus breaking you backup chain. During...



    Microsoft Certified Master - SQL Server 2008
    Follow me on twitter: @keith_tate

    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: Start job on another server

    shahgols (3/10/2014)


    Hi everyone, I am trying to start a job on a sql 2008 r2 server from a sql 2012 server. I have the following code:

    exec msdb.dbo.sp_start_job @job_id =...



    Microsoft Certified Master - SQL Server 2008
    Follow me on twitter: @keith_tate

    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: SQL Query Help - Thank you.

    It looks like you just need a Left Outer Join on the two tables between ID, DOW and checking the StartTime vs. the Resettime:WITH SampleData (PERSON,[DATE],[HOURS],[STARTIME],[ENDTIME],,[ID],[DOW]) AS

    (

    ...



    Microsoft Certified Master - SQL Server 2008
    Follow me on twitter: @keith_tate

    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

Viewing 15 posts - 136 through 150 (of 497 total)