Forum Replies Created

Viewing 14 posts - 331 through 345 (of 345 total)

  • RE: Another create trigger question

    Although this will cause an error if more than one row is updated. You could change

    SET @Last_Login_Date = (SELECT Last_Login_Date FROM inserted);

    to

    SET @Last_Login_Date = (SELECT TOP 1 Last_Login_Date FROM...

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

  • RE: Another create trigger question

    Try this:

    change

    IF EXISTS

    (SELECT 1

    FROM inserted

    WHERE user_id = 'bbsupport')

    to

    IF NOT EXISTS

    (SELECT 1

    ...

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

  • RE: create table with a subset of columns from another table

    This should help:

    http://msdn.microsoft.com/en-us/library/ms190766.aspx

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

  • RE: create table with a subset of columns from another table

    something i whipped up:

    create table A (col1 int, col2 int, col3 int, col4 int)

    create table B (col1 int, col2 int)

    declare @field_list varchar(max)

    --set @field_list = ''

    ;with cte as

    (select column_name, data_type...

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

  • RE: To start sql output frm the middle of the page

    Jeff Moden (1/6/2011)


    toddasd (1/6/2011)


    declare @a varchar(100)

    set @a = 'Number of files=4'

    select substring(@a, 17, len(@a))

    :blink:

    To me, looks like he wanted the "4" from the string. So, you know, taking a shot...

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

  • RE: RANK() returns consecutive integers

    Is it considered cheating that I went to the BOL before answering the question and read "If two or more rows tie for a rank, each tied rows receives the...

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

  • RE: Update Multiple Rows

    then lets make it a proc:

    create procedure updatetable

    @a varchar(10),

    @b-2 varchar(10),

    @c varchar(10)

    as

    update whoknows

    set col1 = @a, col2 = @b-2, col3 = @c where rowID in (1,2,3,4,5)

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

  • RE: To start sql output frm the middle of the page

    declare @a varchar(100)

    set @a = 'Number of files=4'

    select substring(@a, 17, len(@a))

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

  • RE: Update Multiple Rows

    according to your specs, this is what you need:

    update whoknows

    set col1 = 'MMADAS', col2 = 'HHFASD', col3 = 'HGGOI' where rowID in (1,2,3,4,5)

    🙂

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

  • RE: stored procedure for paging table

    CELKO (12/29/2010)


    sa.ordekci (12/29/2010)


    Hi! i have two tables that are category and products. when i select a catageroy(on my asp.net project) i will list products associated with that category. and i...

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

  • RE: How can i display the name of the folder from a field in a table.

    Actually no. I had to go back in my files and look, but it's the one that uses the tally table.

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

  • RE: How can i display the name of the folder from a field in a table.

    You could also use the split function and get a list of all the folders:

    SELECT * FROM dbo.fn_Split('/folder/folder1/folder2/12345-ABCD.txt','/')

    WHERE IDX = 3

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

  • RE: cast does not work in case statement

    Some sample data and DDL please.

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

  • RE: Dropping 1000s of objects from database

    Thanks for the response.

    Right-on about the schemas. Out of 607 total, 3 are used. I'm still suspect though, I don't want to removed unused schemas like db_owner, db_accessadmin, etc. I'll...

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.

Viewing 14 posts - 331 through 345 (of 345 total)