Forum Replies Created

Viewing 15 posts - 9,826 through 9,840 (of 13,460 total)

  • RE: Subqueries are not allowed in this context for INSERT

    slight formatting change, added a few aliases, this is syntactically correct:

    INSERT INTO database2..table1 (Date, Emails1, Emails2, Emails3)

    SELECT getdate() -1 As TheRightDate,X1.CNT,X2.CNT,X3.CNT

    FROM

    (SELECT count(*) AS CNT FROM database1..table1 WITH (NOLOCK) WHERE...

    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: Julian date YYYYJJJ into YYYYMMDD

    i'd have to test it, but by avoiding some string manipulations, it might save a microsecond or two on a big batch; i think it's just shorter and easier on...

    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: Julian date YYYYJJJ into YYYYMMDD

    data that is in YYYYMMDD format will natively change to datetime with the code i added...no need to chop it up into pieces; try convert(datetime,sdate) and it should work fine.

    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: Julian date YYYYJJJ into YYYYMMDD

    once you've converted to datetime, the comparison should be easy;

    here's how to convert your julian date; the other appears to already be datetime....if it's not, explicitly convert it to datetime.

    update...

    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 to count left side nodes and right side nodes for managing a chain link(binary tree)application

    i think SELECT COUNT(DISTINCT fieldname) will do what you want:

    CREATE TABLE user_registration_tbl

    (id int identity,

    user_first_name varchar(100) not null,

    parentid int not null, ---coresponding ID of parent

    Node int not null, ----'0' if member...

    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 to Script complete database objects into a file?

    if it HAS to be done in T-SQL, I've written a stored proc which returns the DDL of any table (or treats a view as if it were a table)...

    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: Refusal to perform a log backup

    sounds more like you are trying to make your databases bend to the will of the backup program.

    Veritas certainly has the ability to backup a database that is in SIMPLE...

    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: Getting my Current Session ID

    I didn't see your previous post, but are you looking for @@SPID?

    select @@SPID will give you your current connection id, is that what you are looking for?

    here's a collection of...

    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: MOD Command to get a case split

    ian your expanation doesn't make sense. half a case would be 6 bottles in a 12 unit case, right? where did "the actual stock is 33 cases and 3 bottles...

    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: Add business days to a date field

    [facepalm] oh snap!

    so obvious when someone rubs your nose in it; thanks

    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: Add business days to a date field

    ok this is providing a fun learning curve for me;

    generating a calendar table's easy, but updating it to have holidays is tripping me up.

    all the holidays that are ...

    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: 2 servers 1 IP

    there's some articles and webcasts here on SSC as well:

    i remember reading an article "clustering in 15 minutes" but can't seem to find it.

    Step-by-Step Guide to Clustering Windows 2000 and...

    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: 2 servers 1 IP

    maybe you are refering to clustering?

    clustering takes two or more servers, each with their real IP, and sets up a service so that they share any requests being services on...

    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 to retrieve 100000 record from sqlite (Mobile Applications) ????!!!!!!!

    glad you fixed it; what was the problem, and what was your solution? it might benefit some others if you can post some ideas and details.

    Thanks!

    HAJJAJ (3/15/2010)


    the problem is solved.

    yes...

    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 to allow other users to set an Agent property value

    how about this idea:

    don't let them change the job, nor give them access to edit the job.

    Instead, change the job slightly so instead of hardcoding those parameters, 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!

Viewing 15 posts - 9,826 through 9,840 (of 13,460 total)