SQL Server – An error occurred while executing batch. Error message is: The directory name is invalid
All you need to do is to open command prompt and type: mkdir %temp% and press Enter. Simple as that. No logout/login required.
All you need to do is to open command prompt and type: mkdir %temp% and press Enter. Simple as that. No logout/login required.
I finally figured it out. It was buried in the comments to the article jfrobishow published. Thank you SO much. Here is the whole response that led me to the solution: quote:Originally posted by fredclown If you use SQL 2005 you can use replace with a text type. All you have to do is the … Read more
You have a variety of problems. First, why are you using your specific @@FETCH_STATUS values? It should just be @@FETCH_STATUS = 0. Second, you are not selecting your inner Cursor into anything. And I cannot think of any circumstance where you would select all fields in this way – spell them out! Here’s a sample … Read more
I had the same problem, except I have a table with 2 billion rows, so the log file would grow to no end if I did this, even with the recovery model set to Bulk-Logging: insert into newtable select * from oldtable So I operate on blocks of data. This way, if the transfer is … Read more
I would like to point out that none of the T-SQL on this page will work precisely because none of them join to the syssessions table to get only the current session and therefore could include false positives. See this for reference: What does it mean to have jobs with a null stop date? You … Read more
You cannot. The column order is just a “cosmetic” thing we humans care about – to SQL Server, it’s almost always absolutely irrelevant. What SQL Server Management Studio does in the background when you change column order there is recreating the table from scratch with a new CREATE TABLE command, copying over the data from … Read more
If you DROP and CREATE the procedure, you will loose the security settings. This might annoy your DBA or break your application altogether. What I do is create a trivial stored procedure if it doesn’t exist yet. After that, you can ALTER the stored procedure to your liking. IF object_id(‘YourSp’) IS NULL EXEC (‘create procedure … Read more
EXCEPT treats NULL values as matching. This query: WITH q (value) AS ( SELECT NULL UNION ALL SELECT 1 ), p (value) AS ( SELECT NULL UNION ALL SELECT 2 ) SELECT * FROM q WHERE value NOT IN ( SELECT value FROM p ) will return an empty rowset. This query: WITH q (value) … Read more
Instead of SET, use SELECT. SELECT @Test=”test”, @Test2 = ‘Test2′, @Test3 = 3; Here’s a great article on SET vs SELECT in SQL Server / TSQL.
In Oracle, you could do this: create table D ( ID numeric(1), CODE varchar(2), constraint PK_D primary key (ID, CODE) );