Description:
Microsoft SQL Server newsgroup.
|
|
|
Weekdays
|
| |
I'm going through a tutorial and found they are using the following code: SET DATEFIRST 1; SELECT DISTINCT DATEPART(weekday, S.OrderDate) as WeekDayNumber, DATENAME(weekday, S.OrderDate) as Weekday FROM Sales.SalesOrderHeader S Order by WeekDayNumber It returns: 1 Monday 2 Tuesday... more »
|
|
IDENTITY_INSERT
|
| |
Could someone please tell me why the following doesn't turn off IDENTITY_INSERT for the table, yet doesn't generate any error? DECLARE @sql nVARCHAR(2000) SET @sql ='SET IDENTITY_INSERT dbo.Customers OFF' EXECUTE sp_executesql @Sql What I would like to do is utilize it in a loop to make sure that all tables... more »
|
|
Membership Effective and Expiration Span
|
| |
I have a table called member which has three columns, MembershipID, EffectiveDate and ExpirationDate. When a membership enroll, a memberid is created and the effectivedate and expirationdate are entered into the table. When the member renew the membership, a membershipid remains the same and a new effectivedate and... more »
|
|
Select distinct e-mail adresses
|
| |
I want to extract some data from 2 tables One of the tables contains an email address. I want the query narrow down so that a single email address is only output once. What SQL statement can I use to get this result. e.g. data contains Field1 Field 2 Field3 EMAIL a c w2 t...@test.com a d w1 t...@test.com... more »
|
|
How costly is it to use BCP or OPENROWSET to create Excel files?
|
| |
Hi, I have an ASP.NET application that is using SQL Server 2008 as its backend. I need to export some data -- about 3000 rows -- to Excel sheets quite often. I've learned that on the database server, I can use BCP utility or OPENROWSET to create my Excel sheets. There are some solutions on the web server as well which simply get the data... more »
|
|
me
|
| |
i love sex :D EggHeadCafe - Software Developer Portal of Choice AJAX enabled web page design and beginner?s concept [link]
|
|
How do I: Convert sys.parameters.user_type_id to CLR Data type
|
| |
Hi, I am using VS2008/VS2010(Beta) C# and SQL Server 2008. What is the cleanest way to map SQL types to CLR types, and vice versa. Example: varchar -> System.String int-> System.Int32 Is there a SQL server table that has the mapping from SQL to CLR types? Is there an enum that matches the SQL sys.types table?... more »
|
|
Interesting observation: new SQL time machine! :)
|
| |
Interesting observation: new SQL time machine! :) Run this several times and note that sometimes the first value is greater than the second! I thought that these should be the same. I understand that it's due to the way datetime rounds to 3, 7 or 0. It is just interesting to note! DECLARE @v datetime = SYSDATETIME()... more »
|
|
Wonder how to do nested logic
|
| |
Hello I am trying rank several items based on what items supercede them. Table is simple like this: ITEM SUPERCEDER ITEM1 ITEM2 ITEM1 ITEM3 ITEM2 ITEM4 ITEM5 ITEM4 ITEM6 ITEM5 In this case an e.g is item6 is superceded by item5 which in turn is... more »
|
|
Question on Triggers
|
| |
I’m running SQL2008. I am trying to work out a soluition to a security problem. I have simplified my query to find out if it is possible and a simple example There are two databases ( DB1 and DB2 ) DB1 has a table called TB1 and a field (Varchar) called ‘Status’ DB2 has a table called TB2 and a stored procedure called SP1. SP1 accepts a... more »
|
|
|