Forum Replies Created

Viewing 15 posts - 91 through 105 (of 229 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....

  • RE: SQL

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

  • 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...

  • RE: Query help please !

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

  • 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...

  • 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...

  • 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.

  • 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...

  • 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...

  • 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...

  • 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...

  • RE: "Best Practices" Questions

    Lord I hope this is a joke.

  • 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...

  • 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...

  • 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...

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