Forum Replies Created

Viewing 15 posts - 181 through 195 (of 212 total)

  • RE: SQL Server Agent won't start with new domain logon account

    And you are absolutely sure you are using the correct domain account password?

  • RE: basic sql

    Pinal Dave (sqlauthority.com) has a great collection of SQL Server term and concept definitions at http://blog.sqlauthority.com/2008/09/20/sql-server-2008-interview-questions-and-answers-complete-list-download/[/url]. They are labeled 'SQL Server 2008 interview questions and answers,' but should be...

  • RE: SQL in code vs. stored procedures

    Ray K (12/18/2009)


    So, way back when I was coding ASP.NET, I was in the habit of embedding SQL code (for example, "select * from sometable where somecolumn = somedefinition"), putting...

  • RE: Simple query help

    Jeff Moden (12/6/2009)


    Thank you for taking the time to post the test data the way you did... saves me a lot of time...

    This will do it...

    ;

    WITH

    ctePreAgg AS

    (

    SELECT Name1,

    ...

  • RE: instances,harddisk

    how do i determine the no of instances on sql server unding t sql or anyother method . and how do i know total size of harddisk .

    please let me...

  • RE: A query

    A primary key is a constraint that uniquely identifies every row in a table. It forces a unique value for that field of every record. It...

  • RE: Update with an aggregate

    You don't need to use a cursor or a loop. You can update the DailyPercent col for a particular month like this:

    update DailySalesTable

    set DailyPercent = Sales/(

    select sum(Sales)

    from DailySalesTable...

  • RE: pull all values from reference table

    Actually, now that I see your query, I think the problem may be resolved by using a FULL OUTER JOIN in place of a LEFT OUTER JOIN.

  • RE: pull all values from reference table

    Why can't you just use ISNULL to replace the null value with a zero?

  • RE: Adding a trigger/constraint to SUM child rows on INSERT

    The more important question is "Why do you think that you need to do this?" Generally the preferred approach to provide this information is to just calculate it on request:

    SELECT...

  • RE: Adding a trigger/constraint to SUM child rows on INSERT

    Yes, I think a an insert trigger would be the simplest solution. I made an example for you, using the Northwind Orders and Order Details tables. 'TriggeredDetails' is...

  • RE: Script to create DateStamp folder

    Try setting the date variable in SQL Server, not Windows:

    select @setdate = cast(datename(year, getdate())as varchar(10))+'_'+cast(datepart(month, getdate())as varchar(10))

    select @CreateDir='mkdir G:\Testing\test1\'+@setdate

    That way, your @CreateDir var prints:

    mkdir G:\Testing\test1\2009_12

    Windows assumes that %folderdate% is a...

  • RE: How to split the value

    I guess I come back to the fact that for there to be a clean methodology I either need to have a delimiter or a set size to chop off...

  • RE: Getting QUOTENAME script to work with datatypes

    Do I substitute '[image]' in place of '[NULL VALUE]' for this line?

    No, the '[NULL VALUE]' string that I substituted is just a placeholder. You could put anything in there...

  • RE: Getting QUOTENAME script to work with datatypes

    Wrap each QUOTENAME function instance with an ISNULL function:

    select 'Select '

    + ISNULL(QUOTENAME(NoteID,''''),'[NULL VALUE]')+ ','

    + ISNULL(QUOTENAME(CompanyID, ''''),'[NULL VALUE]') + ','

    ...

    from dbo.NOTE_tblNote

Viewing 15 posts - 181 through 195 (of 212 total)