T-SQL: SUSER_SNAME vs SUSER_NAME?

If you call the function without an argument they will both return the same value. But they do take different arguments: SUSER_SNAME() takes the varbinary(85) SID of a login as argument SUSER_NAME() takes the integer principal_id of a login You can verify this like: select suser_name(principal_id) , suser_name(sid) , suser_sname(principal_id) , suser_sname(sid) from sys.server_principals where … Read more

Can SQL Server Express LocalDB be connected to remotely?

No, SQL Server Express LocalDB doesn’t accept remote connections. The idea with shared network folder might work, but only if you are able to make sure the LocalDB instance is shutdown before you try to copy the file. Also keep in mind that only one LocalDB instance can have any given database file open at … Read more

How to open multiple .sql files in only one ssms instance

After spending most of my working day looking for the solution I finally found it. Thanks God, I was almost running out with this issue. Hope it helps somebody else!!!. Update: linked domain expired, so here’s what it said: Considering how integrated Microsoft tools usually are the result is frustrating when you tell Visual Studio … Read more

Stored Procedure parameter default value – is this a constant or a variable

It has to be a constant – the value has to be computable at the time that the procedure is created, and that one computation has to provide the value that will always be used. Look at the definition of sys.all_parameters: default_value sql_variant If has_default_value is 1, the value of this column is the value … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)