Viewing 15 posts - 18,211 through 18,225 (of 18,926 total)
Yup... maybe we should post it as a script??
April 7, 2005 at 6:52 am
INSERT INTO TestTableA
(CustName, @price)
I assume @Price2 is a dynamic column name. This is forbidden in sql server.
read this on dynamic sql :
April 6, 2005 at 2:41 pm
You can if it's dynamic sql within an exec statement.. something like this is possible :
Create proc a
AS
exec('
create view b
as
select getdate() as Today'
)
GO
exec a
select * from b
drop proc...
April 6, 2005 at 1:43 pm
You would need dynamic sql to do something like this. There's no point in creating of SP like this one if you simply want to do dynamic sql.
April 6, 2005 at 1:17 pm
I'll assume that bubbly is some kind of beer... and as I don't drink I'll politely decline the offer. You could send the thanks to Frank Kalis as...
April 6, 2005 at 12:43 pm
You can look up "linked servers, adding" in the books online for all the info you need.
April 6, 2005 at 12:18 pm
yes the first one will work just as is..
the 2nd one will need a little tweaking :
...
where TicketDate between
dateadd(d, 0, DATEDIFF(d, 0, Getdate()))
and --note the 1 in the...
April 6, 2005 at 12:16 pm
Select Col1, max(Col2) as MaxCol2 from dbo.YourTable Group BY Col1 Order by Col1
April 6, 2005 at 11:58 am
You might test it against this method, because the first one will never use and index seek to find the dates because of all the functions.
Declare @StartDate as datetime
Declare @EndDate...
April 6, 2005 at 11:56 am
Select * from dbo.Tickets where dateadd(d,0, datediff(d, 0, TicketDate)) = dateadd(d,0, datediff(d, 0, getdate()))
April 6, 2005 at 11:53 am
This is the one that is the closest :
INSERT INTO TestTableA
(CustName, Price2)
SELECT CustName, Price
FROM TestTableB B
WHERE NOT EXISTS (SELECT CustName FROM TestTableA A where A.CustName = B.CustName)
you could also...
April 6, 2005 at 11:30 am
My own personal opinion :
One connection held opened 24/7 is already one too many. That is real for all programming languages/versions (with exceptions obviously). It would be...
April 6, 2005 at 11:21 am
It's a little hard for me to tell what's exactly happening from this.
Can you create new user in the db, then use the application with this new user?
If so you...
April 6, 2005 at 10:41 am
It just can't be done. You can't update or insert data from INSIDE a function.
So you are basically searching for gaps in an identity environement, identity which is reseeded...
April 6, 2005 at 9:54 am
Here's a little code to show how to insert into a function... however I don't think it would help in your case. Why are you trying to insert records...
April 6, 2005 at 9:37 am
Viewing 15 posts - 18,211 through 18,225 (of 18,926 total)