Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
    Hi All,
    is there any way to push data into using a trigger approach in mssql.
    Rakib Ahmed

    I have a one table Called MeetingInfo. In that table there is a info regarding Meeting Start Date and End Date And Metting Room.

    I want to make a query by which i want to see all the Meeting start Date and EndDate but From today to 365Days Ago. Below Way i am trying


    Select * from MeetingInfo

    WHERE StartDate between DATEADD(DAY,-365,GETDATE()) and@Today

    AND tbia.EndDate between DATEADD(DAY,-365,GETDATE()) and @Today

    What do u think this is the correct way to see the results

    @Rakibxl first off, if you use GETUTCDate(), then this ma return some surprising results depending on where you live / where this server stands and the user is
    That is because the timezone offset is not included for this. if you want to respect this (and have reason to use this), then you need to keep in mind that you will have timezones to display for each user depending on her or his location
    However, interestingly, you use GetDate() in the Filtering section, so this will probably have efffects on this.
    but apart from that, it seems good to me, but I haven't tested this.
    i have a sql question.i have a query like this. how can i change it so instead of counting one column in the group, it counts the combinations of two columns inside a group
    select column1,count(distinct column2)
    from table
    group by column1

    @alealpha2000 You could use CONCAT(column1, column2) -

    select COUNT(CONCAT(column1, column2)) from table1 group by CONCAT(column1, column2)

    Depending on what you're counting, as you seem to need distinct values, you may need to use window functions to deduplicate first. Google deduplication and "over(partition by" for help with that. If you go that route, you may need to wrap this in a CTE;

    ;with A as (select concat(column1, column2) as 'NewName' from table1) select count(NewName) from A

    can anyone please help me with sql server connection strings using windows authentication?
    Good Day. Have a question, could you please give me your insight. For select on website, is it good idea to have two columns to save select I'd and its value? Thx.
    Hello everyone.
    I need some help with mssql connection. When I try to connect to mssql server I get this error:
    Message Iteration=2|SQLState=IM006|Native Error=|Message=[Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed[Message Iteration=3|SQLState=08001|Native Error=|Message=[Microsoft][SQL Server Native Client 10.0]Client unable to establish connection]'.
    I'm trying to connect to a mssql server 2019]
    Hi, can anyone please point me in the direction of some information to do with using a SQL FileTable in a document versioning system? Thanks

    gympuma > <@gitter_nj-db:matrix.org> Hi, can anyone please point in the direction of some information to do with using a SQL FileTable in a document versioning system? Thanks

    Could you explain a little more? You want to log versioning in SQL? Generate documents from t-sql into a file system?


    gympuma > <@gitter_marcelosf:matrix.org> Message Iteration=2|SQLState=IM006|Native Error=|Message=[Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed[Message Iteration=3|SQLState=08001|Native Error=|Message=[Microsoft][SQL Server Native Client 10.0]Client unable to establish connection]'.

    What connection string are you using? (blank out sensitive info before sendind)

    Adedamola Adedapo
    Hi, can anyone please help with this error , I am trying to connect to an mssql server on vscode running on ubuntu, and i keep getting this error.mssql: Failed to connect: Microsoft.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 35 - An internal exception was caught) ---> System.Net.Internals.SocketExceptionFactory+ExtendedSocketException (00000005, 6): No such device or address
    at System.Net.Dns.InternalGetHostByName(String hostName)
    at System.Net.Dns.GetHostAddresses(String hostNameOrAddress)
    at Microsoft.Data.SqlClient.SNI.SNITCPHandle.Connect(String serverName, Int32 port, TimeSpan timeout)
    at Microsoft.Data.SqlClient.SNI.SNITCPHandle..ctor(String serverName, Int32 port, Int64 timerExpire, Object callbackObject, Boolean parallel)
    at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at Microsoft.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover, SqlAuthenticationMethod authType, SqlAuthenticationProviderManager sqlAuthProviderManager) at Microsoft.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover) at Microsoft.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout) at Microsoft.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance) at Microsoft.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling, String accessToken, DbConnectionPool pool, SqlAuthenticationProviderManager sqlAuthProviderManager) at Microsoft.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) at Microsoft.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions) at Microsoft.Data.ProviderBase.DbConnectionFactory.<>c__DisplayClass40_0.<TryGetConnection>b__1(Task1 _)
    at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
    --- End of stack trace from previous location where exception was thrown ---
    at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
    --- End of stack trace from previous location where exception was thrown ---
    at Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection.ReliableSqlConnection.<>cDisplayClass30_0.<<OpenAsync>b0>d.MoveNext() in D:\a\1\s\src\Microsoft.SqlTools.ManagedBatchParser\ReliableConnection\ReliableSqlConnection.cs:line
    I have a database in which some tables have a lot (millions) of rows with binary data. The database is having a lot of I/O problems so we want brake it down to store the data into different disks.
    Is there any option to do this without break it down into two separate databases?
    Can I assign a table into different storage?
    Mike Mahon
    question? When a Entity Framework connects to sql server, what port is utilized?
    Shreyas Patil
    I have a requirement of writing a pandas dataframe to SQL server via stored procedure so I'm using df
    df.to_sql() but there seems to be some limitation with this approach since sql server supports only 2100 cells at a time while writing to db say for instance I have 10 rows then I will be able to write only 210 rows in one batch , and writing is happening very inefficiently, could anyone suggest a more efficient approach to writing a pandas dataframe to SQL server ?
    oh hi
    thank you for all the cool tech
    im appreciating every moment of learning innovation
    Christian Gann
    hello! i wanna develop a ssms extension to prevent some accidental sql execution, could anyone provide some information about its development tutorials or introduction of ssms extension framework?
    Dear sir. I'm starter of vsc. plz help me. I can't connect the server.
    I can connect like this way by MSSM studio.
    how can I connect by VSC?
    sir i need to connect mysql to vs codfe
    1 reply
    plzz help
    Egorka Voronyansky
    Hey, guys! Can you help me please. I don't understand why I got next error. I have the
    update orders o
    set inn = s.inn,
        ogrn = s.ogrn
    from (select id, inn, ogrn from public.limits) as s
    where s.id = o.limit_id;
    Simple SQL update and when I try execute it via Flyway a got an error
    Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near the keyword 'SET'.
    Hugh Gleaves
    Hi I have a question, in principle, would it be possible for SSMS to display not just a column name in the column header, but the column name prefixed by table name?
    This would be helpful when doing ad hoc queries that contain joins and where several tables have columns with same name
    Im not sure of the data sent back by the server contains enough info for this, but if it did then this could be possible.
    Hugh Gleaves
    My error !
    @Korporal Why not simply alias your columns?
    has anyone seen this error before ? "mssql: mssql: Failed to connect: Microsoft.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: HTTP Provider, error: 0 - )
    1 reply
    I tried to connect to SQL server running under linux(from vscode running under linux).
    For the same server, I can connect using standard SSMS or even pyodbc
    only the mssql plugin for vscode gives me this error
    oh and I have tried vscode under window and basically the same error
    Egorka Voronyansky
    Hi, @everyone!
    I just faced with next problem
    java.lang.IllegalStateException: Cannot load driver class: com.microsoft.sqlserver.jdbc.SQLServerDriver
    I have driver in classpath, my app works correctly on local machine, but on the server I got that error. What I can do or what is possible reason for this error?
    Anyone know anything about a future version of SQL Server? It's crazy that it's been two years since 2019 and MS hasn't said a peep publicly about what's next yet. I'm wondering if this means MS is shifting resources away from SQL Server...

    Hi colleagues,

    I have a problem when I don't know who or which application service makes insert/update request to a particular table. Could you tell me please if it is possible to get this information from MS SQL using a specific query?

    Hi everyone! I have one question. mssql extension doesn't work on Arch right?