Viewing 15 posts - 6,856 through 6,870 (of 7,631 total)
You need to use dynamic SQL if you want to treat the tablename as a variable.
However, you cannot use dynamic SQL in a user-defined function.
You'll have to use another approach.
[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]
May 26, 2008 at 12:21 pm
Show us an example of your csv 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]
May 26, 2008 at 12:10 pm
glad I could help!
[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]
May 26, 2008 at 12:06 pm
jlp3630 (5/26/2008)
Is using ON DELETE CASCADE always preferred versus creating stored procedures to perform the same functionality?
Definitely not. In fact I would say that it is more the reverse:...
[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]
May 26, 2008 at 12:03 pm
If on the other hand, you are already committed to a DW approach, then I would say that your original idea is on the right track. I would simply...
[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]
May 26, 2008 at 10:51 am
I agree with Jeff, and just to add to it: From a relational design standpoint, this is better implemented as a PrimaryEmailID attribute (column) of the Employee table where...
[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]
May 26, 2008 at 10:28 am
Heh. I remember the first time that I saw it. A co-worker called me over to his desk asked me what I thought it meant. I looked...
[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]
May 26, 2008 at 10:06 am
Please post the sql code from the stored procedures and the XML qeury plans for your DEV and production environments.
[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]
May 25, 2008 at 11:43 am
This trigger text should be able to extract it for any Server-level trigger:
select
CAST(eventdata().query('/EVENT_INSTANCE/DatabaseName[1]/text()') as NVarchar(128))
[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]
May 24, 2008 at 10:01 pm
OK, well this is ugly as sin, but it will work:
Select
Case When Min(substring(COLUM_NAME, 1, 1))
= Max(substring(COLUM_NAME, 1, 1))
Then Min(substring(COLUM_NAME, 1, 1))
Else '' END
+Case When...
[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]
May 24, 2008 at 9:29 pm
As I said, the problem is in your data definitions. Please post them if you still want any help.
Here is a link that explains how to get the best...
[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]
May 24, 2008 at 8:27 pm
It's still CHARINDEX, you just have to be more persistent:
Select CharIndex( @string, '_', CharIndex(@string, '_') + 1)
This returns the second occurrence of "_" in @string.
[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]
May 22, 2008 at 9:46 pm
Well, it parses just fine for me in SQL2005, so it must be in your data definitions.
[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]
May 22, 2008 at 9:04 pm
Nice job, Jack. This could serve as a textbook example of how to provide technical support.
[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]
May 22, 2008 at 8:54 pm
As it happens, I was just working with a customer today on CLR assemblies, and it seems that the key/login is supposed to be used to "Sign" the assembly when...
[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]
May 22, 2008 at 3:43 pm
Viewing 15 posts - 6,856 through 6,870 (of 7,631 total)