Forum Replies Created

Viewing 15 posts - 6,766 through 6,780 (of 13,460 total)

  • RE: Query Help! Combine two queries.

    i didn't see any relationship between the two queries, so i could only assume a CROSS JOIN would be right.

    does this do what you are looking for?

    SELECT

    a.accountnumber,

    ...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Adding a single column to multiple tables

    you can wrap the commands for all 15 alters in a single transaction though...so you can make sure it's all or nothing.

    SET XACT_ABORT ON --bailout and rollback on any error...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Retrieve User Network Name

    however, if htey connected using a SQL login, the windows username is not available in any way, shape or form, unless you specifically code an application to get the information...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: DB mail - Table in HTML Body - Adjust Font size

    well, this is syntactically correct, and a good basisi for the way I would do it; i changed your @body variable name, i hate having a local variable the smae...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: DB mail - Table in HTML Body - Adjust Font size

    piece of cake.

    add some CSS to the top of your command to put the default style on the td tags.

    my example here is using font size 11 points...change it to...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: How do I import this data?!

    Sean Lange (9/16/2011)


    Lowell that picture is awesome. It fits perfectly in another thread from a couple days ago. I will have to "steal" your pic and paste it in there.

    kewl!...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: How do I import this data?!

    ACinKC (9/16/2011)


    I've done things similar to this (importing mainframe data into SQL) using SSIS (and Business Objects too, for that matter) and it was very straightforward and easy. Is...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: find the maximum length of sequences in a column

    looking at it but my first try didn't make sense;

    here's sample data for other posters to fiddle with:

    ;with MySampleData (TheDate,TheValue)

    AS

    (

    SELECT CONVERT(datetime,'20100101'),'-1' UNION ALL

    SELECT '20100201','-1' UNION ALL

    SELECT '20100301','1' UNION ALL

    SELECT '20100401','1'...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Query optimizing 2

    i think you can just do it with inline SUM..CASE...

    you almost had the syntax in your example:

    does this do what you wanted?

    SELECT

    ...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: How do I import this data?!

    dave_vicary (9/15/2011)


    Okay that makes sense, I copied the data into wordpad!

    Now receiving this error:

    Msg 208, Level 16, State 82, Line 1Invalid object name 'BULKDATA'.

    Sorry to keep bugging you with...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: remove 'dead views'

    glen.wass (9/15/2011)


    HI if your willing to share i would love a copy of the script you mention i have SQL2005 and 2008

    It's here on the forums in a few different...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: How do I import this data?!

    i copy and pasted the file into a text document from the web page, so my lines all ended in Carriage Return Line feeds(CHAR(13) + CHAR(10) because of the enhanced...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Reverse Engineer SQL Scrpts

    note that those two new DM views are in SQL 2008R2 and above:

    sys.dm_sql_referencing_entities

    sys.dm_sql_referenced_entities

    i went to test in 2008 and saw they were not there...

    you might have to stick witht...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: deleting data in all tables

    yeah without taking Foreign keys into consideration, doing a straight DELETE will typically raise errors .

    this snippet generates teh TRUNCATE TABLE/DELETE FROM statements in Foreign key hierarchy Order:

    that avoids issues...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Insert

    Beginner_2008 (9/14/2011)


    Can anybody help me in insert statement:

    I have a table say table 1 which has many columns but out of these one column say Tid is null and all...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 15 posts - 6,766 through 6,780 (of 13,460 total)