Forum Replies Created

Viewing 15 posts - 12,061 through 12,075 (of 13,460 total)

  • RE: SP to do INSERT or UPDATE w/o loop or cursor

    well, first,

    I've always tried to get rid of any tables that were trying to hold summary data with a view. it does away with needless updating.

    i think based...

    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: Instances in SQL Server 2005

    from a development standpoint, multiple instances are great for testing; I've had SQL7 as a default instance, SQL2000 and 2005 as named instances, all on the same machine. helpful 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: what is the best way and fast way to load txt files into a tables with several fields

    that is caused by the row terminator:

    [slash]n is CrLf, which is found a lot.

    try [slash]r which is just Carriage Return, which is common from UNIX type data sources.

    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: what is the best way and fast way to load txt files into a tables with several fields

    i think it's parenthesis around the @sql....exec(@sql)

    this works on my machine:

    DECLARE @sql VARCHAR(8000)

    DECLARE @path VARCHAR(255)

    SET @path='c:[slash]nelson1.txt'

    SET @sql='BULK INSERT nelson_test1 FROM ''' + @path + ''' '

    ...

    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: Slow with the in function

    also something else to consider;

    wouldn't the where statement where len(a.NDC) > 0 force a table scan on the Reorders table in order to calculat ethe length of the field?...

    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: what is the best way and fast way to load txt files into a tables with several fields

    [font="Courier New"]--all the columns must exist in the table...bulk insert doesn't let you choose.

    --if the data was structured like this:

    --1.0" 5.1" 5.1" 1.4" .2

    --1.0" 5.1" 5.1" 1.4" .2

    DROP TABLE nelson_test1

    --i'd...

    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: what is the best way and fast way to load txt files into a tables with several fields

    sorry...once your table #temp exists, i\BULK INSERT inserts into all columns....you can't identify the columns.

    it should be this:

    [font="Courier New"]BULK INSERT #temp1  FROM 'c:elson.txt'

                WITH

                (

                   DATAFILETYPE = 'char',

                   FIELDTERMINATOR =...

    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: what is the best way and fast way to load txt files into a tables with several fields

    this example may be much more than you need.

    This is very fast.

    in my case, I had thousands of .txt files, all the same format.

    they were distributed in 4 folders.

    Each file...

    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: Select Statement in Update Clause

    Maybe you mean something like this?

    this updates a table, and uses a SELECT to pull in relevant data from a select statement?

    [font="Courier New"]

    UPDATE SomeTable

    SET SomeTable.BudgetAmount = X.BudgetAmount

    FROM

    (

    SELECT ID,SUM(AMT)...

    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: BULK INSERT AND Flat FIle

    the issue is permissions, i'm pretty sure.

    it doesn't matter which user you are logging into SQL server, whether domain admin,sa, or anyone else.

    it's when you try to access services or...

    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: Performing an HTTPGET from SQL Server 2005

    I tried this and added acouple of different things, like timeouts and Content-Length to the headers...it made no difference...depending on the url it either failed witha 404, or the same...

    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 know a server have dual/quad core?

    I've had this snippet for a while, which i thought gets the number of processors on the server. this is the physical number of processors, and not whether they 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: How to track Stored Procedure Changes

    awesome example michaela;

    Still dealing with too much SQL 2000 here, and i wanted a nice working example to explore the new DDL trigger abilities.

    I was able to read it,...

    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: Can someone please help with this script

    I had created a search proc I called "uglysearch", that found every varchar/char column, in every table, and searched for a specific string. similar to what you are doing, but...

    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 change folder name through sql command

    i think this is just a result of spaces in the path/filename, right?

    changing this part should work i think:

    SET @folder = 'C:\Inetpub\wwwroot\Pergamum\Doc\International Banking\Caribbean'

    SET @path =SUBSTRING(@folder ,...

    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 - 12,061 through 12,075 (of 13,460 total)