Readdy Write  
0,00 €
Your View Money
Views: Count
Self 20% 0
Your Content 60% 0

Users by Links 0
u1*(Content+Views) 10% 0
Follow-Follower 0
s2*(Income) 5% 0

Count
Followers 0
Login Register as User

Tabelle erstellen in SQL Server und PostgreSQL pgAdmin4

13.03.2023 (👁4068)


Migration SQL Server zu PostgreSQL

Welche Datentypen müssen angepasst werden.

SQL Server

PostgreSQL

[nvarchar](36)

varchar(36)

[nvarchar](max)

character varying

[nvarchar](max)

text

[datetime]

timestamp

                   

CREATE Script in SQL Server Management Studio

USE [codedocu_de]

GO

 

/****** Object:  Table [dbo].[tbl_Articles]    Script Date: 13.03.2023 12:18:22 ******/

SET ANSI_NULLS ON

GO

 

SET QUOTED_IDENTIFIER ON

GO

 

CREATE TABLE [dbo].[tbl_Articles](

       [GuidArticle] [nvarchar](36) NOT NULL,

       [GuidUser] [nvarchar](36) NULL,

       [Content_Title] [nvarchar](255) NULL,

       [Content_Text] [nvarchar](max) NULL,

       [Content_Html] [nvarchar](max) NULL,

       [Folder] [nvarchar](450) NULL,

       [Keywords] [nvarchar](255) NULL,

       [GuidImage] [nvarchar](36) NULL,

       [HasFiles] [bit] NULL,

       [DateCreated] [datetime] NULL,

       [DateEdit] [datetime] NULL,

       [nVisits] [int] NULL,

       [OrderNr] [int] NULL,

       [IDArea] [int] NULL,

       [IDFolder] [int] NULL,

 CONSTRAINT [PK_tbl_Articles] PRIMARY KEY CLUSTERED

(

       [GuidArticle] ASC

)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]

) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO

 

ALTER TABLE [dbo].[tbl_Articles] ADD  CONSTRAINT [DF_tbl_Articles_HasFiles]  DEFAULT ((0)) FOR [HasFiles]

GO

 

 

 

 

 

--Table: public.tbl_Articles

 

DROP TABLE IF EXISTS public."tbl_Articles";

 

CREATE TABLE IF NOT EXISTS public."tbl_Articles"

(

    "GuidArticle" varchar(36) NOT NULL,

          "GuidUser" varchar(36) NULL,

          "Content_Title" varchar(255) NULL,

          "Content_Text" text NULL,

          "Content_Html" character varying NULL,

          "Folder" varchar(450) NULL,

          "Keywords" varchar(255) NULL,

          "GuidImage" varchar(36) NULL,

          "HasFiles" bit NULL,

          "DateCreated" timestamp NULL,

          "DateEdit" timestamp NULL,

          "nVisits" int NULL

)

 

TABLESPACE pg_default;

 

ALTER TABLE IF EXISTS public."tbl_Articles"

    OWNER to postgres;

 

COMMENT ON TABLE public."tbl_Articles"

    IS 'Article Database Table1';

In pgAdmin4

Ein Bild, das Text enthält.

Automatisch generierte Beschreibung