Forum Replies Created

Viewing 15 posts - 961 through 975 (of 2,007 total)

  • RE: combine two tables without using join

    ashutosh.kumarpandey (2/3/2012)


    I know but a) cross join does not require any common key between the two table b) it will increase the number of column in the output which I...

  • RE: Passing Column List as Input Parameters

    Sean Lange (2/3/2012)


    Are you trying to build an update sproc that will only update the columns that are supplied? That seems like an awful lot of extra overhead and processing....

  • RE: Passing Column List as Input Parameters

    Laura_SqlNovice (2/3/2012)


    Hi Guys,

    I have an SP which has table column names as input parameters. The proc uses dynamic query and uses column names from input parameter to update the columns......

  • RE: Calculating Year to Date total

    Make sure you read Jeff Moden's running total article, what I'm about to show you is not even nearly as good.

    BEGIN TRAN

    IF object_id('tempdb..#testEnvironment') IS NOT NULL

    BEGIN

    DROP TABLE #testEnvironment

    END

    --100 Random rows...

  • RE: query for linked server

    You could get rid of that cursor as well, if you use something like this: -

    DECLARE @sql AS NVARCHAR(MAX)

    SELECT @sql = COALESCE(@SQL,'') + ';' + CHAR(13) + CHAR(10) +

    'SELECT a.name,...

  • RE: BULK INSERT failing.

    Jamie Ashton (2/3/2012)


    Hello,

    I have a situation where I am trying to do a bulk insert of a file that's on a network share. It's failing with:

    Cannot bulk load because the...

  • RE: how to create dynamic stored procedure for update table?

    DECLARE @sql NVARCHAR(2000), @Where NVARCHAR(1000), @mande BIGINT

    SET @mande=0

    SET @sql = 'UPDATE balance' +CHAR(13)+CHAR(10)+

    'SET @mande = bal = @innerMande + (bad - bas),' +CHAR(13)+CHAR(10)+

    'tash = (CASE WHEN bal > 0' +CHAR(13)+CHAR(10)+

    ...

  • RE: Error using "Script table as.." option in SSMS

    raotor (2/3/2012)


    Hello,

    I am using SQL Server 2008R2 SP1 and have a problem when it comes to getting SSMS to script certain tables.

    If I right-click on a table within SSMS and...

  • RE: Are the posted questions getting worse?

    Brandie Tarvin (2/2/2012)


    I couldn't help myself. I responded to the awkward responder. Maybe if we talk to him, he might start paying more attention to what he's doing.

    I made a...

  • RE: Max Value from 3 columns

    Stewart "Arturius" Campbell (2/2/2012)


    Could kick myself, forgot about UNPIVOT, thanks Cadavre

    In fairness, there's not much difference in execution times.

    BEGIN TRAN

    SET NOCOUNT ON

    --1,000,000 Random rows of data

    SELECT TOP 1000000 ABS(CHECKSUM(NEWID())) AS...

  • RE: Max Value from 3 columns

    "diLip" (2/2/2012)


    CREATE TABLE Table1 (ID1 int, ID2 int,ID3 int)

    insert into Table1(ID1,ID2,ID3)

    select 1,2,3

    union all

    select 4,5,6

    union all

    select 7,8,9

    How can I display just the number 9 as the highest value from all...

  • RE: INSERT OUTPUT

    BenWard (2/2/2012)


    DATE is not a valid data type... ?

    It was introduced for SQL Server 2008, so I guess the question should read "On SQL Server 2008 and above, what is...

  • RE: combine two tables without using join

    BEGIN TRAN

    CREATE TABLE t1 (marks INT)

    CREATE TABLE t2 (comments VARCHAR(10))

    INSERT INTO t1

    VALUES (100)

    INSERT INTO t1

    VALUES (200)

    INSERT INTO t2

    VALUES ('d')

    INSERT INTO t2

    VALUES ('i')

    --The results here can't be guaranteed because SQL Server...

  • RE: Find the no of hours and minutes between two datetime values

    Sean Lange (2/1/2012)


    You take the RIGHT road and I'll take the LEFT road, and I'll be in Scotland before ye. :Whistling:

    Oh dear. . . has it been a long day?...

  • RE: Guidance on returning result set for previous month

    Paul Morris-1011726 (2/1/2012)


    groovy...

    I apologize I am still a bit of a NOOB with this... I was trying to read up on what you provided to understand what it is doing......

Viewing 15 posts - 961 through 975 (of 2,007 total)