May 18, 2010 at 7:20 am
I need to declare a table variable from another existing table.
If I use "Script table as" will create table variable with [], like
CREATE TABLE [dbo].[CLAIM](
[CLAIMNO] [varchar](20) NOT NULL,
[ACCT] [varchar](4) NOT NULL,
....
Is there a function can return script without [ ]?
May 18, 2010 at 8:18 am
Why are you concerned about the [] this works:
DECLARE @CLAIM table(
[CLAIMNO] [varchar](20) NOT NULL,
[ACCT] [varchar](4) NOT NULL)
INSERT INTO @CLAIM
SELECT 1, 'Did' UNION ALL
SELECT 2, 'Doit'
SELECT * FROM @CLAIM
/* Results:
CLAIMNOACCT
1Did
2Doit
*/
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy