Viewing 15 posts - 1 through 15 (of 78 total)
I agree with Jerry, it is better to change the function to handle the nulls. Changing the function to handle the nulls makes it so that if you pass in...
Gary Johnson
Sr Database Engineer
October 24, 2008 at 2:28 pm
This is actually a tough question as you never know how the names are formatted or if there are two names for the last name such as "Van Allen".
Here...
Gary Johnson
Sr Database Engineer
October 21, 2008 at 8:36 pm
Thanks for posting the sample data and DML.
I'm not clear on what you want the output to be. If you can post that maybe we can come up with...
Gary Johnson
Sr Database Engineer
October 16, 2008 at 4:01 pm
Try this...
IF NOT EXISTS(SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'YourTableName'
...
Gary Johnson
Sr Database Engineer
October 14, 2008 at 2:55 pm
Now, I get to slide out from under the egg... I was thinking that you would use a regular SQL Job with steps created manually rather than the Maintenance Plan...
Gary Johnson
Sr Database Engineer
October 14, 2008 at 2:48 pm
Create the first plan, script it out with Enterprise manager and then change the database name to $(DBName). Save the script to a file. Now create a batch file that...
Gary Johnson
Sr Database Engineer
October 14, 2008 at 2:19 pm
While SQL Server allows this I feel it is a bad practice to have production code to run it. Here is why.
When SQL sees this syntax it will first...
Gary Johnson
Sr Database Engineer
October 14, 2008 at 1:33 pm
Wait a minute. That script doesn't work correctly if there is more than one field in the index.
Try this.
SELECT CREATE_INDEX_SQL
FROM (
SELECT TBL_NAME = o.name,
INDEX_NAME =...
Gary Johnson
Sr Database Engineer
October 13, 2008 at 6:04 pm
Very sneaky way to case the union in there Barry. I like it!
Gary Johnson
Sr Database Engineer
October 13, 2008 at 5:05 pm
You can also use this...
SELECT convert(datetime,convert(varchar,GetDate(),10))
Just replace the GetDate() function with your passed in value.
It would be interesting to see what performed better. 😉
Gary Johnson
Sr Database Engineer
October 10, 2008 at 4:55 pm
I would try this. Note that I'm only checking for existence in the case statement based on the left joins. I also removed your UDF in favor of the builtin...
Gary Johnson
Sr Database Engineer
October 10, 2008 at 4:34 pm
Noel,
That certainly works, but in our ETL system, the format file would be just one more thing for the Operations team to lose. Also, this way we can simply do...
Gary Johnson
Sr Database Engineer
October 10, 2008 at 4:24 pm
I would probably write this as follows. No subquery needed... 🙂
SELECT
oh.order_no
, od.order_line_no
, od.product
, od.quantity
FROM...
Gary Johnson
Sr Database Engineer
October 10, 2008 at 4:17 pm
What I do in this situation is to create a view without the ID column and BCP/BulkInsert into that. Make sure to set permissions correctly on both the base table...
Gary Johnson
Sr Database Engineer
October 10, 2008 at 3:32 pm
Why not just do this inline?
WHERE
srl.QuantityReceipted > 0 AND
...
Gary Johnson
Sr Database Engineer
October 8, 2008 at 1:25 pm
Viewing 15 posts - 1 through 15 (of 78 total)