Forum Replies Created

Viewing 15 posts - 3,676 through 3,690 (of 13,460 total)

  • RE: Count how many times contains a single value

    i think since the data is comma delimtied string, you can be sneaky and use LEN / LEN(REPLACE

    /*

    Att q x ...

    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: Create DML trigger for single table in SQL 2008 and send email alert to group

    here's a DML delete trigger example that is catching a ton of whodunnit information and sending an email;

    maybe you can use that as a model?

    CREATE TABLE WHATEVER(

    WHATEVERID INT IDENTITY(1,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: create Linked Server to Oracle DB - Is this TSQL Script correct? - Novice

    i've edited my working oracle linked server connection with your info, so it seems to match how i've got mine set up:

    --#################################################################################################

    --Linked server Syntax for Oracle 10G

    --#################################################################################################

    DECLARE...

    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: bcp CSV to DB table

    rayh 98086 (4/11/2013)


    Thank you both!

    When I check the file, copying into Notepad, I do not see any extra characters. To be safe, I even created created a test by...

    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: bcp CSV to DB table

    usually when i get that error, it's because the files are coming from a UNIX file type, where the rows end in \r instead of \n

    usually this fix,...

    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: Copy a table from one db to another including all configurations

    you have to script the table out , whether via SSMS, powershell, or custom TSQL.

    select into newtable only copies an identity definition(if it exists) and column datatype/size/length/nullability.

    it does not...

    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: The IT Employee Benchmark

    i'd have to see an example of what would actually be prohibited where you said

    "Trick questions in a interview are strictly forbidden in working environments governed by EOE"

    that doesn't...

    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: Last time a stored procedure executed?

    the system function sys.dm_exec_sql_text(a.sql_handle) is for SQL2008 and above only.

    SQL2005 will throw an error on syntax, because it's not valid. no cross applying functions back then but 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: Row count difference between flat file source and sql table

    DevDB (4/11/2013)


    Look for the line breaks in the export. That will cause the difference in count.

    excellent point, something like this would be five rows in a text editor, but one...

    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: Unused Indexes

    Duran i guess you'd have to show us an example or two from the results of the query, instead of the query itself.

    for example, maybe the recommendation is an...

    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 table data with either TSQL or Powershell?

    i just found this for powershell:

    http://stackoverflow.com/questions/3891952/sql-server-script-data-smo-scripter-not-working-when-output-to-file

    for doing it via TSQL, i've used a script by Narayana Vyas Kondreddi for years and years:

    http://vyaskn.tripod.com/code.htm#inserts

    there's a few parameters that need to be...

    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: Convert IP address to Binary (32)

    here's what i have saved that looks like a stepping point to getting the string converted; it does not produce the final result, but something not quite finished:

    --change it back:

    ;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: Convert IP address to Binary (32)

    whoops sorry;

    here's an example of converting that int value into a binary map;

    while i have an example of converting an into to varchar as a binary mapping, my example...

    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: Convert IP address to Binary (32)

    saved in my snippets:

    declare @ipAddress varchar(20)

    SET @ipAddress='010.000.123.094'

    SELECT

    CONVERT(varchar(3),convert(int,parsename(@ipAddress,4))) + '.' +

    CONVERT(varchar(3),convert(int,parsename(@ipAddress,3))) + '.' +

    CONVERT(varchar(3),convert(int,parsename(@ipAddress,2))) + '.' +

    CONVERT(varchar(3),convert(int,parsename(@ipAddress,1)))

    SELECT

    convert(int,parsename(@ipAddress,4)) * 256 * 256 * 256 +

    convert(int,parsename(@ipAddress,3)) * 256 * 256...

    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: Importing Active Directory user accounts in SSIS?

    do you really need #1 all active directory uses, or #2 only the ones in a certain group?

    there's an extended stored proc that makes #2 easy:

    --you need to KNOW 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!

Viewing 15 posts - 3,676 through 3,690 (of 13,460 total)