how to get the full resultset from SSMS
I cast it to XML select @variable_with_long_text as [processing-instruction(x)] FOR XML PATH The processing-instruction bit is there to stop it entitising characters such as < to <
I cast it to XML select @variable_with_long_text as [processing-instruction(x)] FOR XML PATH The processing-instruction bit is there to stop it entitising characters such as < to <
You can do it using PATINDEX() function like below : select * from Test order by CAST(SUBSTRING(Name + ‘0’, PATINDEX(‘%[0-9]%’, Name + ‘0’), LEN(Name + ‘0’)) AS INT) SQL Fiddle Demo If you have numbers in middle of the string then you need to create small user defined function to get number from string and … Read more
The SQLOLEDB provider and the SQL Server ODBC driver that ship with Windows are legacy components provided only for backwards compatibility. These have been deprecated since SQL 2005. According to this blog post by the MSSQL Tiger Team: SQLOLEDB will not receive support for TLS 1.2. You will need to switch your driver to one … Read more
.NET Core doesn’t support Distributed Transactions because it would require a different transaction manager on each platform. It may appear in the future (here‘s the issue in-progress), but for now any Transaction that would require two different resource managers will throw this exception. Instead you can coordinate separate transactions. Have two separate transactions complete their … Read more
Microsoft’s ODBC drivers for SQL Server do not use a PORT= parameter. The port number, if any, is appended to the server name/IP with a comma, e.g., SERVER=xxxTest-SRV,51333;
For the field to be able to store unicode characters, you have to use the type nvarchar (or other similar like ntext, nchar). To insert the unicode characters in the database you have to send the text as unicode by using a parameter type like nvarchar / SqlDbType.NVarChar. (For completeness: if you are creating SQL … Read more
I think the geography method STIntersects() will do what you want: DECLARE @g geography; DECLARE @h geography; SET @g = geography::STGeomFromText(‘POLYGON((-122.358 47.653, -122.348 47.649, -122.348 47.658, -122.358 47.658, -122.358 47.653))’, 4326); SET @h = geography::Point(47.653, -122.358, 4326) SELECT @g.STIntersects(@h)
Try adding this line to the beginning of your stored procedure: SET FMTONLY OFF You can remove this after you have finished importing.
DELETE DELETE is a DML Command. DELETE statement is executed using a row lock, each row in the table is locked for deletion. We can specify filters in where clause It deletes specified data if where condition exists. Delete activates a trigger because the operation are logged individually. Slower than truncate because, it keeps logs. … Read more
Yes – you can have a foreign key that references a unique index in another table. CREATE UNIQUE INDEX UX01_YourTable ON dbo.YourTable(SomeUniqueColumn) ALTER TABLE dbo.YourChildTable ADD CONSTRAINT FK_ChildTable_Table FOREIGN KEY(YourFKColumn) REFERENCES dbo.YourTable(SomeUniqueColumn)