Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. bmacbmac

    Help searching within this Json file

    ...row just fine with this query: Declare @JSON varchar(max) SELECT @JSON=BulkColumn FROM OPENROWSET (BULK 'D:\test.json', Single_CLOB) import select * from openjson (@json) select * from openjson (@json, '$.documents') However, I get 0 results if I try to look at a specific array, like...
  2. bmacbmac

    How to import plain text from Word doc to SQL

    Hello... I have about 25,000 Word Docs where I would like to import just the text data from each file. Reading other forums, I have tried: create table Documents (DocName nvarchar(40), DocContent Varbinary(max)) INSERT INTO Documents SELECT...
  3. bmacbmac

    SQL 'For json' query for over 100,000 records - truncating results

    Hello! I have over 100,000 records in SQL that I need exported to json. My query is: SELECT documentinfo.irecordid, (select tempparties.* from tempparties WHERE tempparties.irecordid = documentinfo.irecordid and tipartytype = 1 FOR JSON AUTO) AS first, (SELECT tempparties.* from tempparties...
  4. bmacbmac

    Inserting XML data into SQLServer returns only NULL values

    OMG you are a life saver! That worked perfectly!
  5. bmacbmac

    Inserting XML data into SQLServer returns only NULL values

    Hi there, I have the following data in an xml file: <?xml version="1.0" encoding="utf-16"?> <documents> <document ArchivedFileName="40243702\6665414.tif" DocumentId="6665414" FileSize="304790" OriginalFileName="ptmcdfd.tif" DocumentTypeName="8" FileNumber="40243702"...
  6. bmacbmac

    Help with RegEx to find non alphanumeric characters

    ...to find all names that contain a non alphanumeric character, but I want to exclude spaces, dashes - , and ampersand &. I am trying this: select * from mytable where name like '%[^a-zA-Z0-9 -&/]%' However, I am getting names returned like: JELD-WEN GIANT STOP-N-GO OF NEW MEXICO I would...
  7. bmacbmac

    Import 800 access .mdb files to SQLServer

    Andrzejek - Yes each mdb file has just one table, 5 columns. All have the same structure.
  8. bmacbmac

    Import 800 access .mdb files to SQLServer

    Man I have no idea how to do this. I think I may need to hire this out!
  9. bmacbmac

    Import 800 access .mdb files to SQLServer

    Hi! I have 800 little MDB files that I need to import into SQLServer 2008 R2. I'm really hoping I don't have to do the data import wizard 800 times, but I can't find much of a T-SQL solution. I'm hoping there is some sort of insert script I can run for each MDB file. Any ideas? Thanks!
  10. bmacbmac

    Identify The number of occurrences of a given field

    Brilliant! that worked like a charm
  11. bmacbmac

    Identify The number of occurrences of a given field

    Hello... I have the following data: create table #temp (instrumentID varchar(25), saddition varchar(50), block varchar(10), Lot varchar(10), LotLength int) insert into #temp values ('aa11', 'SP1', '5', '9', 1) insert into #temp values ('aa11', 'SP1', '5', '10', 2) insert into #temp values...
  12. bmacbmac

    Fill empty row with 1+ data from row above

    Hello, I have the following table / values: create table #temp (counter int, imageid int, newpage int) insert into #temp values (1,400, 1) insert into #temp values (2,400, NULL) insert into #temp values (3,400, NULL) insert into #temp values (4,400, NULL) insert into #temp values (5,400...
  13. bmacbmac

    Using @variable in a While statement

    Hi Everyone, I have the following table: create table August2018 (counter int identity(1,1), County varchar(25), Locates int, Billed varchar(1), ToBill varchar(1)) Insert into August2018 (county, tobill) values ('Bellingham', 'x') Insert into August2018 (county, tobill) values ('Adams'...
  14. bmacbmac

    Using the same scripts over and over again

    ...databases. I find myself typing the exact same select statement(s) several times per day in various databases. They are pretty short: select * from table1 t1 join table2 t2 on t1.recordid = t2.recordid join table3 t3 on t2.nameid = t3.nameid Is there some sort of shortcut anyone knows...
  15. bmacbmac

    SQL error XML Parsing - Equal Expected

    ...B.IND_ROW, ROW_NUMBER() OVER ( PARTITION BY A.ID ORDER BY A.ID) AS ROW_NUM FROM ( SELECT *, CONVERT( XML, '<ROW>' + REPLACE( C.textlist, '~', '</ROW><ROW>' ) + '</ROW>' ) AS XML_ROW FROM subs2...
  16. bmacbmac

    Remove long spaces in middle of string

    Thanks gmmastros. I like that idea... Out of curiosity, is there a reason to use the brackets? Does this: like '%[ ][ ]%' do the same thing as: '% %'? Or was that just for illustration?
  17. bmacbmac

    Remove long spaces in middle of string

    Hi. I have data in a table like this: NW 35 6 6 55 PLAT ID 111 T176 BERKS I'd like to remove the long strings of spaces in the middle of this string, but I dont' want to remove the single space between words. I thought about just replacing double...
  18. bmacbmac

    How to set a variable - perform an action - and then set the variable to + 1

    oh wait.. i think I figured it out by setting the starting number before the while loop. declare @foldernumber int set @foldernumber = 1 while (select count(id) from mytable where folder is null) > 0 begin update mytable set folder = 'FOLDER' + convert(varchar(5), @foldernumber) set...
  19. bmacbmac

    How to set a variable - perform an action - and then set the variable to + 1

    Hello. Trying something like this. I am trying to set a @variable to 1 so I can update some records to FOLDER1. At the end of my script I would like to set the @variable to + 1 so I can set the next records to FOLDER2, etc. How can I set a starting @variable and then add + 1 to it? When...

Part and Inventory Search

Back
Top