- Remove From My Forums
-
Question
-
Greetings,
I have SQL 2005 with Service Pack 3 installed on the Windows Server 2008 R2 with SP1.
When I run the
‘SQL Server 2005 Surface Area Configuration’ utility, run ‘Add New Administrator’ to a domainadministrator account (the same Administrator account I used to install it), I get the following error:
Can someone please tell me what I need to do to get past this error? Thanks!
Answers
-
can you provide more details about SQL Server machine? Is that a member server or domain controller? Is that part of domain?
You should start from http://support.microsoft.com/kb/324321 (How to troubleshoot error 15401)
Can you run below commandexec xp_logininfo 'LABAdministrator'
Balmukund Lakhani | Please mark solved if I’ve answered your question, vote for it as helpful to help other user’s find a solution quicker
———————————————————————————
This posting is provided «AS IS» with no warranties, and confers no rights.
———————————————————————————
My Blog |
Team Blog | @Twitter-
Proposed as answer by
Thursday, February 9, 2012 7:54 AM
-
Marked as answer by
Ed Price — MSFTMicrosoft employee
Wednesday, January 16, 2013 9:28 PM
-
Proposed as answer by
-
It seems like the LABAdministrator user has no rights in SQL.
Your instance is definately running with Windows authentication or Mixed- right? Check via SSMS > Right click the server > Properties > Security > Server Authentication
Can you login as the SA account and run: —
CREATE LOGIN [LABAdministrator] FROM WINDOWS WITH DEFAULT_DATABASE = [YOURDBNAME]; GO sp_addsrvrolemember 'LABAdministrator', 'sysadmin' GO USE YOURDBNAME; CREATE USER Administrator FOR LOGIN [LABAdministrator] go
Sean Massey | Consultant,
iUNITEFeel free to contact me through
My Blog,
Twitter or
Hire Me.
Please click the Mark as Answer button if a post solves your problem!-
Marked as answer by
Ed Price — MSFTMicrosoft employee
Wednesday, January 16, 2013 9:28 PM
-
Marked as answer by
-
At a windows command prompt when logged in as the LABAdministrator account can you run this and post the results?
echo %username%@%userdomain%
Sean Massey | Consultant,
iUNITEFeel free to contact me through
My Blog,
Twitter or
Hire Me.
Please click the Mark as Answer button if a post solves your problem!-
Edited by
Sean Massey
Wednesday, February 15, 2012 2:56 AM -
Marked as answer by
Ed Price — MSFTMicrosoft employee
Wednesday, January 16, 2013 9:28 PM
-
Edited by
- Remove From My Forums
-
Question
-
I am trying to reinstall SQL Server but it is breaking down with error message «» is not a valid login or you do not have permission.»
Analysis Services is installing correctly, but it is breaking down with the Database Engine.
I have a domain account and a local Windows account. The same happens with both, even though they are Administrators.
Also, when using the local Windows account for the installation it refuses to accept the domain account as an additional SQL Server administrator on the grounds that the domain does not show up in the permitted locations.
The installation is the main problem, but the location thing is worrying.
Any advice?
Ken
-
Moved by
Wednesday, April 4, 2012 1:13 AM
(From:Getting started with SQL Server)
-
Moved by
Answers
-
Hi Kenneth Macleod,
>> Error 15007 is not a valid login or you do not have permission
Regarding to the error message, which might be caused by you were trying to add account as Administrator to SQL Server but SID is not proper.In the setup dialog step about Server Configuration, there’s a «list» of services to be configured, and there you need to provide a valid Local Windows account or a Domain account. You can try to select to use Mixed Mode authentication or just Windows (trusted)
authentication in your case.Based on my research there is another issue is because of the computer name is same as the account name. If so , you can try to change your computer name and then try to re-install again. For more information, please refer to
here.
If it does not work, please share C:Program FilesMicrosoft SQL Server100Setup BootstrapLog20110905_172346Detail.txt with us.
Regards,
Amber zhang
TechNet Subscriber Support
If you are TechNet Subscription user and have any feedback on our support quality, please send your feedback
here.-
Edited by
amber zhang
Wednesday, April 4, 2012 2:42 AM -
Marked as answer by
amber zhang
Wednesday, April 11, 2012 3:06 AM
-
Edited by
-
Can you try leaving and then joining back the domain ?But before this make sure that you know the machine local administrator username and password.
Regards,
Ahmed Ibrahim
SQL Server Setup Team
This posting is provided «AS IS» with no warranties, and confers no rights. Please remember to click «Mark as Answer» and «Vote as Helpful» on posts that help you.
This can be beneficial to other community members reading the thread.-
Marked as answer by
amber zhang
Wednesday, April 11, 2012 3:06 AM
-
Marked as answer by
- Remove From My Forums
-
Question
-
I am trying to reinstall SQL Server but it is breaking down with error message «» is not a valid login or you do not have permission.»
Analysis Services is installing correctly, but it is breaking down with the Database Engine.
I have a domain account and a local Windows account. The same happens with both, even though they are Administrators.
Also, when using the local Windows account for the installation it refuses to accept the domain account as an additional SQL Server administrator on the grounds that the domain does not show up in the permitted locations.
The installation is the main problem, but the location thing is worrying.
Any advice?
Ken
-
Moved by
Wednesday, April 4, 2012 1:13 AM
(From:Getting started with SQL Server)
-
Moved by
Answers
-
Hi Kenneth Macleod,
>> Error 15007 is not a valid login or you do not have permission
Regarding to the error message, which might be caused by you were trying to add account as Administrator to SQL Server but SID is not proper.In the setup dialog step about Server Configuration, there’s a «list» of services to be configured, and there you need to provide a valid Local Windows account or a Domain account. You can try to select to use Mixed Mode authentication or just Windows (trusted)
authentication in your case.Based on my research there is another issue is because of the computer name is same as the account name. If so , you can try to change your computer name and then try to re-install again. For more information, please refer to
here.
If it does not work, please share C:Program FilesMicrosoft SQL Server100Setup BootstrapLog20110905_172346Detail.txt with us.
Regards,
Amber zhang
TechNet Subscriber Support
If you are TechNet Subscription user and have any feedback on our support quality, please send your feedback
here.-
Edited by
amber zhang
Wednesday, April 4, 2012 2:42 AM -
Marked as answer by
amber zhang
Wednesday, April 11, 2012 3:06 AM
-
Edited by
-
Can you try leaving and then joining back the domain ?But before this make sure that you know the machine local administrator username and password.
Regards,
Ahmed Ibrahim
SQL Server Setup Team
This posting is provided «AS IS» with no warranties, and confers no rights. Please remember to click «Mark as Answer» and «Vote as Helpful» on posts that help you.
This can be beneficial to other community members reading the thread.-
Marked as answer by
amber zhang
Wednesday, April 11, 2012 3:06 AM
-
Marked as answer by
- Remove From My Forums
-
Question
-
I am trying to reinstall SQL Server but it is breaking down with error message «» is not a valid login or you do not have permission.»
Analysis Services is installing correctly, but it is breaking down with the Database Engine.
I have a domain account and a local Windows account. The same happens with both, even though they are Administrators.
Also, when using the local Windows account for the installation it refuses to accept the domain account as an additional SQL Server administrator on the grounds that the domain does not show up in the permitted locations.
The installation is the main problem, but the location thing is worrying.
Any advice?
Ken
-
Moved by
Wednesday, April 4, 2012 1:13 AM
(From:Getting started with SQL Server)
-
Moved by
Answers
-
Hi Kenneth Macleod,
>> Error 15007 is not a valid login or you do not have permission
Regarding to the error message, which might be caused by you were trying to add account as Administrator to SQL Server but SID is not proper.In the setup dialog step about Server Configuration, there’s a «list» of services to be configured, and there you need to provide a valid Local Windows account or a Domain account. You can try to select to use Mixed Mode authentication or just Windows (trusted)
authentication in your case.Based on my research there is another issue is because of the computer name is same as the account name. If so , you can try to change your computer name and then try to re-install again. For more information, please refer to
here.
If it does not work, please share C:Program FilesMicrosoft SQL Server100Setup BootstrapLog20110905_172346Detail.txt with us.
Regards,
Amber zhang
TechNet Subscriber Support
If you are TechNet Subscription user and have any feedback on our support quality, please send your feedback
here.-
Edited by
amber zhang
Wednesday, April 4, 2012 2:42 AM -
Marked as answer by
amber zhang
Wednesday, April 11, 2012 3:06 AM
-
Edited by
-
Can you try leaving and then joining back the domain ?But before this make sure that you know the machine local administrator username and password.
Regards,
Ahmed Ibrahim
SQL Server Setup Team
This posting is provided «AS IS» with no warranties, and confers no rights. Please remember to click «Mark as Answer» and «Vote as Helpful» on posts that help you.
This can be beneficial to other community members reading the thread.-
Marked as answer by
amber zhang
Wednesday, April 11, 2012 3:06 AM
-
Marked as answer by
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 |
/****** Object: Database Autovokzaly Script Date: 22.01.2008 2:22:39 ******/ CREATE DATABASE [Autovokzaly2] ON (NAME = N'Autovokzaly_Data2', FILENAME = N'C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLDataAutovokzaly_Data2.MDF' , SIZE = 9, FILEGROWTH = 10%) LOG ON (NAME = N'Autovokzaly_Log2', FILENAME = N'C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLDataAutovokzaly_Log2.LDF' , SIZE = 1, FILEGROWTH = 10%) COLLATE Cyrillic_General_CI_AS GO EXEC sp_dboption N'Autovokzaly2', N'autoclose', N'false' GO EXEC sp_dboption N'Autovokzaly2', N'bulkcopy', N'false' GO EXEC sp_dboption N'Autovokzaly2', N'trunc. log', N'false' GO EXEC sp_dboption N'Autovokzaly2', N'torn page detection', N'true' GO EXEC sp_dboption N'Autovokzaly2', N'read only', N'false' GO EXEC sp_dboption N'Autovokzaly2', N'dbo use', N'false' GO EXEC sp_dboption N'Autovokzaly2', N'single', N'false' GO EXEC sp_dboption N'Autovokzaly2', N'autoshrink', N'false' GO EXEC sp_dboption N'Autovokzaly2', N'ANSI null default', N'false' GO EXEC sp_dboption N'Autovokzaly2', N'recursive triggers', N'false' GO EXEC sp_dboption N'Autovokzaly2', N'ANSI nulls', N'false' GO EXEC sp_dboption N'Autovokzaly2', N'concat null yields null', N'false' GO EXEC sp_dboption N'Autovokzaly2', N'cursor close on commit', N'false' GO EXEC sp_dboption N'Autovokzaly2', N'default to local cursor', N'false' GO EXEC sp_dboption N'Autovokzaly2', N'quoted identifier', N'false' GO EXEC sp_dboption N'Autovokzaly2', N'ANSI warnings', N'false' GO EXEC sp_dboption N'Autovokzaly2', N'auto create statistics', N'true' GO EXEC sp_dboption N'Autovokzaly2', N'auto update statistics', N'true' GO IF( (@@microsoftversion / POWER(2, 24) = 8) AND (@@microsoftversion & 0xffff >= 724) ) EXEC sp_dboption N'Autovokzaly2', N'db chaining', N'false' GO USE [Autovokzaly2] GO /****** Object: Login Administrator Script Date: 22.01.2008 2:22:39 ******/ IF NOT EXISTS (SELECT * FROM master.dbo.syslogins WHERE loginname = N'Administrator') BEGIN DECLARE @logindb nvarchar(132), @loginlang nvarchar(132) SELECT @logindb = N'Autovokzaly', @loginlang = N'us_english' IF @logindb IS NULL OR NOT EXISTS (SELECT * FROM master.dbo.sysdatabases WHERE name = @logindb) SELECT @logindb = N'master' IF @loginlang IS NULL OR (NOT EXISTS (SELECT * FROM master.dbo.syslanguages WHERE name = @loginlang) AND @loginlang <> N'us_english') SELECT @loginlang = @@LANGUAGE EXEC sp_addlogin N'Administrator', NULL, @logindb, @loginlang END GO /****** Object: Login Kadry01 Script Date: 22.01.2008 2:22:39 ******/ IF NOT EXISTS (SELECT * FROM master.dbo.syslogins WHERE loginname = N'Kadry01') BEGIN DECLARE @logindb nvarchar(132), @loginlang nvarchar(132) SELECT @logindb = N'Autovokzaly', @loginlang = N'us_english' IF @logindb IS NULL OR NOT EXISTS (SELECT * FROM master.dbo.sysdatabases WHERE name = @logindb) SELECT @logindb = N'master' IF @loginlang IS NULL OR (NOT EXISTS (SELECT * FROM master.dbo.syslanguages WHERE name = @loginlang) AND @loginlang <> N'us_english') SELECT @loginlang = @@LANGUAGE EXEC sp_addlogin N'Kadry01', NULL, @logindb, @loginlang END GO /****** Object: Login Kassir01 Script Date: 22.01.2008 2:22:39 ******/ IF NOT EXISTS (SELECT * FROM master.dbo.syslogins WHERE loginname = N'Kassir01') BEGIN DECLARE @logindb nvarchar(132), @loginlang nvarchar(132) SELECT @logindb = N'Autovokzaly', @loginlang = N'us_english' IF @logindb IS NULL OR NOT EXISTS (SELECT * FROM master.dbo.sysdatabases WHERE name = @logindb) SELECT @logindb = N'master' IF @loginlang IS NULL OR (NOT EXISTS (SELECT * FROM master.dbo.syslanguages WHERE name = @loginlang) AND @loginlang <> N'us_english') SELECT @loginlang = @@LANGUAGE EXEC sp_addlogin N'Kassir01', NULL, @logindb, @loginlang END GO /****** Object: Login Manager Script Date: 22.01.2008 2:22:39 ******/ IF NOT EXISTS (SELECT * FROM master.dbo.syslogins WHERE loginname = N'Manager') BEGIN DECLARE @logindb nvarchar(132), @loginlang nvarchar(132) SELECT @logindb = N'Autovokzaly', @loginlang = N'us_english' IF @logindb IS NULL OR NOT EXISTS (SELECT * FROM master.dbo.sysdatabases WHERE name = @logindb) SELECT @logindb = N'master' IF @loginlang IS NULL OR (NOT EXISTS (SELECT * FROM master.dbo.syslanguages WHERE name = @loginlang) AND @loginlang <> N'us_english') SELECT @loginlang = @@LANGUAGE EXEC sp_addlogin N'Manager', NULL, @logindb, @loginlang END GO /****** Object: Login Mechanic Script Date: 22.01.2008 2:22:39 ******/ IF NOT EXISTS (SELECT * FROM master.dbo.syslogins WHERE loginname = N'Mechanic') BEGIN DECLARE @logindb nvarchar(132), @loginlang nvarchar(132) SELECT @logindb = N'Autovokzaly', @loginlang = N'us_english' IF @logindb IS NULL OR NOT EXISTS (SELECT * FROM master.dbo.sysdatabases WHERE name = @logindb) SELECT @logindb = N'master' IF @loginlang IS NULL OR (NOT EXISTS (SELECT * FROM master.dbo.syslanguages WHERE name = @loginlang) AND @loginlang <> N'us_english') SELECT @loginlang = @@LANGUAGE EXEC sp_addlogin N'Mechanic', NULL, @logindb, @loginlang END GO /****** Object: Login BUILTINАдминистраторы Script Date: 22.01.2008 2:22:39 ******/ EXEC sp_addsrvrolemember N'BUILTINАдминистраторы', sysadmin GO /****** Object: User Administrator Script Date: 22.01.2008 2:22:39 ******/ IF NOT EXISTS (SELECT * FROM dbo.sysusers WHERE name = N'Administrator') EXEC sp_grantdbaccess N'Administrator', N'Administrator' GO /****** Object: User guest Script Date: 22.01.2008 2:22:39 ******/ IF NOT EXISTS (SELECT * FROM dbo.sysusers WHERE name = N'guest' AND hasdbaccess = 1) EXEC sp_grantdbaccess N'guest' GO /****** Object: User Kadry01 Script Date: 22.01.2008 2:22:39 ******/ IF NOT EXISTS (SELECT * FROM dbo.sysusers WHERE name = N'Kadry01') EXEC sp_grantdbaccess N'Kadry01', N'Kadry01' GO /****** Object: User Kassir01 Script Date: 22.01.2008 2:22:39 ******/ IF NOT EXISTS (SELECT * FROM dbo.sysusers WHERE name = N'Kassir01') EXEC sp_grantdbaccess N'Kassir01', N'Kassir01' GO /****** Object: User Manager Script Date: 22.01.2008 2:22:39 ******/ IF NOT EXISTS (SELECT * FROM dbo.sysusers WHERE name = N'Manager') EXEC sp_grantdbaccess N'Manager', N'Manager' GO /****** Object: User Mechanic Script Date: 22.01.2008 2:22:39 ******/ IF NOT EXISTS (SELECT * FROM dbo.sysusers WHERE name = N'Mechanic') EXEC sp_grantdbaccess N'Mechanic', N'Mechanic' GO /****** Object: User Administrator Script Date: 22.01.2008 2:22:39 ******/ EXEC sp_addrolemember N'db_owner', N'Administrator' GO /****** Object: Table [dbo].[AutoPark] Script Date: 22.01.2008 2:22:40 ******/ CREATE TABLE [dbo].[AutoPark] ( [ID] [INT] IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL , [AutoVokzal] [INT] NULL , [AutoNumber] [NCHAR] (10) COLLATE Cyrillic_General_CI_AS NULL , [Kol_voMest] [INT] NULL , [Model] [NCHAR] (10) COLLATE Cyrillic_General_CI_AS NULL ) ON [PRIMARY] GO /****** Object: Table [dbo].[AutoVokzal] Script Date: 22.01.2008 2:22:40 ******/ CREATE TABLE [dbo].[AutoVokzal] ( [ID] [INT] IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL , [Region] [NCHAR] (50) COLLATE Cyrillic_General_CI_AS NULL , [Sity] [NCHAR] (50) COLLATE Cyrillic_General_CI_AS NULL , [Street] [NCHAR] (50) COLLATE Cyrillic_General_CI_AS NULL , [Flat] [INT] NULL , [Phone] [NCHAR] (10) COLLATE Cyrillic_General_CI_AS NULL , [Director] [NCHAR] (20) COLLATE Cyrillic_General_CI_AS NULL , [NAME] [NCHAR] (50) COLLATE Cyrillic_General_CI_AS NULL ) ON [PRIMARY] GO /****** Object: Table [dbo].[Personal] Script Date: 22.01.2008 2:22:40 ******/ CREATE TABLE [dbo].[Personal] ( [Id] [INT] IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL , [FirstName] [NCHAR] (20) COLLATE Cyrillic_General_CI_AS NULL , [SurName] [NCHAR] (20) COLLATE Cyrillic_General_CI_AS NULL , [Dolgnost] [NCHAR] (50) COLLATE Cyrillic_General_CI_AS NULL , [Pol] [bit] NULL , [BirhtDay] [datetime] NULL , [INN] [NCHAR] (10) COLLATE Cyrillic_General_CI_AS NULL , [NumberPension] [NCHAR] (10) COLLATE Cyrillic_General_CI_AS NULL , [Region] [NCHAR] (10) COLLATE Cyrillic_General_CI_AS NULL , [Sity] [NCHAR] (10) COLLATE Cyrillic_General_CI_AS NULL , [Street] [NCHAR] (10) COLLATE Cyrillic_General_CI_AS NULL , [Flat] [INT] NULL , [Phone] [NCHAR] (10) COLLATE Cyrillic_General_CI_AS NULL , [AvtoVokzal] [INT] NULL , [LogonName] [NCHAR] (10) COLLATE Cyrillic_General_CI_AS NULL , [Password] [NCHAR] (10) COLLATE Cyrillic_General_CI_AS NULL ) ON [PRIMARY] GO /****** Object: Table [dbo].[Reysi] Script Date: 22.01.2008 2:22:40 ******/ CREATE TABLE [dbo].[Reysi] ( [ID] [INT] IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL , [Code] [NCHAR] (10) COLLATE Cyrillic_General_CI_AS NULL , [DATA] [datetime] NULL , [Driver] [INT] NULL , [SecondDriver] [INT] NULL , [PunktOtpravlenia] [INT] NULL , [PunktNaznachenia] [INT] NULL , [Kontroler] [INT] NULL , [NamberPlatformi] [NCHAR] (10) COLLATE Cyrillic_General_CI_AS NULL , [AutoVokzal] [INT] NULL , [Avto] [INT] NULL ) ON [PRIMARY] GO /****** Object: Table [dbo].[Sity] Script Date: 22.01.2008 2:22:40 ******/ CREATE TABLE [dbo].[Sity] ( [ID] [INT] IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL , [Name] [NCHAR] (50) COLLATE Cyrillic_General_CI_AS NULL , [Region] [NCHAR] (50) COLLATE Cyrillic_General_CI_AS NULL , [Map] [image] NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO /****** Object: Table [dbo].[Tikets] Script Date: 22.01.2008 2:22:40 ******/ CREATE TABLE [dbo].[Tikets] ( [ID] [INT] IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL , [Plase] [INT] NULL , [Tsena] [REAL] NULL , [Bagage] [bit] NULL , [Reys] [INT] NOT NULL , [Zakaz] [INT] NULL ) ON [PRIMARY] GO /****** Object: Table [dbo].[Zakaz] Script Date: 22.01.2008 2:22:40 ******/ CREATE TABLE [dbo].[Zakaz] ( [ID] [INT] IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL , [DATE] [datetime] NULL , [Reys] [INT] NULL , [FIO] [NCHAR] (50) COLLATE Cyrillic_General_CI_AS NULL , [TelephoneNumber] [NCHAR] (10) COLLATE Cyrillic_General_CI_AS NULL ) ON [PRIMARY] GO ALTER TABLE [dbo].[AutoPark] WITH NOCHECK ADD CONSTRAINT [PK_AutoPark] PRIMARY KEY CLUSTERED ( [ID] ) ON [PRIMARY] GO ALTER TABLE [dbo].[AutoVokzal] WITH NOCHECK ADD CONSTRAINT [PK_AutoVokzal] PRIMARY KEY CLUSTERED ( [ID] ) ON [PRIMARY] GO ALTER TABLE [dbo].[Personal] WITH NOCHECK ADD CONSTRAINT [PK_Personal] PRIMARY KEY CLUSTERED ( [Id] ) ON [PRIMARY] GO ALTER TABLE [dbo].[Reysi] WITH NOCHECK ADD CONSTRAINT [PK_Reysi] PRIMARY KEY CLUSTERED ( [ID] ) ON [PRIMARY] GO ALTER TABLE [dbo].[Sity] WITH NOCHECK ADD CONSTRAINT [PK_Sity] PRIMARY KEY CLUSTERED ( [ID] ) ON [PRIMARY] GO ALTER TABLE [dbo].[Tikets] WITH NOCHECK ADD CONSTRAINT [PK_Tikets] PRIMARY KEY CLUSTERED ( [ID] ) ON [PRIMARY] GO ALTER TABLE [dbo].[Zakaz] WITH NOCHECK ADD CONSTRAINT [PK_Zakaz] PRIMARY KEY CLUSTERED ( [ID] ) ON [PRIMARY] GO ALTER TABLE [dbo].[AutoPark] ADD CONSTRAINT [FK_AutoPark_AutoVokzal] FOREIGN KEY ( [AutoVokzal] ) REFERENCES [dbo].[AutoVokzal] ( [ID] ) GO ALTER TABLE [dbo].[Personal] ADD CONSTRAINT [FK_Personal_AutoVokzal] FOREIGN KEY ( [AvtoVokzal] ) REFERENCES [dbo].[AutoVokzal] ( [ID] ) GO ALTER TABLE [dbo].[Reysi] ADD CONSTRAINT [FK_Reysi_AutoPark] FOREIGN KEY ( [Avto] ) REFERENCES [dbo].[AutoPark] ( [ID] ), CONSTRAINT [FK_Reysi_AutoVokzal] FOREIGN KEY ( [AutoVokzal] ) REFERENCES [dbo].[AutoVokzal] ( [ID] ), CONSTRAINT [FK_Reysi_Personal] FOREIGN KEY ( [Driver] ) REFERENCES [dbo].[Personal] ( [Id] ), CONSTRAINT [FK_Reysi_Personal1] FOREIGN KEY ( [SecondDriver] ) REFERENCES [dbo].[Personal] ( [Id] ), CONSTRAINT [FK_Reysi_Personal2] FOREIGN KEY ( [Kontroler] ) REFERENCES [dbo].[Personal] ( [Id] ), CONSTRAINT [FK_Reysi_Sity] FOREIGN KEY ( [PunktOtpravlenia] ) REFERENCES [dbo].[Sity] ( [ID] ), CONSTRAINT [FK_Reysi_Sity1] FOREIGN KEY ( [PunktNaznachenia] ) REFERENCES [dbo].[Sity] ( [ID] ) GO ALTER TABLE [dbo].[Tikets] ADD CONSTRAINT [FK_Tikets_Reysi] FOREIGN KEY ( [Reys] ) REFERENCES [dbo].[Reysi] ( [ID] ), CONSTRAINT [FK_Tikets_Zakaz] FOREIGN KEY ( [Zakaz] ) REFERENCES [dbo].[Zakaz] ( [ID] ) GO ALTER TABLE [dbo].[Zakaz] ADD CONSTRAINT [FK_Zakaz_Reysi] FOREIGN KEY ( [Reys] ) REFERENCES [dbo].[Reysi] ( [ID] ) GO SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS ON GO /****** Object: Trigger dbo.DEL_reys Script Date: 22.01.2008 2:22:40 ******/ CREATE TRIGGER DEL_reys ON dbo.Reysi instead OF DELETE AS IF @@ROWCOUNT=1 BEGIN DECLARE @y INT SELECT @y=ID FROM deleted DELETE FROM Tikets WHERE Reys=@y DELETE FROM Zakaz WHERE Reys=@y END GO SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS ON GO |
List of error messages between 15000 and 15999 in SQL Server 2017.
These error messages are all available by querying the sys.messages
catalog view on the master
database.