'FK_dbo.SalesOrderLineTasks_dbo.Events_Event_ID'附近的语法不正确

时间:2017-11-20 22:31:16

标签: sql-server tsql

当我尝试并运行时

alter table salesorderlinetasks drop constraint 
'FK_dbo.SalesOrderLineTasks_dbo.Events_Event_ID'

在Sql Server Management Studio中的这个命令,我收到一个错误。

  

'FK_dbo.SalesOrderLineTasks_dbo.Events_Event_ID'附近的语法不正确。

我该怎么办?

2 个答案:

答案 0 :(得分:1)

它应该包含双引号而不是单引号。

答案 1 :(得分:1)

使用引号:

alter

引号分隔文字文本,但Sub SaveShtsAsBook() Dim Sheet As Worksheet, SheetName$, MyFilePath$, N& MyFilePath$ = ActiveWorkbook.Path & "\" & _ Left(ThisWorkbook.Name, Len(ThisWorkbook.Name) - 4) With Application .ScreenUpdating = False .DisplayAlerts = False ' End With On Error Resume Next '<< a folder exists MkDir MyFilePath '<< create a folder For N = 1 To Sheets.Count Sheets(N).Activate SheetName = ActiveSheet.Name Cells.Copy Workbooks.Add (xlWBATWorksheet) With ActiveWorkbook With .ActiveSheet .Paste .Name = SheetName [A1].Select End With 'save book in this folder .SaveAs Filename:=MyFilePath _ & "\" & SheetName & ".xls" .Close SaveChanges:=True End With .CutCopyMode = False Next End With Sheet1.Activate End Sub 需要一个实体(不是文本字符串,而是普通的实体名称)。