Dynamic SQL

Technical Article

RE: Problem with Variables. SQL Server 2000

  • Reply

Personally, I do prefer (and use) the 'single-update' method to increment and return the next countervalue in one go. It makes it unnecessary to wrap in explicit transactions and such. It's physically impossible for the server to return the same counter to more than one caller.update  counterTable set     @nextid = nextId = nextId + 1 […]

You rated this post out of 5. Change rating

2005-04-20

Technical Article

RE: Nested select statements / running total

  • Reply

I am not quite sure how the data looks like but here is a wild guess select         BLOCK_ID      , DENSITY      , AVG_THICK      , BLOCK_SIDE  , (case when BLOCK_SIDE ='top' then 23 else 0 end)   - (case when BLOCK_SIDE ='top' then 1 else -1 end) *      (select sum(AVG_THICK)      from […]

2005-04-18

Technical Article

RE: Attach DB and Procedure Cache

  • Reply

When you execute sp_detach_db, the procedure cache is flushed for that database. This is probably due to DBCC DETACHDB() [which sp_detach_db wraps], though this command is undocumented. Edit: You can see this by watching syscacheobjects. I did so with the pubs db on a development sql server. Run a stored procedure, verify it's in the […]

You rated this post out of 5. Change rating

2005-03-31

Technical Article

RE: Not valid operation

  • Reply

I found this quote at http://www.mcse.ms/archive85-2004-2-364893.htmlSteve 2004-02-06, 11:33 amUpdate on this. I have turned on journaling on the specific table I am trying to update, and updating/insert/delete works. The problem is, that our 400 people do not want journaling turned on. I have read that having the commit level set to *NONE the odbc connection doesnt […]

You rated this post out of 5. Change rating

2005-03-29

Technical Article

RE: Creating Views: Changing column names

  • Reply

I have another one that I'm trying to solve:    Create another view that returns the name of each country and the number of orders shipped to that country. Name the number of orders column "NumOrders.” Include code that checks if the view already exists. If it does, it should be dropped and re-created. Can any one […]

You rated this post out of 5. Change rating

2005-03-12

Technical Article

Error importing from EXCEL

  • Topic

Hi People,really hope you can help me with this one - I'm trying to import some data from an excel (2003) spreadsheet. It's just straight text in four columns and I have specified that all columns are nvarchar(255) apart from the fourth column which is nvarchar(1000)This should be plenty for the data in the  fourth column as […]

You rated this post out of 5. Change rating

2005-02-09

Technical Article

bulk insert

  • Topic

I have to bulk insert the data from  csv file into orders table. I am trying to use following code but fail to import/insert. bulk insert ordersfrom 'c:\orders.csv' WITH       ( FIRSTROW = 2, DATAFILETYPE = 'native', FIELDTERMINATOR = '\c', ROWTERMINATOR = '\n',CODEPAGE = 'RAW'    ) Error message which I m getting is: Bulk Insert fails. Column is too […]

2004-10-04

Blogs

SQL Saturday Boston 2024 Slides

By

Thanks to everyone that came to my talks. Slides are below. Best Practices for...

Small Data SF 2024

By

I can’t remember how I heard about Small Data SF 2024, but it caught...

A New Word: Moledro

By

moledro – n. a feeling of resonant connection with an author or artist you’ll...

Read the latest Blogs

Forums

7 sept, scheduled book

By philip.scott

Comments posted to this topic are about the item 7 sept, scheduled book

7 sept, schedlued article

By philip.scott

Comments posted to this topic are about the item 7 sept, schedlued article

6 sept, published book

By philip.scott

Comments posted to this topic are about the item 6 sept, published book

Visit the forum

Question of the Day

Azure Data Lake Storage Gen 2

Azure Data Lake Storage Gen 2 is built on ...?

See possible answers