December 10, 2007 at 12:23 pm
The need is to formulate the needed file paths and database name based on an input by my new DBA. I am doing this because I am in need of load balancing the data files on different platters to get some better performance and need to remove the human error in the placement of them.
After some manipulation I will store the values I need in some variables (varchars) and pass them to the Create Database command. It doesnt work for me because I cannot pass the variable to the command. It doesnt like it. BTW - I have this problem anytime I try to pass a variable to a procedure looking for N' type of information.
Any suggestions?
Kindest Regards,
David
** Obstacles are those frightening things that appear when we take our eyes off the goal. **
December 10, 2007 at 12:29 pm
I'm not sure I follow you. Can you post what you've tried and what error it gives please?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
December 10, 2007 at 1:06 pm
Instead of VARCHAR, if you use NVARCHAR, that might address the issue.
----------------------------------------------------The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood... Theodore RooseveltThe Scary DBAAuthor of: SQL Server 2017 Query Performance Tuning, 5th Edition and SQL Server Execution Plans, 3rd EditionProduct Evangelist for Red Gate Software
December 10, 2007 at 1:17 pm
Or build dynamic SQL. For a case like this (CREATE DATABASE command), I wouldn't worry about any performance issues.
Follow me on Twitter: http://www.twitter.com/way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
December 10, 2007 at 4:51 pm
STUPID!!!!! I never tried using the NVARCHAR declaration! It's the little things we forget. I will let you know if that resolves my problem.
Kindest Regards,
David
** Obstacles are those frightening things that appear when we take our eyes off the goal. **
December 11, 2007 at 5:19 am
Not stupid, you just needed a nudge.
I've been going around telling all & sundry that the bit data type wouldn't take a null. Then Gail just simply tells me I was wrong. I went around bashing myself in the head for a whole day over that one. I still don't know where I got such a mistaken belief.
----------------------------------------------------The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood... Theodore RooseveltThe Scary DBAAuthor of: SQL Server 2017 Query Performance Tuning, 5th Edition and SQL Server Execution Plans, 3rd EditionProduct Evangelist for Red Gate Software
December 11, 2007 at 5:45 am
We've all done it at least once.
I told a lot of people that truncate wasn't logged and couldn't be rolled back. Even mentioned that in some code reviews I did.
Then I tried it. :Whistling:
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply