Forum Replies Created

Viewing 15 posts - 9,691 through 9,705 (of 13,460 total)

  • RE: dateDiff question

    here is a link to one that i built after a few posts on the subject here on SSC; it's got all the code to insert all the known holidays...

    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: Extract a Value in a str

    oops reread it and there are multiples;

    this seems to get you 98% there:

    --now get the ID's using a tally table

    declare

    @pre varchar(10),

    @post varchar(10),

    @pr int,

    @po int,

    @st int

    set @pre = 'TBM'

    set @post...

    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: Extract a Value in a str

    if the TBM number is always 6 characters and it always starts the string, you could simply take the LEFT(col,6) of the string

    SELECT LEFT(String,6) from #Test

    if it could exist anywhere...

    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: dateDiff question

    i have this saved in my snippets to get the next business day:

    this assumes you have a Calendar table with some specific columns, since business days are also dependant 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: Truncated table DB still shows big

    truncating a table frees up space WITHIN the database, so more data can be added without expanding the database. the db assumes that you made room for more data; if...

    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: Return the records that equal the sum.

    it seems like you want a 1 to N solution, not a running total(since you explicitly gave the 1-3-5 example of non consecutive values)

    for any actual solution, i would end...

    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: Return the records that equal the sum.

    if you are trying to find the consecutive records from start to some row that equals the amount, this solution below using a "running total" works;

    if you are after some...

    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: where is sys.functions?

    Well at least it's not me;

    they can make a views for the oh so heavily queried sys.routes and sys.schemas but not a sys.functions;

    seems more like an oversight rather than a...

    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: Stored procedure oddity

    I agree with Howard;

    I'll bet it's parameter sniffing with out of date statistics also, and the recompile of the procedure because you made some text changes(but no functional change:...

    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 the Binary Image in Sqlserver 2005

    what have you tried so far? because this is your first post and your example has the word "student" in it, we want to make sure you learn the...

    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: linked server sql to oracle

    you need to install the oracle client on the Server that is hosting the SQL Server instance.

    you'll have to copy/set up the TNS names files just as you would any...

    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: Howt to identify spaces in coulmn

    anitha also watch your data types...if the column is CHAR or NCHAR, it is padded on the right with spaces to the full size of the column definition: insert 'anitha'...

    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: Is This Odd Behavior? Empty String ('') vs int

    i thought it was one of those implicit conversion things;

    when your WHERE is evaluated here:

    id = '';

    the id column is implicitly converted to varchar....since every int can convert to a...

    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: Data verification question

    this is probably the easiest way: using the LIKE statement and the pseudo regular expression:

    select zipcode,* from YourTable where zipcode like '%[^0-9]%'

    that will find anything with characters outside of the...

    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: Help with keeping the leading zeros

    the issue is datatypes; integers/number datatypes do not have preceeeding zeros;

    i think your table dbo.ReportFinal.MedRecNO is defined as an integer;

    you said it's defined as an nvarchar, but that's the only...

    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,691 through 9,705 (of 13,460 total)