Viewing 15 posts - 2,506 through 2,520 (of 7,187 total)
Put a [font="Courier New"]PRINT @sql[/font] line in your code so that you can see exactly what's being executed.
By the way, you ought to use ALTER AUTHORIZATION instead of sp_changedbowner, since...
July 1, 2016 at 7:32 am
You're getting a NULL because the row doesn't exist in the other table. You'll probably want a different status for that. Try something like this
Status = CASE
WHEN TableA.Eno...
July 1, 2016 at 7:12 am
Depends on the workload on the server, whether there are any other instances, etc, etc. I would start with six, test, and adjust as necessary.
John
July 1, 2016 at 5:35 am
I'm not sure whether you can parameterise with an ADO.Net connection. Try changing it to OLE DB, or building your query into a variable and executing that instead.
John
July 1, 2016 at 5:13 am
You're attempting to restore PrismDataBillingTest from a backup of a database with a different name. Use RESTORE HEADERONLY to find out what database(s) are in your backup file. ...
July 1, 2016 at 3:46 am
Start by using PATINDEX to find the position of " admission" and " discharge" in the string. You can then work back from there to find the first instance...
July 1, 2016 at 2:39 am
Yes, and consider using a temp table instead of a table variable. The former has statistics on it and so you're likely to get a better query plan, especially...
June 30, 2016 at 9:42 am
In the last place I worked, the vendor's support team had full access to an application database. Not only that, but they also had access to remotely access our...
June 30, 2016 at 5:28 am
No, the path to the executable - something like this:
"C:\Program Files\Microsoft SQL Server\110\Tools\Binn\sqlcmd.exe" -S . -U sa -P 123 -i "C:\Temp\Plugin\SQL\script.sql
John
June 30, 2016 at 5:13 am
Please post your amended script. What happens if you run the command from a command line instead of within the batch file? Obviously you'll need to substitute parameters...
June 30, 2016 at 4:57 am
Do you still get the error if you specify the path to the executable in your batch file?
John
June 30, 2016 at 4:27 am
I suppose for a rough and ready answer, you could query the plan cache for statements that don't contain "@". You'd have to eyeball the results to make sure...
June 28, 2016 at 8:48 am
I'm not sure whether there's a question there, but I still don't recommend doing it like that. Yes, if a new table is created then you have to create...
June 27, 2016 at 8:23 am
Thanks for the link, but if you don't make it clickable, people aren't going to bother reading it. Anyway, why not create 100 staging tables - one for each...
June 27, 2016 at 7:10 am
If there is no linked server, how are you doing the transfer? Why does this need to be dynamic - does the structure of the source table change on...
June 27, 2016 at 6:27 am
Viewing 15 posts - 2,506 through 2,520 (of 7,187 total)