Forum Replies Created

Viewing 15 posts - 12,181 through 12,195 (of 13,461 total)

  • RE: Formatting numeric value of calculated column in View

    if you care to use SQL's built in rounding, you can simply use the convert function:

    select convert(decimal(10,3),108451.4587) results in 108451.459

    so simply format the column in your view as convert(decimal(10,3),columnmname)

    if you...

  • RE: Julian dates

    looks like you have some holes in your logic...let me try to explain.

    typically, a julian date is the number of dasy since a certain start date.

    select getdate(),convert(int,getdate())

    results:

    DATE: 2008-01-04...

  • RE: Trouble with opening sql files

    here's the easiest way i know:

    hold down shift, and right click on a .sql file.

    select "Open With..Choose Program" from the context menu.

    browse to the right folder, which is C:\Program...

  • RE: how to write collation agnostic queries?

    you can't set a session/connection to use a certain type of collation...it's all in the database.

    we run into this occasionally, where a client will have a default collation of case...

  • RE: Find locked tables

    here's an example SQL: note that the function object_name takes a second paramter, dbid, only in SQL 2005.

    Create Table #tmplocks (

    spid int,

    dbid int,

    objid int,

    indid int,

    type varchar(30),

    Resource varchar(30),

    Mode varchar(30),

    Status varchar(30) )

    insert...

  • RE: Find locked tables

    run the stored procedure sp_lock, and pay particular attention to two columns "Type" and "Mode"

    exec sp_lock

    a value of X for Mode means it is exclusively locked, and it...

  • RE: Next Sequence Values

    a scenario like you describe depends on a few assumptions that you don't mention. Do you need the values so you can insert new records? you do know that you...

  • RE: Mdf and Ldf to change hard disk location

    with NO downtime isn't possible...you can minimize it to under a minute per database, assuming the databases are not huge terabyte sized db's. two ways i can think of, maybe...

  • RE: Bizzare sp_makewebtask issue

    I'll ask a different way:

    when i create a stored procedure, i only want it to get data from the database it exists in.

    It is incredibly rare that i create a...

  • RE: Index Scan vs Index Seek

    an index seek is better...an index is stored in order. so if a query tries to look for say, PROD_ID=7, it knows to use the index to SEEK the PROD_ID...

  • RE: Bizzare sp_makewebtask issue

    I've got two ideas to look at:

    one is related to cross database chaining:

    one command points to one database, and the other points to a different one ...which is correct?

    set @muusid...

  • RE: Cannot add rights for Builtin/administrators (SQL 2000)

    the built in administrators group has rights to everything, so logically you shouldn't add or subtract rights to a built in group.

    you usually do this two ways, add a role,...

  • RE: Executing Stored Procedure with data time column

    you shouldn't use varchar fields to carry/pass datetime fields.

    your procedure should accept datetime fields instead:

    ALTER procedure P_REALTYTAX (@DATE1 datetime, @DATE2 datetime)

    as

    ...

    to test whether this would work, simply try sticking...

  • RE: Rename a column

    yeah, there's a stored procedure for it:

    exec sp_rename 'tablename.columnname','newname','COLUMN'

  • RE: Constraints that doesn't allow ID from another table.

    it seems that what you are describing is literally the definition of a foreign key.

    1.a child table can have the ParentId as a column, and a foreign key constraint in...

Viewing 15 posts - 12,181 through 12,195 (of 13,461 total)