Hi all,
this is VERY werid, I wrote a sp that has a simple dynamic string builder in it..
that is later exec()
the odd thing here is when i attempt to build the SQL string it only returns 307 chars from a varchar(8000) varible.
here is the code ( i have stripped out the dyn varibles for ease of exec.)
RESULTS: ( notice that the SQL string stops after the OTY columns ","
-----------------------------------------------
Char_Len_Value
--------------
302
SQL_String
-------------------------------------------------
CREATE TABLE dbo.tPRODUCTSALES_200001 (
[PKID] [int] IDENTITY (1, 1) NOT NULL ,
[MONTH_ID] [int] NOT NULL ,
CONSTRAINT chk_MONTH_IDCHECK200001 (MONTH_ID = 200001 ),
[PRODUCT_ID] [int] NULL ,
[SALES] [decimal](7, 2) NULL ,
[QTY] [numeric](9, 0) NULL ,
here is the rest of the string that should be inthe result set but isn't.
[ENTRYDATE] [datetime] NULL ) ON [PRIMARY]GO'
Any Thoughts
Thanks
TalenX
this is VERY werid, I wrote a sp that has a simple dynamic string builder in it..
that is later exec()
the odd thing here is when i attempt to build the SQL string it only returns 307 chars from a varchar(8000) varible.
here is the code ( i have stripped out the dyn varibles for ease of exec.)
Code:
SET NOCOUNT ON
SET ANSI_WARNINGS OFF
DECLARE @SQL varchar(8000)
SET @SQL =
'CREATE TABLE dbo.tPRODUCTSALES_200001 (
[PKID] [int] IDENTITY (1, 1) NOT NULL ,
[MONTH_ID] [int] NOT NULL ,
CONSTRAINT chk_MONTH_IDCHECK200001 (MONTH_ID = 200001 ),
[PRODUCT_ID] [int] NULL ,
[SALES] [decimal](7, 2) NULL ,
[QTY] [numeric](9, 0) NULL ,
[ENTRYDATE] [datetime] NULL ) ON [PRIMARY]GO'
SELECT LEN(@SQL) as Char_Len_Value
SELECT (@SQL) as SQL_String
RESULTS: ( notice that the SQL string stops after the OTY columns ","
-----------------------------------------------
Char_Len_Value
--------------
302
SQL_String
-------------------------------------------------
CREATE TABLE dbo.tPRODUCTSALES_200001 (
[PKID] [int] IDENTITY (1, 1) NOT NULL ,
[MONTH_ID] [int] NOT NULL ,
CONSTRAINT chk_MONTH_IDCHECK200001 (MONTH_ID = 200001 ),
[PRODUCT_ID] [int] NULL ,
[SALES] [decimal](7, 2) NULL ,
[QTY] [numeric](9, 0) NULL ,
here is the rest of the string that should be inthe result set but isn't.
[ENTRYDATE] [datetime] NULL ) ON [PRIMARY]GO'
Any Thoughts
Thanks
TalenX