Forum Replies Created

Viewing 15 posts - 14,896 through 14,910 (of 14,952 total)

  • RE: Index Tuning

    Based on your original question, the indexes I'd probably use are:

    empid (clustered)

    deptid (nonclustered)

    Then look at a few execution plans for a few of the common queries that use those columns....

  • RE: Importing Data from SQL Server Tables to Sql Server databsae

    Some of your questions aren't technical in nature. For example, what to do about data already in the "master table". That depends on what data is in it...

  • RE: When To Use Cursors

    Never mind on the repeating hierarchy. I figured it out. (I think.)

  • RE: When To Use Cursors

    Just tested a CTE with 101 levels of hierarchy, and it worked. No error.

  • RE: When To Use Cursors

    The place I've had to use iterative code in T-SQL is hierarchies. (I tend to use While instead of cursors, because I can have some set-based operations mixed in...

  • RE: CASE Statement Help needed

    My first guess, based on the data given, is that "400" is a table name (or table alias). In that case, what you need is "[400].[PatientAge]", instead of "[400.PatientAge]"....

  • RE: Large Table with Historical Data

    One way to do it would be an outer join on the existing data vs the incoming data. That would give you rows that have been changed or are...

  • RE: Optimize insertion of multiple rows

    I'd seriously consider using SSIS for this, if you're using SQL 2005. It can be set up to read various input file formats, variations in column names, etc. ...

  • RE: How to create System StoreProcedure ?

    Yes, it is possible to create a "system" stored procedure, and yes, it's almost always a bad idea.

    What problem are you trying to solve by creating one? Most unusual...

  • RE: need help in query design

    Yes, you could write this as a single query. It would take a Case statement in the Group By clause. But, I'm with Gail on this one: You're...

  • RE: Check Constraint Expressions

    A trigger can be necessary for checking data validity if the validity is dependent on data in other tables or other rows of the same table, and can't be satisfied...

  • RE: concatenation problem

    set nocount on

    declare @customers table (

    Row int identity primary key,

    ID int NOT NULL,

    Number [smallint] NULL ,

    starting_point [varchar] (5) NULL ,

    ending_point [varchar] (5) NULL

    )

    insert into @customers values (888,1, 'abc', 'def')

    insert into...

  • RE: Table Defaults

    Robert, I like your solution of casting dates as integers (I'd cast the datetime as float, but integer works too). Is there any reason not to use an isnull...

  • RE: Check Constraint Expressions

    I'm not sure of a good beginning article on the subject. Basically, it's just a way to express boolean checks on data. Articles on that subject tend to...

  • RE: Table Defaults

    I tend to use defaults for a couple of reasons.

    On a column like "DateCreated", use a default and use "default" in insert statements. Having "default" in there helps document...

Viewing 15 posts - 14,896 through 14,910 (of 14,952 total)