|
-
Apr 27th, 2013, 12:58 AM
#1
Thread Starter
Fanatic Member
[RESOLVED] Create Table
Hi
I am creating table through coding , i want active field should have default value = "Y"
sql = " CREATE TABLE Test" & "" _
& " (tcode nvarchar(10) NOT NULL Primary Key, " _
& " tname nvarchar(100) NULL," _
& " active nvarchar(1) NULL," _
& ")"
cnn.Execute (sql)
Thanks
-
Apr 27th, 2013, 02:13 AM
#2
Re: Create Table
Something along the lines of
sql Code:
INSERT INTO `test` (`tcode`, `tname`, `active`) VALUES
(1, NULL, 'Y');
should work.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Apr 27th, 2013, 02:28 AM
#3
Thread Starter
Fanatic Member
Re: Create Table
Hi
I want this during Table Creation , i don't want through Insert statement.
Thanks
-
Apr 27th, 2013, 02:38 AM
#4
Re: Create Table
Moved to the Database Development forum.
-
Apr 27th, 2013, 02:59 AM
#5
Re: Create Table
Hi,
Here you go:-
Code:
CREATE TABLE Test (active nvarchar(1) NULL default 'Y')
Hope that helps.
Cheers,
Ian
-
Apr 27th, 2013, 03:37 AM
#6
Thread Starter
Fanatic Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|