Viewing 15 posts - 6,496 through 6,510 (of 7,631 total)
Glad we could help. Let us know how it works out.
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
June 24, 2008 at 12:11 pm
You need an IF, not "SELECT.. CASE.. THEN.."
IF 1 = (SELECT 1)
BEGIN
...
END
ELSE
BEGIN
...
END
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
June 24, 2008 at 12:03 pm
try this:
/*
1 use union, not join
2 Use INFORMATION_SCHEMA.TABLES
3 include columns for ordering, remove in final
4 put commas at beginning, NOT end
*/
Select CmdOut
From(Select 'EXEC dbo.spGenerateInsUpdate N'''...
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
June 24, 2008 at 11:53 am
...?
Use the SOUNDEX or DIFFERENCE functions?
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
June 24, 2008 at 11:29 am
jezemine (6/24/2008)
SELECTCOUNT(*) AS TotalRows
,COUNT(case when Status='P' then 1 else 0 end) AS Present
,COUNT(case when Status='A' then 1 else 0 end) AS Absent
FROM Attendance WHERE sid=studentnumber
Jezemine: SUM for numbers, COUNT...
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
June 24, 2008 at 11:27 am
Well, you could install Powershell, write a Powershell script to do it (which I am told is comparatively easy), then call the Powershell script from your .BAT file.
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
June 24, 2008 at 11:03 am
Yeah, I just looked it up and I cannot see hot to do it either (I must have been thinking about some other DB interface, like SMO or something).
The only...
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
June 24, 2008 at 8:33 am
Upon further consideration, I think that I may have spoken too soon. It turns out that these are difficult elements to script out from the SQL command line. ...
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
June 24, 2008 at 5:56 am
Chris Hall (6/24/2008)
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
June 24, 2008 at 5:53 am
Yeah, I just saw this the other day, but I don't have my Visual Studio up to test it.
If you have yours up, edit the parameters of the "cmd.Parameters.Add (1,...
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
June 24, 2008 at 5:43 am
Try this:
--======your variables: fill these in!
declare @myschema SYSNAME, @MYTable SYSNAME
Select @myschema = 'dbo', @MyTable = 'TestTable'
declare @sql nvarchar(max)
Set @sql = 'SELECT * FROM ('
--====== build command string with all of...
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
June 24, 2008 at 5:32 am
Well on 2005 you could check SYSPROCESSES for a process with program name 'SQLAgent - Generic Refresher'.
I'm not sure what it is on 2000.
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
June 24, 2008 at 5:09 am
Thnx!
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
June 24, 2008 at 5:00 am
Try it like this:
cmd.Parameters.Add (1,SqlInt).value = 15
(or maybe 0?)
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
June 23, 2008 at 8:16 pm
Jeff Moden (6/23/2008)
...So... wouldn't that be a Catch-22? ...
More of a "Cache-22" actually ... 😀
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
June 23, 2008 at 8:11 pm
Viewing 15 posts - 6,496 through 6,510 (of 7,631 total)