Viewing 15 posts - 331 through 345 (of 898 total)
Using, sample data provided by Chris, this is probably what you need
;WITH MyData ([day], [Count]) AS (
SELECT '2008-01-01 00:00:00.000', 3 UNION ALL
SELECT '2008-01-01 11:00:00.000', 9 UNION ALL
SELECT '2008-01-01...
March 26, 2013 at 2:25 am
Can you also provide the expected output based on your sample data?
That will help to understand your description better.
March 26, 2013 at 1:51 am
It is difficult to recommend something based on the description only.
It would be easier if you can provide some DDL of the tables involved, sample data and the expected results.
Please...
March 26, 2013 at 1:41 am
Yes. There can be incoming transactions when a transaction log backup is in process.
The backup will include the transactions even if they are uncommitted with appropriate status information so that...
March 26, 2013 at 12:57 am
You can run the below mentioned query to get the list of comma-separated columns.
You can then copy the results and use them in your SELECT statement
SELECTCOLUMN_NAME + ','
FROMINFORMATION_SCHEMA.COLUMNS
WHERETABLE_NAME = 'YourTableName'...
March 26, 2013 at 12:36 am
No. You will have to write the 200 columns in your SELECT statement.
You can save some typing effort by using system tables like INFORMATION_SCHEMA.COLUMNS to generate comma-seperated column names and...
March 26, 2013 at 12:23 am
jrseven68 (3/25/2013)
This works perfectly with what i am trying to do.
The only down side to using this is it does not return results where userid's have 0 records in...
March 25, 2013 at 11:14 pm
Assuming that the column combination of ItemTypeID, Service and OrderID is UNIQUE, the below code should do what you need
INSERT[dbo].[tblOrderItems]( [ItemTypeID], [OrderID], [Service] )
SELECT[ItemTypeID], @newOrderId, [Service]
FROM[dbo].[tblOrderItems] A
WHEREA.OrderID = @OrderID
INSERT#temp_result( OldOrderItemID...
March 25, 2013 at 4:17 am
Is there a UNIQUE column(s) in your table tblOrderItems other than the IDENTITY field?
March 25, 2013 at 3:58 am
No. They are not doing the same job. They are for entirely different purposes.
Try looking up in Google or Books Online. You will easily get information on these topics.
If you...
March 25, 2013 at 3:40 am
This is probably what you need
SELECTU.userid,
SUM( CASE WHEN U.userid = P.whoverified THEN 1 ELSE 0 END ) AS whoverified,
SUM( CASE WHEN U.userid = P.whochecked THEN 1 ELSE 0 END )...
March 22, 2013 at 1:09 pm
You can implement the same thing using triggers as well but constraints are better than triggers for such requirements.
Moreover, I think what you need is a composite FOREIGN KEY constraint
Check...
March 22, 2013 at 12:34 pm
kapil_kk (3/22/2013)
Kingston Dhasian (3/22/2013)
If the column(s) are not part...
March 22, 2013 at 8:05 am
Duplicate post
Please post further replies here
http://www.sqlservercentral.com/Forums/Topic1434157-391-1.aspx
March 22, 2013 at 7:00 am
You will have to make VoucherNo a UNIQUE KEY in GV_Voucher table.
Only then you will be able to create the desired FOREIGN KEY constraint.
March 22, 2013 at 6:58 am
Viewing 15 posts - 331 through 345 (of 898 total)