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 Wanet Telecoms Ltd 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: *

  • Users: MKVAB
  • Order by date
  1. MKVAB

    XML String - SQL 2000 vs 2005 Issue

    Well, I've been able to get the work around to return correctly. The above does do the same thing. It's just that my real statement is MUCH longer and my error was occuring when writting the XML string to a variable. Apparently you can SET a variable to an XML string in 2005, but not so in...
  2. MKVAB

    XML String - SQL 2000 vs 2005 Issue

    ...Unfortunetly, I don't have the flexibility to change the attributes in anyway. I thought I figured out a way. By doing this: SELECT * FROM Customers FOR XML AUTO, ELEMENTS It worked fine independently, but when I run it in my script I get "Incorrect syntax near 'XML'."...
  3. MKVAB

    XML String - SQL 2000 vs 2005 Issue

    ...RAW with ELEMENTS. I am reverse engineering an app and I need to be able to produce results as they would appear if I was doing this: SELECT * FROM Customers FOR XML RAW('Customer'), ELEMENTS But, my DB is a 2000 server, not a 2005. Ideas on how to change this FOR XML...
  4. MKVAB

    Alternative to bcp

    Thanks SQLDenis. I've actually been hunting for a download page for SSIS with no luck yet... SSIS might not be an option for us though, as we may be moving away from SQL Server in the near future. So, implementing something that could be time consuming isn't really practical. I think we...
  5. MKVAB

    Alternative to bcp

    I'm looking for some other way to write the data set from a stored proc out to a file. I've always used bcp, and have never found or known of another utility. We have users who pick up the files that our stored proc write out with their automated processes to load the data into their systems...
  6. MKVAB

    Alternative to bcp

    I've had a lot of issues with bcp in SQL Server 2005 - the data will often not sort correctly even when using the ORDER hint. Anybody know of an alternative to bcp? thanks! -MK
  7. MKVAB

    Insert by Column Number, Not Name

    Thanks for the reply Phil and SQLSister. The table (temp table) is built dynmically to accomodate data from a pivot table whose columns are created dynamically. The data will always be varchar(25). I extrapolate the columns from the query (date ranges with sums in the pivot) so the columns...
  8. MKVAB

    Insert by Column Number, Not Name

    Is it possible to do an insert by column number??? Like... INSERT INTO tabname 3 VALUES('some insert') --> 3 being the column number Thing is, I've got a stored procedure that builds a table dynamically. I need to insert a value into the table but I can't do a simple insert because the number...
  9. MKVAB

    BULK INSERT to skip last x rows

    Thanks ESquared! I was thinking something similar to that too. If I could get the count of the number of lines in the file, I could set LASTROW = that number - 5 (5 being the static rows at the end of the file). But, I haven't figured out how to do that yet. :( I'm going to try to get one of...
  10. MKVAB

    BULK INSERT to skip last x rows

    Thanks Phil! Not to sound too green, but what would I use to strip out lines in a file? Is there a way to do this from within SQL Server? Thanks again! -MK
  11. MKVAB

    BULK INSERT to skip last x rows

    Hello all! I am writing a BULK INSERT statement that loads a variable length file that I receive daily. However, the last lines of this file contain a few lines of HTML that is causing the BULK INSERT to fail. Is there a way I can have BULK INSERT load all records and stop when it sees a certain...
  12. MKVAB

    Seeking System Table for Comments

    Thank you!!! Exactly what I was looking for! For others: here's a query to grab the column and table name. select sysobjects.name TableName, syscolumns.name ColumnName, sysproperties.Value ColumnComment from syscolumns inner join sysproperties on...
  13. MKVAB

    Seeking System Table for Comments

    Anybody know which system table contains the actual comments for tables? I can find stored procedure text and column defaults in syscomments, but not the actual attribute's comments. Ideas? Thanks! -MK
  14. MKVAB

    Variable Assignment Optimization

    Yep! That works marvelous! Thank you SQLBill! The 2nd SELECT, good question! I guess I've just always done it that way. Not anymore! Thank you! -MK
  15. MKVAB

    Variable Assignment Optimization

    I found a good article: http://vyaskn.tripod.com/differences_between_set_and_select.htm It talks about doing this: SELECT @Variable1 = 1, @Variable2 = 2 But, can you do something like that with a WHERE clause? Humm....
  16. MKVAB

    Variable Assignment Optimization

    Call me lazy... BUT, Is there any way to make this one assignment statement: DECLARE @Variable1 int DECLARE @Variable2 int DECLARE @Criteria int SET @Criteria = 123 SELECT @Variable1 = ( SELECT Field1 FROM Table WHERE SearchField = @Criteria ) SELECT @Variable2 =...
  17. MKVAB

    Table Attributes & Strange Behavior

    Jay, thanks for the response! It is the same database. Nigel, YES! I wasn't paying attention to the data type before. That explains it. Thank you! Explanation: The field is an nvarchar field (not sure why it was created as a unicode data type, but it is). A unicode data type takes up twice as...
  18. MKVAB

    Table Attributes & Strange Behavior

    ...it was varchar(100). Hummm…. So, I run sp_help again just to make sure I'm not delirious, and sure enough it says the length is 100. I do: select * from syscolumns where name = Field1 and the length listed in syscolumns is also 100. Then I look at the table design in Enterprise Manager and...
  19. MKVAB

    Select accross servers

    Thanks for the response! Sorry for the delay! My problem did originate from not having the remote server set up in linked servers. Works wonderfully now. Thanks again. -MK
  20. MKVAB

    Select accross servers

    ...DB 2. Perform an INSERT with data from the local DB into the remote DB using that MAX value in the WHERE clause Code: DECLARE @MaxValue int /*********************************************** ** Grab value from remote server ***********************************************/ SELECT @MaxValue =...

Part and Inventory Search

Back
Top