defragmentation

Technical Article

RE: Explicit Transaction behavior fun

  • Reply

quote: 1. I originally wrote it as a single select. Unfortunately, the view has nolocks so SQL Server would put together the view first and then get information from the audit table, which was changed at the same time the view was put together, and join the data, which was then out of sync. As […]

You rated this post out of 5. Change rating

2003-07-31

Technical Article

RE: Explicit Transaction behavior fun

  • Reply

Thanks again for replying. 1. I originally wrote it as a single select. Unfortunately, the view has nolocks so SQL Server would put together the view first and then get information from the audit table, which was changed at the same time the view was put together, and join the data, which was then out […]

You rated this post out of 5. Change rating

2003-07-31

Technical Article

RE: How To Get the Last Day in a month

  • Reply

Here is another way. select DAY(DATEADD(d,-1,DATEADD(m,DATEDIFF(m,0,GETDATE())+1,0))) The bennifit is it is just a bit shorter and requires replacing only 1 GETDATE(). Or this which is even shorter select DAY(DATEADD(m,DATEDIFF(m,0,GETDATE())+1,-1)) -1 represents 12/31/1899 and since the maximum number of days in a month is 31 if less then it will give you the highest value for […]

You rated this post out of 5. Change rating

2003-07-14

Technical Article

RE: Find second highest

  • Reply

Greg, What's the best way of making your code dynamic? I tried declaring a variable so that the query became: declare @n int set @n = 76 select top 1 salary from (select top @n employeeId from employee order by salary asc) a order by salary desc but SQL Server doesn't like it. I can […]

You rated this post out of 5. Change rating

2003-07-08

1 reads

Technical Article

RE: Already sorted?

  • Reply

hi, taken directly from BOL, "For example, to bulk copy data from the Authors.txt data file to the authors2 table in the pubs database, specifying that the data file is in ascending order on the au_id column, execute from the command prompt: bcp pubs..authors2 in authors.txt -c -t, -Sservername -Usa -Ppassword -h "ORDER (au_id ASC)" […]

You rated this post out of 5. Change rating

2003-07-08

1 reads

Technical Article

RE: Locking problem

  • Reply

In a previous reply I did indicate that there was a BEGIN TRAN on the first connection before the first Insert. And I believe you are right that just closing the recordset might be enough to prevent the second connection from being created. I observered the second connection in Query Analyzer while the app is […]

You rated this post out of 5. Change rating

2003-07-02

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