Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Create Table mit Index bei MS-SQL

Empfohlene Antworten

Veröffentlicht

hajo!

wie kann ich bei ms-sql das anlegen eines index gleich mit in das create table statement packen?

bei mysql würde es so ausehen:

CREATE TABLE "docstatus" (

"accnr" int(11) NOT NULL default '0',

...

PRIMARY KEY ("id"),

KEY "ind" ("accnr"),

...

Möchtest du nur einen Schlüssel oder einen Index anlegen? Ersteres geht innerhalb der CREATE TABLE-Anweisung, letzteres wäre ein separater Befehl. (korrigier mich sonst wer, habe bis jetzt nichts gegenteiliges benutzt bzw. wäre mir bekannt...)

Hatte gerade nen kleinen Denkfehler. Auf Keys kann man natürlich gleich nen Index legen lassen... Zusätzliche Indizes wie z.B. auf accnr musst du extra setzen.


CREATE TABLE docstatus

(

   id          int   NOT NULL,

   accnr       int   NOT NULL DEFAULT ((0)),

   CONSTRAINT [id] PRIMARY KEY NONCLUSTERED (id)

)

CREATE NONCLUSTERED INDEX [IX_docstatus_accnr] ON docstatus 

(

   accnr

)

GO  

Gruß,

Honky

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.