Assuming you have access and sufficient rights to the database on the SQL server via SSMS.
Create a shared folder on a different network server 192.I.Have.Access. Grant the SQL engine and agent accounts read and write access to the shared folder.
You can take backups to the share (with write access) and you can restore backups from the share (with read ...
You can simoly put around the Select ... ORDER BY RAND() in parenthesis, so that MysSQL knows how to process it
You can turn it off via Auto list members via: Tools->Options->Text Editor->Transact-SQL->General->Auto list members, however this actually causes a bug in SSMS where you get an object null error whenever you hit backspace that repeatedly annoys you.
I find Apex SQL to be quite slow, so I don't use it.
Intellisense is incredibly useful, so I ...
you should split the string using the appropriate function and then put two tables in join
declare @mylistofstrings varchar(max) = 'Love,Need'
create table #fooTable(my_id int, my_value varchar(50));
insert into #fooTable(my_id, my_value) values ( 1, 'I Love Sql');
insert into #fooTable(my_id, my_value) values ( 2, 'I Hate Linq');
insert into #...
I had a similar problem (see https://stackoverflow.com/questions/63043157/converting-binary-data-to-ascii-in-sql-server-with-illegal-characters).
I found a solution for my purposes, which uses the heuristic approach of converting the binary to a hex string, then doing string replacement of "00", before doing back to binary and string again.
Refresh Management Console
The first step to perform, is to check that the SSMS (SQL Server Management Studio) is displaying the actual state of all the databases. To achieve this, you would right-click the databases branch in the Management Console and in the context menu select Refresh.
Now depending on the actual state of the database ...
OK, found how to do it in SQL Server 2008:
@loginame = N'YourLogin',
@rolename = N'dbcreator';
Thanks again for the suggestions: when this DB will be migrated now I know that probably I'll have to modify the script to use ALTER SERVER ROLE
Are you attempting this with SSMS? I followed this process using SSMS v18.4:
Take DB offline
Manually delete mdf and ldf files.
Right click on database in SSMS and click 'Delete'.
This worked just fine for me.
You can only add logins to server roles, not database users. To remove a login, you use ALTER SERVER ROLE ... DROP MEMBER:
ALTER SERVER ROLE dbcreator DROP MEMBER login_name;
Please stop using the stored procedures; they're all deprecated. For example, from the sp_addsrvrolemember documentation:
This feature is in maintenance mode and may be removed in a ...
This will allow you to choose which part by simply filtering on RowNum. It will work no matter how many values you have...(assuming data is in a table called #temp)
FIELD1,Value,ROW_NUMBER() OVER(PARTITION BY FIELD1 ORDER BY FIELD1) RowNum
CROSS APPLY STRING_SPLIT(FIELD1, ' ') T1
Specifically, this query will give you the first names. ...
You can use "Substrig" and "charindex" functions to get what you want.
See this code as a demo on how to use it:
declare @name varchar(30)
set @name = 'shyam banarjee'
select SUBSTRING(@name,1,charindex(' ',@name)-1)
In your case, instead of being a variable in the select, it will be your column name.
You could also look at "...
Create a new filegroup. Duplicate the tables you want to keep into the new filegroup. Copy the data you want to keep to these new tables using bulk insert instructions with optimizations for ordered data. Drop the old tables.
When all tables are processed drop the old filegroup, if possible. If not, move the objects and data back again then drop the new ...
I've always liked using UNPIVOT for these types of operations. Assuming you have some sort of ID column on the source table, this also works.
DECLARE @Company TABLE
PKID INT NOT NULL IDENTITY(1,1) PRIMARY KEY
, Company1 NVARCHAR(20) NULL
, Company2 NVARCHAR(20) NULL
, Company3 NVARCHAR(20) NULL
INSERT INTO @Company
You could use a union of three queries like something like this
SELECT 1 AS tableNro, Company1 AS CompanyName
SELECT 2 AS tableNro, Company2
SELECT 3 AS tableNro, Company3
To get the serial number you could use row_number like something like this
SELECT ROW_NUMBER() OVER(ORDER BY (x....
One way to get the desired result is with UNION ALL of a SELECT query for each company column. Assign the serial number value in order by source column and company name using ROW_NUMBER in the outer SELECT.
INSERT INTO #Company(Company1, Company2, Company3)
('ABC', NULL, NULL)
,('Test1', 'Test3', 'Test5')
,('Test2', 'Test4', 'Test6') ...