Click here to Skip to main content
15,123,357 members
Home / Discussions / Database
   

Database

 
AnswerRe: SQL Query with a Loop Pin
#realJSOP6-Jan-20 6:16
mva#realJSOP6-Jan-20 6:16 
GeneralRe: SQL Query with a Loop Pin
Bobby Underwood6-Jan-20 6:22
MemberBobby Underwood6-Jan-20 6:22 
AnswerRe: SQL Query with a Loop Pin
Jörgen Andersson7-Jan-20 6:52
professionalJörgen Andersson7-Jan-20 6:52 
Questionincorrect syntax near begin expecting external for Alter Procedure Pin
simpledeveloper27-Dec-19 10:23
Membersimpledeveloper27-Dec-19 10:23 
AnswerRe: incorrect syntax near begin expecting external for Alter Procedure Pin
Jörgen Andersson28-Dec-19 0:14
professionalJörgen Andersson28-Dec-19 0:14 
QuestionAdding multiple columns with condition Pin
simpledeveloper26-Dec-19 15:58
Membersimpledeveloper26-Dec-19 15:58 
AnswerRe: Adding multiple columns with condition Pin
Mycroft Holmes26-Dec-19 20:58
professionalMycroft Holmes26-Dec-19 20:58 
AnswerRe: Adding multiple columns with condition Pin
Jörgen Andersson27-Dec-19 4:40
professionalJörgen Andersson27-Dec-19 4:40 
Try this:
SQL
IF NOT EXISTS (
  SELECT * 
  FROM   sys.columns 
  WHERE  object_id = OBJECT_ID(N'dbo.Cases') 
         AND name = 'DocketNumber'
)
BEGIN
    ALTER TABLE [dbo].[Cases]
        ADD [DocketNumber]              NVARCHAR (50)   NULL
END


But you have to check and add every column separately.
Wrong is evil and must be defeated. - Jeff Ello

GeneralRe: Adding multiple columns with condition Pin
simpledeveloper27-Dec-19 6:29
Membersimpledeveloper27-Dec-19 6:29 
GeneralRe: Adding multiple columns with condition Pin
Jörgen Andersson27-Dec-19 6:32
professionalJörgen Andersson27-Dec-19 6:32 
GeneralRe: Adding multiple columns with condition Pin
simpledeveloper27-Dec-19 9:44
Membersimpledeveloper27-Dec-19 9:44 
QuestionCrystal Report to SQL server 2012 database Pin
Member 1447460719-Dec-19 11:39
MemberMember 1447460719-Dec-19 11:39 
QuestionBackup rows tables of SQL Server database by SMO base on colums's value Pin
Member 1417466417-Dec-19 15:39
MemberMember 1417466417-Dec-19 15:39 
AnswerRe: Backup rows tables of SQL Server database by SMO base on colums's value Pin
Richard Deeming18-Dec-19 0:47
mveRichard Deeming18-Dec-19 0:47 
GeneralRe: Backup rows tables of SQL Server database by SMO base on colums's value Pin
Member 1417466418-Dec-19 0:57
MemberMember 1417466418-Dec-19 0:57 
AnswerRe: Backup rows tables of SQL Server database by SMO base on colums's value Pin
David Mujica18-Dec-19 6:58
MemberDavid Mujica18-Dec-19 6:58 
GeneralRe: Backup rows tables of SQL Server database by SMO base on colums's value Pin
Member 1417466418-Dec-19 15:35
MemberMember 1417466418-Dec-19 15:35 
GeneralRe: Backup rows tables of SQL Server database by SMO base on colums's value Pin
David Mujica19-Dec-19 10:37
MemberDavid Mujica19-Dec-19 10:37 
GeneralCode converter Pin
David Mujica19-Dec-19 10:47
MemberDavid Mujica19-Dec-19 10:47 
GeneralRe: Code converter Pin
Member 1417466419-Dec-19 17:01
MemberMember 1417466419-Dec-19 17:01 
AnswerRe: Backup rows tables of SQL Server database by SMO base on colums's value Pin
Member 1417466430-Jan-20 23:40
MemberMember 1417466430-Jan-20 23:40 
Questionms sql server error 18456 on sa login Pin
pwojtysiak17-Dec-19 1:24
Memberpwojtysiak17-Dec-19 1:24 
AnswerRe: ms sql server error 18456 on sa login Pin
Richard Deeming17-Dec-19 2:33
mveRichard Deeming17-Dec-19 2:33 
QuestionSQL Server Management Studio VS SQL Server in Visual Studio 2019 Pin
Ebrahimaw21-Nov-19 20:33
MemberEbrahimaw21-Nov-19 20:33 
AnswerRe: SQL Server Management Studio VS SQL Server in Visual Studio 2019 Pin
Richard MacCutchan21-Nov-19 22:36
mveRichard MacCutchan21-Nov-19 22:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.