Play around with this one.
declare @dynamicsql varchar(max)
set @dynamicsql = 'INSERT INTO Results SELECT'
select @dynamicsql = @dynamicsql + '
t1.list from ' + dblist.list + '..files t1
join searchlist
on t1.list like ''%' + searchlist.list + '%''
UNION SELECT'
FROM dblist
JOIN...
It's typically used by applications that employ server-side cursors to process the data.
-----------
With business clients like mine, you'd be better off herding cats.
In the case of David Lee Roth, perhaps search and rescue would be in order.
-----------
With business clients like mine, you'd be better off herding cats.
People in the Valley are very different from the rest of us. Their world hinges on an unusual perspective.
Apparently, so do their gates and pillars.
-----------
With business clients like mine, you'd be better off herding cats.
The crux of the biscuit is the apostrophe. No, wait; I mean the crux of the matter is the neither...nor construction.
It typically takes a singular verb. Sounds awkward, and is disappearing from general use, but hey, a rule's a rule.
http://www.grammarbook.com/grammar/subjectVerbAgree.asp...
This question should be posted to the MySQL forum. There may be behaviors of IFNULL() that T-SQL folks are not familiar with.
https://www.1keydata.com/sql/sql-ifnull.html
-----------
With business clients like mine, you'd be better off herding cats.
Try Powershell:
http://thomaslarock.com/2012/07/automate-sql-server-express-backups-with-powershell/
-----------
With business clients like mine, you'd be better off herding cats.
I use connectionstrings.com for formats. Look up trusted connections there. It's fairly simple.
-----------
With business clients like mine, you'd be better off herding cats.
Kinda simply put (sorry), but you could wrap this code in a for-each loop, and parse a comma-delimited list of OU's from the SearchBase property. Then evaluate each for which language you wish to apply.
-----------
With business clients like mine, you'd be better off herding cats.
When you select 'Script Table as' > 'Create to' > 'New Query Editor Window', does it show the ID field? If so, it's reasonable to assume that SSMS knows enough not to include a primary key field in an INSERT statement.
-----------
With business clients like mine, you'd be better off herding cats.
I included the DDL and insert query to serve as a complete example. The query in my code block performs a SUM of the amount for each type of source. Did you try that? Maybe I'm not understanding what you're trying to accomplish.
-----------
With business clients like mine, you'd be better off...
Passing variables to an OPENQUERY statement is a bit tricky. You could use sp_executesql; it's cleaner.
Check this thread for some ideas.
-----------
With business clients like mine, you'd be better off herding cats.
This is a perfect case for GROUP BY.
USE [Test]
GO
/****** Object: Table [dbo].[SumTest] Script Date: 04/20/2016 12:52:53 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =...
Sorry, missed the closing paren you wrapped around your WHERE clause. You should be good to go now.
-----------
With business clients like mine, you'd be better off herding cats.
replace the code on the right side of the equation with
convert(varchar,DATEADD(d,CASE DatePart(dw,getdate())
WHEN 1 THEN 1
WHEN 7 THEN 2
WHEN 6 THEN 3
WHEN 5 THEN 4
ELSE 2
END,getdate()),103)
-----------
With business clients like mine, you'd be better off herding cats.
Looks like you want records two business days in the future.
Try
WHERE (CONVERT(varchar, dbo.OrderHeader.DateRequired, 103) = convert(varchar,DATEADD(weekday,2,getdate()),103))
-----------
With business clients like mine, you'd be better off herding cats.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.