Forum Replies Created

Viewing 15 posts - 91 through 105 (of 230 total)

  • RE: SQL

    Even without your data, let me give you an example. Say I have a table full of end-of-day stock prices, as well as the sector in which that stock resides....

    Executive Junior Cowboy Developer, Esq.[/url]

  • RE: SQL

    Id be happy to if you can provide me some sample data, and expected results.

    Executive Junior Cowboy Developer, Esq.[/url]

  • RE: SQL

    A group by can only contain the grouped columns or aggregates. If you change the column in the group by, you roll up at a different granularity. Since there...

    Executive Junior Cowboy Developer, Esq.[/url]

  • RE: Query help please !

    EDIT: Removing these solutions. I think they just add confusion.

    Executive Junior Cowboy Developer, Esq.[/url]

  • RE: Query help please !

    There's more than one way to skin this cat. Here's one:

    if object_id('tempdb.dbo.#fileSize') is not null drop table #fileSize

    create table #fileSize

    (

    database_id int,

    space_used_in_mb...

    Executive Junior Cowboy Developer, Esq.[/url]

  • RE: char(n) v varchar(n) - data type length question

    For varchar and nvarchar, it's sufficient to take the datalength of the string and add two bytes for the offset block. For most every day purposes, you don't really need...

    Executive Junior Cowboy Developer, Esq.[/url]

  • RE: Running Totals

    NumptySpence (1/12/2015)

    I can get the solution using cursors

    If you find yourself saying this in SQL, it's usually the wrong way.

    Executive Junior Cowboy Developer, Esq.[/url]

  • RE: Insert/Update trigger

    Are the users executing these statements directly against the database? I would think if you're controlling access to these operations via a stored procedure, you could bake in the logic...

    Executive Junior Cowboy Developer, Esq.[/url]

  • RE: Inserting FK information into a temp table

    I'm not sure I follow. The first example allows you to do just that. You can define any sql you want and still insert it into the temp table defined...

    Executive Junior Cowboy Developer, Esq.[/url]

  • RE: Inserting FK information into a temp table

    if this is to perform cross database maintenance, powershell might be a better option (one which I'm altogether not familiar with). But what I was saying about the temp tables...

    Executive Junior Cowboy Developer, Esq.[/url]

  • RE: Inserting FK information into a temp table

    You could use a regular temp table as well, unless you need the temp table to be accessible from other SPIDs, in which case I'd recommend using a persisted table.

    Or...

    Executive Junior Cowboy Developer, Esq.[/url]

  • RE: "Best Practices" Questions

    Lord I hope this is a joke.

    Executive Junior Cowboy Developer, Esq.[/url]

  • RE: Mapping Hierarchical Relationships

    thanks for the replies. I'm heading out for the evening so I haven't had a chance to read the articles yet but I will.

    Jeff, to your question perhaps...

    Executive Junior Cowboy Developer, Esq.[/url]

  • RE: Validating T-SQL

    I dont know if this behaves any different from parseonly but...

    set noexec on

    select 1

    set noexec off

    Edit I don't think this would gain you anything over parseonly. The only difference I...

    Executive Junior Cowboy Developer, Esq.[/url]

  • RE: When Creating Tables, Is a RecID Column necessary?

    Alexander Suprun (12/22/2014)


    sqlvogel (12/22/2014)


    No, a "record number" / surrogate key is not necessary in all cases. Adding such a column to every table offers no general advantage in terms of...

    Executive Junior Cowboy Developer, Esq.[/url]

Viewing 15 posts - 91 through 105 (of 230 total)