Viewing 15 posts - 1,471 through 1,485 (of 3,544 total)
Do you mean like this (for your original query)
EXECUTE('select * from [' + @dbname + '].dbo.tblAccounts where [date]=''09/04/1998''')
Note the number of single quotes
Far away is close at hand in the images of elsewhere.
Anon.
November 9, 2007 at 8:54 am
As a matter of interest why do you not do this
SELECT ci.itemName
FROM Content_Items ci
INNER JOIN Content_Pages AS cp ON ci.contentItemId = cp.contentItemId
INNER JOIN FREETEXTTABLE(Content_Items, title, @searchString) AS...
Far away is close at hand in the images of elsewhere.
Anon.
November 1, 2007 at 8:37 am
Gail... nice explanation! Short, sweet, and to the point.
Ditto 😀
What a nice friendly dialogue :w00t:
Must be painful with all that back slapping 😉
Far away is close at hand in the images of elsewhere.
Anon.
October 30, 2007 at 7:37 am
...but I doubt I ever have the skills to write anything like it!
Sure you will, we all started as beginners 😉
Now we try to elevate ourselves to Jeffs' level...
Far away is close at hand in the images of elsewhere.
Anon.
October 18, 2007 at 1:53 am
:ermm: suspicious question
SELECT employeeid, sickleavehours + (vacationhours * salariedflag) AS [paidtimeoff]
Far away is close at hand in the images of elsewhere.
Anon.
October 17, 2007 at 7:17 am
Plus only counting nullable columns will reduce the size of the query
Could build several strings and then EXEC(@string1+@string2+@string3)
Or use a cursor like this (but performance could be poor due to...
Far away is close at hand in the images of elsewhere.
Anon.
October 17, 2007 at 7:00 am
* -1 should work
what is the datatype and what makes you think it did not work
btw
preceding a column or variable with - will achieve the same, eg
DECLARE @myvariable int...
Far away is close at hand in the images of elsewhere.
Anon.
October 16, 2007 at 7:09 am
Notwithstanding the above, I think this might work
You will need a Numbers table (search this site for examples)
SELECT k.[ID],k.Word,k.WordCategory
FROM (SELECT SUBSTRING(' ' + @String + ' ',
...
Far away is close at hand in the images of elsewhere.
Anon.
October 16, 2007 at 7:04 am
SELECT j.[name],
MAX(CAST(
STUFF(STUFF(CAST(jh.run_date as varchar),7,0,'-'),5,0,'-') + ' ' +
STUFF(STUFF(REPLACE(STR(jh.run_time,6,0),' ','0'),5,0,':'),3,0,':') as datetime)) AS [LastRun]
FROM msdb.dbo.sysjobs j
INNER JOIN msdb.dbo.sysjobhistory jh
ON jh.job_id = j.job_id AND jh.step_id = 0
WHERE j.[name]...
Far away is close at hand in the images of elsewhere.
Anon.
October 15, 2007 at 6:52 am
Is the database really the best place to do this?
However providing the data is always in the format specified then this is how I would do it
Create a temp table...
Far away is close at hand in the images of elsewhere.
Anon.
October 12, 2007 at 2:43 am
Wow :w00t:
A cool headed amicable discussion about Banker's Rounding 😎
Amazing 😉
Far away is close at hand in the images of elsewhere.
Anon.
October 9, 2007 at 7:07 am
I read this joins on positions with a comma
Correct 🙂
however outputting n in the select list points to the start of each delimited string
n.Number is the char position of the...
Far away is close at hand in the images of elsewhere.
Anon.
October 9, 2007 at 5:06 am
Where does the data come from?
If from a table then you can use this in a subquery
SELECTa.AccountNo,a.[Date],SUBSTRING(',' + a.[String] + ',', n.Number + 1,
CHARINDEX(',', ',' + a.[String] + ',',...
Far away is close at hand in the images of elsewhere.
Anon.
October 8, 2007 at 6:56 am
Peter Larsson (10/3/2007)
Cross post
Thanks Peter 🙂
Far away is close at hand in the images of elsewhere.
Anon.
October 3, 2007 at 7:55 am
What is ticCount supposed to signify?
Please edit your post and insert spacing as I cannot determine what data belongs in which column
Far away is close at hand in the images of elsewhere.
Anon.
October 3, 2007 at 7:05 am
Viewing 15 posts - 1,471 through 1,485 (of 3,544 total)