Viewing 11 posts - 16 through 26 (of 26 total)
@subject = 'New Stockcode : ' + convert(varchar(20),getdate())
It's trying to add 'New Stockcode : ' to the date... If you convert it to a string, it will work.
KK
March 14, 2011 at 9:15 am
Since I was unable to find any other examples of this all weekend, I had feared as much. Unfortunately, I can't add that column to that table or any...
March 14, 2011 at 8:51 am
Yes, You only need to populate TableC with the initial data.
The query I am attempting will populate the TableA and TableB
with the data from TableC.
Just to be clear. ...
March 14, 2011 at 8:29 am
/*TABLE A*/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TableA](
[ID] [int] IDENTITY(1,1) NOT NULL,
[val1] [varchar](50) NOT NULL,
[val2] [varchar](50) NOT NULL,
[val3] [varchar](50) NOT NULL,
[entryDate] [datetime] NOT NULL,
CONSTRAINT [PK_TableA] PRIMARY KEY...
March 14, 2011 at 7:39 am
Here are the table structures for the example above:
TableA
ID int [PK,IDENTITY]
val1 varchar(10)
val2 varchar(10)
val3 varchar(10)
entryDate datetime
TableB
ID int [PK,IDENTITY]
TableAID int
comID int
RelationshipID int
xPercent varchar(6)
[status] int
dateBegin datetime
TableC
ID int [PK,IDENTITY]
val1 varchar(10)
val2 varchar(10)
val3 varchar(10)
entryDate datetime
comID int
TIA,
KK
"Life...
March 11, 2011 at 3:29 pm
Yes, I tried the first one and due to the possibility of a blank StkNumber in a row, the cartesian result was probably going to be 4-5 million rows at...
February 15, 2011 at 3:21 pm
Thanks! That was what was eluding me.
Appreciate the guidance!
KK
February 9, 2011 at 8:20 am
I finally figured it out! I OUTPUT everything I needed to a @Tmp table, then selected everything from that to do my second insert.
Worked like a charm!...
February 8, 2011 at 2:53 pm
Thanks for your help G2!
I have tried both of the following statements:
DECLARE @currentDateTime datetime
SET @currentDateTime = GetDate()
DECLARE @ClientID INT
DECLARE @col_a_value INT
BEGIN TRANS
INSERT Tbl1
(col_a, col_b, stdate)
OUTPUT inserted.id, inserted.col_b, 1...
February 8, 2011 at 1:49 pm
Just discovered it! I'm pretty sure that's exactly what I needed! From what I've read, I believe I can put an OUTPUT statement before the SELECT statement. Can...
February 8, 2011 at 1:17 pm
Viewing 11 posts - 16 through 26 (of 26 total)