Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

Recent questions tagged TSQL

0 votes
529 views
1 answer
    I know the syntax: ALTER TABLE [TheTable] DROP CONSTRAINT [TheDefaultConstraint] but how to I drop the default ... at CREATE TABLE time.) See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
484 views
1 answer
    How can I convert a String to a Date in T-SQL? My test case is the string: '24.04.2012' See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
624 views
1 answer
    I'm looking for a built-in function/extended function in T-SQL for string manipulation similar to the String.Format method in .NET. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
769 views
1 answer
    I need to ALTER the data types of several columns in a table. For a single column, the following works fine ... 0), CM_CommodityID NUMERIC(18,0) See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
536 views
1 answer
    In T-SQL, this is allowed: DECLARE @SelectedValue int SELECT @SelectedValue = MyIntField FROM MyTable WHERE MyPrimaryKeyField ... I tried it!) See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
716 views
1 answer
    How do I add a string with auto-increment value in SQL Server? create table date (sno int 'emp_'+ ... need following as output emp_1 emp_2 See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
692 views
1 answer
    I am working on an SQL Query using pvots with dynamic columns in SQL Server (T-sql). Rather than submitting ... hard coded? Thanks Leon Lai See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
557 views
1 answer
    I use DATEDIFF function to filter records added this week only: DATEDIFF(week, DateCreated, GETDATE()) = 0 and I ... 0 in third column too. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
701 views
1 answer
    I am working with SQL Server 2008 R2, trying to calculate a moving average. For each record in my view, I ... data within a range of records. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
633 views
1 answer
    I am maintaining some code that has a trigger on a table to increment a column. That column is then ... trigger to avoid cursor based approach See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
666 views
1 answer
    I have a table where I created an INSTEAD OF trigger to enforce some business rules. The issue is that when I ... How do I make this work? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
474 views
1 answer
    The following: MERGE dbo.commissions_history AS target USING (SELECT @amount, @requestID) AS source (amount, request ... with this mechanism. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
917 views
1 answer
    What is the best way to shorten a datetime that includes milliseconds to only have the second? For example 2012-01-25 ... 2012-01-25 17:24:05 See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
642 views
1 answer
    According to BOL (SQL Server Books Online) on sp_dbcmptlevel, This feature will be removed in a future version ... level without using GUI? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
839 views
1 answer
    Now when I query SELECT @@language it gets 'us_english'. But I need russian. I can't use SET LANGUAGE russian ... (for all new sessions). See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
776 views
1 answer
    How can rows with non-ASCII characters be returned using SQL Server? If you can show how to do it for one ... SPACE (3210) through ~ (12710) See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
552 views
1 answer
    I have a problem using RANK() in SQL Server. Here's my code: SELECT contendernum, totals, RANK() OVER ( ... numbers will have the same xRank. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
813 views
1 answer
    I have to calculate the difference in hours (decimal type) between two dates in SQL Server 2008. I couldn't find ... it should return me 1.5. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
566 views
1 answer
    When adding an item in my database, I need it to auto-determine the value for the field DisplayOrder. Identity ... there a better/simpler way? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
542 views
1 answer
    If we have a table like this: Grp Value Grp1 2 Grp1 5 Grp1 3 Grp2 3 Grp2 -5 Grp2 -2 Grp3 4 Grp3 0 Grp3 1 ... 0 Grp4 8 Grp5 7 Grp6 NULL Grp7 -10 See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
601 views
1 answer
    I tried this SELECT convert(datetime, '23/07/2009', 111) but got this error The conversion of a varchar data type ... How to fix the 1st one ? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
600 views
1 answer
    Is it true that SQL Server 2000, you can not insert into a table variable using exec? I tried this script and ... that true, what should I do? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
587 views
1 answer
    I have a SQL Server database. One field has values which are like ID VALUE 1 NEGATIF 2 11.4 3 0.2 4 A RH(+) ... add more filter like [-+ ()] ? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
507 views
1 answer
    Is there a way to search for one value (in my case it is a UID of the type char(64)) inside any column ... pain if the database is too huge. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
662 views
1 answer
    I have a string like this: 72594206916,2,1/2/08,Tacoma,WA:72594221856,5,5/7/13,San Francisco,CA:72594221871 ... its output into a table somehow? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
510 views
1 answer
    I am writing a function that returns a table. There are two parameters that are passed to the function and ... SP_EXECUTESQL @SQL RETURN END GO See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
641 views
1 answer
    I am wondering why I cannot use variable column name like that: declare @a as varchar; set @a='TEST' select @a from x; Thank you See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
489 views
1 answer
    Is it a good idea to index varchar columns only used in LIKE opertations? From what I can read from query ... has been optimized with an index? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
Ask a question:
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...