I need to run a parameterized query. I was trying the below - but it tells me 0 rows inserted. Which piece is incorrect? I am wanting to set @BankID = to the MAX possible value of BankID then select all data for the max value of BankID into the temp table.
Declare @BankID int SELECT @BankID = MAX(BankID) FROM dbo.CompleteBankInfo WHERE BankID = @BankID Select * Into #BankData FROM dbo.CompleteBankInfo WHERE BankID = @BankID SELECT * FROM #BankData