Forum Replies Created

Viewing 15 posts - 10,936 through 10,950 (of 15,381 total)

  • RE: Create view with no outer joins

    Luis Cazares (8/27/2012)


    I guess it was wrong for me to read the 2012 version as it is less explicit.

    But I still believe the OP won't have an option on creating...

  • RE: Create view with no outer joins

    Luis Cazares (8/27/2012)


    jdbrown239 (8/26/2012)


    Need to create view with no outer joins so I can index the view.

    I can't find a restriction for indexed views that involves outer joins http://msdn.microsoft.com/en-us/library/ms191432.aspx....

  • RE: Issue with GETDATE()

    Chow's (8/27/2012)


    I'm saving the time of which the record gets saved by GETDATE() function. It is taking server time only not location time

    GETDATE() is a sql function. It will ALWAYS...

  • RE: combine two tables

    PLC-Master (8/27/2012)


    Hi,

    I did add in attachment overlap of two views:

    yelow -exist in both views

    Thanks

    Nobody is going to be able to provide much assistance from what you have posted. We would...

  • RE: Create view with no outer joins

    jdbrown239 (8/26/2012)


    Need to create view with no outer joins so I can index the view. Here is the query I use to create the view. Does anyone no of a...

  • RE: Check room availability in hotel system

    mfundotogu (8/26/2012)


    create table Rooms

    (Room_no char(4) primary key not null,

    Room_Status varchar(20) not null,

    Room_Type_Code char(4) foreign key references Room_Type(Room_Type_Code))

    go

    Data in the Table.

    1011AvailSTD1

    1012AvailSTD1

    2011AvailDLX2

    Create table Room_Bookings

    (Booking_ID char(8) NOT NULL ,

    Room_no char(4) NOT NULL Foreign...

  • RE: Join making conflict....

    Saga... (8/27/2012)


    SELECT @MSGOUT = @MSGOUT + '

    <tr>

    <td>' + ss.ServerName +'</td>

    <td>' + ss.DBName +'</td>

    <td>' + Occurrences +'</td>

    </tr>

    '

    FROM /*DBINVENTORY ss --after removing this...

  • RE: transaction cannot be committed

    Try this instead then:

    if EXISTS

    (

    select * from sys.columns

    where object_id = object_id('TableA')

    and is_identity = 1

    )

    SET IDENTITY_INSERT TableA ON

    LOL or use Lynn's. His is probably a little better way to check for...

  • RE: transaction cannot be committed

    haiao2000 (8/24/2012)


    Thank you for quick response. I actually replied to my post previously. you are right all i tried to do on that is basically squelching, definitely not handling. I...

  • RE: transaction cannot be committed

    Here is proof. In my database I do not have TableA.

    DECLARE @ErrorMum INT

    DECLARE @ErrorMessage VARCHAR(200)

    DECLARE @Severity INT

    DECLARE @State INT

    BEGIN TRY

    BEGIN TRAN BACKUP101

    BEGIN TRY

    SET IDENTITY_INSERT TableA ON

    END...

  • RE: transaction cannot be committed

    My guess is one your early try-catch blocks has encountered an error but you can't tell because you have empty catch blocks. I call that error squelching, not handling. The...

  • RE: Using CASE to execute one of two SQL statements

    stephen mehl (8/24/2012)


    I spoke too soon.

    I need multiple uses ... SQL does not like the second instance of "IF"

    IF EXISTS (..)

    summarize the data - 1

    ELSE

    add a...

  • RE: how to remove zero from my string

    For anybody else still following along I put together a test harness to check this out. Thanks to Jeff for the sample data.

    CREATE FUNCTION RemoveLeftCharPatIndex

    (

    @Source VARCHAR(1000)

    ...

  • RE: how to remove zero from my string

    tyson.price (8/24/2012)


    I get your point but, that is why we have comments. I will take performance over easy to read any day of the week. Comments are easy to type...

  • RE: how to remove zero from my string

    tyson.price (8/24/2012)


    Eugene Elutin (8/24/2012)


    Steven Willis (8/24/2012)


    Try this:

    CREATE FUNCTION dbo.svfRemoveLeftMostCharacters

    (

    @Source VARCHAR(1000)

    ,@Char CHAR(1)

    )

    RETURNS VARCHAR(1000)

    AS

    BEGIN

    /* This function requires a Tally or Numbers table */

    /* http://www.sqlservercentral.com/articles/T-SQL/62867/...

Viewing 15 posts - 10,936 through 10,950 (of 15,381 total)